Skip to content

Commit

Permalink
Add support for mypy==1.9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
klausweiss committed Mar 10, 2024
1 parent a8fe47d commit a69a0f4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## 0.4.0

Drop support for Python 3.7.
- Drop support for Python 3.7.
- Add support for mypy==1.9.x.

## 0.3.10

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ See the [examples](#examples) section below.

## Supported versions

The plugin supports python 3.8 up to 3.12 and mypy >= 0.920 and <= 1.8.x.
The plugin supports python 3.8 up to 3.12 and mypy >= 0.920 and <= 1.9.x.

## Installation

Expand Down
3 changes: 2 additions & 1 deletion tests/test_mypy_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_mypy_plugin(testcase_file: _TestCase, run_mypy):
[
pytest.param("0.910", id="0.910 - before the first supported 0.920"),
pytest.param("0.992", id="0.992 - non-existent version greater than the last tested 0.x"),
pytest.param("1.9.0", id="1.9.0 - first greater than 1.8.x with breaking changes"),
pytest.param("1.10.0", id="1.10.0 - first greater than 1.9.x with breaking changes"),
],
)
def test_raises_for_unsupported_mypy_versions(version: str) -> None:
Expand All @@ -127,6 +127,7 @@ def test_raises_for_unsupported_mypy_versions(version: str) -> None:
pytest.param("1.6.0", id="1.6.0 - some 1.6.x version"),
pytest.param("1.7.0", id="1.7.0 - some 1.7.x version"),
pytest.param("1.8.0", id="1.8.0 - some 1.8.x version"),
pytest.param("1.9.0", id="1.9.0 - some 1.9.x version"),
],
)
def test_initializes_for_supported_mypy_versions(version: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion typing_protocol_intersection/mypy_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def plugin(version: str) -> typing.Type[mypy.plugin.Plugin]:
numeric_prefixes = (_numeric_prefix(x) for x in version_prefix.split("."))
parted_version = tuple(int(prefix) if prefix else None for prefix in numeric_prefixes)
if (len(parted_version) == 2 and (0, 920) <= parted_version <= (0, 991)) or (
len(parted_version) == 3 and (1, 0, 0) <= parted_version < (1, 9, 0)
len(parted_version) == 3 and (1, 0, 0) <= parted_version < (1, 10, 0)
):
return ProtocolIntersectionPlugin

Expand Down

0 comments on commit a69a0f4

Please sign in to comment.