Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@v6
Expand All @@ -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@v6
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ flake8-pyi uses Calendar Versioning (CalVer).

## Unreleased

### Other changes

* Support Python 3.15.

## 26.5.0

### Breaking Changes
Expand Down
11 changes: 6 additions & 5 deletions flake8_pyi/visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
Loading