diff --git a/CHANGELOG.md b/CHANGELOG.md index aff59b9..576a1b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.3.9 + +Add support for mypy==1.7.x. + ## 0.3.8 - Add support for mypy==1.6.x. diff --git a/README.md b/README.md index addca32..70d7185 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ See the [examples](#examples) section below. ## Supported versions -The plugin supports python 3.7 up to 3.12 and mypy >= 0.920 and <= 1.6.x. +The plugin supports python 3.7 up to 3.12 and mypy >= 0.920 and <= 1.7.x. ## Installation diff --git a/setup.cfg b/setup.cfg index 6b3892d..44dfedb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = typing-protocol-intersection -version = 0.3.8 +version = 0.3.9 description = Protocol intersection for mypy long_description = file: README.md long_description_content_type = text/markdown diff --git a/tests/test_mypy_plugin.py b/tests/test_mypy_plugin.py index 049f53d..d89e7f1 100644 --- a/tests/test_mypy_plugin.py +++ b/tests/test_mypy_plugin.py @@ -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.7.0", id="1.7.0 - first greater than 1.6.x with breaking changes"), + pytest.param("1.8.0", id="1.8.0 - first greater than 1.7.x with breaking changes"), ], ) def test_raises_for_unsupported_mypy_versions(version: str) -> None: @@ -125,6 +125,7 @@ def test_raises_for_unsupported_mypy_versions(version: str) -> None: pytest.param("1.4.0", id="1.4.0 - some 1.4.x version"), pytest.param("1.5.0", id="1.5.0 - some 1.5.x version"), 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"), ], ) def test_initializes_for_supported_mypy_versions(version: str) -> None: diff --git a/typing_protocol_intersection/mypy_plugin.py b/typing_protocol_intersection/mypy_plugin.py index ac6ecb0..5e48156 100644 --- a/typing_protocol_intersection/mypy_plugin.py +++ b/typing_protocol_intersection/mypy_plugin.py @@ -202,7 +202,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, 7, 0) + len(parted_version) == 3 and (1, 0, 0) <= parted_version < (1, 8, 0) ): return ProtocolIntersectionPlugin