From 474cfe676de549d65fe04834eed6427b4fb8a7d5 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 11 May 2026 16:07:39 +0200 Subject: [PATCH 1/3] Add Python 3.15 checks to CI --- .github/workflows/check.yml | 4 ++-- CHANGELOG.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 41096a0..29f414e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -29,7 +29,7 @@ jobs: timeout-minutes: 5 strategy: matrix: - python-version: ["3.10", "3.14"] + python-version: ["3.10", "3.15"] fail-fast: false steps: - uses: actions/checkout@v4 @@ -54,7 +54,7 @@ jobs: strategy: matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] fail-fast: false steps: - uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index e48e564..be10c05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ flake8-pyi uses Calendar Versioning (CalVer). ### Other changes +* Support Python 3.15. * Drop support for Python 3.9 ## 25.5.0 From 84ee0cd6c5321cb22436a9d63098ecf402f4553b Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 11 May 2026 17:10:09 +0200 Subject: [PATCH 2/3] Try to fix doctest errors --- flake8_pyi/visitor.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flake8_pyi/visitor.py b/flake8_pyi/visitor.py index 5e1fca7..4bb8d53 100644 --- a/flake8_pyi/visitor.py +++ b/flake8_pyi/visitor.py @@ -325,10 +325,10 @@ def _analyse_exit_method_arg(node: ast.BinOp) -> ExitArgAnalysis: >>> _analyse_exit_method_arg(_ast_node_for('int | str')) ExitArgAnalysis(is_union_with_None=False, non_None_part=None) - >>> _analyse_exit_method_arg(_ast_node_for('int | None')) - ExitArgAnalysis(is_union_with_None=True, non_None_part=Name(id='int', ctx=Load())) - >>> _analyse_exit_method_arg(_ast_node_for('None | str')) - ExitArgAnalysis(is_union_with_None=True, non_None_part=Name(id='str', ctx=Load())) + >>> _analyse_exit_method_arg(_ast_node_for('int | None')) # doctest: +ELLIPSIS + ExitArgAnalysis(is_union_with_None=True, non_None_part=Name(id='int'...)) + >>> _analyse_exit_method_arg(_ast_node_for('None | str')) # doctest: +ELLIPSIS + ExitArgAnalysis(is_union_with_None=True, non_None_part=Name(id='str'...)) """ assert isinstance(node.op, ast.BitOr) if _is_None(node.left): @@ -479,7 +479,8 @@ def _analyse_union(members: Sequence[ast.expr]) -> UnionAnalysis: >>> source = 'Union[int, memoryview, memoryview, Literal["foo"], Literal[1], type[float], type[str]]' >>> union = _ast_node_for(source) >>> analysis = _analyse_union(union.slice.elts) - >>> len(analysis.members_by_dump["Name(id='memoryview', ctx=Load())"]) + >>> dump = "Name(id='memoryview')" if sys.version_info >= (3, 15) else "Name(id='memoryview', ctx=Load())" + >>> len(analysis.members_by_dump[dump]) 2 >>> analysis.dupes_in_union True From c73db3b0fc798e65b154f427347102ab171c0499 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 11 May 2026 17:16:48 +0200 Subject: [PATCH 3/3] Fix CHANGELOG --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11e0c4c..321e982 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ flake8-pyi uses Calendar Versioning (CalVer). ## Unreleased +### Other changes + +* Support Python 3.15. + ## 26.5.0 ### Breaking Changes @@ -20,7 +24,6 @@ flake8-pyi uses Calendar Versioning (CalVer). ### Other changes -* Support Python 3.15. * Drop support for Python 3.9 ## 25.5.0