Skip to content

Commit

Permalink
Add support for mypy==1.14.x (#15)
Browse files Browse the repository at this point in the history
This commit was generated with ./tools/prepare-pr-after-mypy-bump.sh
  • Loading branch information
klausweiss authored Dec 22, 2024
1 parent a336c94 commit 55cb03b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.5.2

Add support for mypy==1.14.x.

## 0.5.1

Add support for mypy==1.13.x.
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.9 up to 3.13 and mypy >= 0.920 and <= 1.13.x.
The plugin supports python 3.9 up to 3.13 and mypy >= 0.920 and <= 1.14.x.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = typing-protocol-intersection
version = 0.5.1
version = 0.5.2
description = Protocol intersection for mypy
long_description = file: README.md
long_description_content_type = text/markdown
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.14.0", id="1.14.0 - first greater than 1.13.x with breaking changes"),
pytest.param("1.15.0", id="1.15.0 - first greater than 1.14.x with breaking changes"),
],
)
def test_raises_for_unsupported_mypy_versions(version: str) -> None:
Expand Down Expand Up @@ -133,6 +133,7 @@ def test_raises_for_unsupported_mypy_versions(version: str) -> None:
pytest.param("1.11.0", id="1.11.0 - some 1.11.x version"),
pytest.param("1.12.0", id="1.12.0 - some 1.12.x version"),
pytest.param("1.13.0", id="1.13.0 - some 1.13.x version"),
pytest.param("1.14.0", id="1.14.0 - some 1.14.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, 14, 0)
len(parted_version) == 3 and (1, 0, 0) <= parted_version < (1, 15, 0)
):
return ProtocolIntersectionPlugin

Expand Down

0 comments on commit 55cb03b

Please sign in to comment.