From 6ed3705f13393de690702e042eb98d94867cf69b Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 7 Jan 2026 12:30:02 +0000 Subject: [PATCH 1/3] Drop support for Python 3.9 --- .flake8 | 4 +--- .github/workflows/check.yml | 4 ++-- CHANGELOG.md | 4 ++++ pyproject.toml | 5 ++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.flake8 b/.flake8 index aa447ff..26beb5f 100644 --- a/.flake8 +++ b/.flake8 @@ -18,8 +18,6 @@ # E704 multiple statements on one line (def) -- disallows function body on the same line as the def # # flake8-bugbear rules that cause too many false positives: -# B905 "`zip()` without an explicit `strict=True` parameter -- -# the `strict` parameter was introduced in Python 3.10; we support Python 3.9 # B907 "Use !r inside f-strings instead of manual quotes" -- # produces false positives if you're surrounding things with double quotes @@ -29,5 +27,5 @@ max-line-length = 80 max-complexity = 12 noqa-require-code = true per-file-ignores = - *.py: B905, B907, B950, E203, E501, W503, W291, W293 + *.py: B907, B950, E203, E501, W503, W291, W293 *.pyi: B, E301, E302, E305, E501, E701, E704, F821, W503 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 94c8c56..7e3f5c1 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -29,7 +29,7 @@ jobs: timeout-minutes: 5 strategy: matrix: - python-version: ["3.9", "3.14"] + python-version: ["3.10", "3.14"] 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.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] fail-fast: false steps: - uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index af8d8b0..0303ad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ flake8-pyi uses Calendar Versioning (CalVer). * Y068: Don't use `@override` in stub files +### Other changes + +* Drop support for Python 3.9 + ## 25.5.0 ### New Error Codes diff --git a/pyproject.toml b/pyproject.toml index 343ed9e..350cf3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ maintainers = [ description = "A plugin for flake8 to enable linting .pyi stub files." license = "MIT" readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "flake8", "pyi", @@ -37,7 +37,6 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -86,7 +85,7 @@ skip = ["tests/imports.pyi", "tests/pep604_union_types.pyi"] skip_gitignore = true [tool.black] -target-version = ['py39'] +target-version = ['py310'] skip-magic-trailing-comma = true force-exclude = ".*\\.pyi" From ddd340af339a110792c3d0fc160d1b6098716e2c Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 7 Jan 2026 12:33:50 +0000 Subject: [PATCH 2/3] Fix flake8 and upgrade CI to use 3.14 by default rather than 3.13 --- .github/workflows/check.yml | 4 ++-- .github/workflows/typeshed_primer.yml | 2 +- flake8_pyi/visitor.py | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7e3f5c1..41096a0 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v6 - run: | - uv run --python=3.13 --group=dev mypy --python-version=${{ matrix.python-version }} + uv run --python=3.14 --group=dev mypy --python-version=${{ matrix.python-version }} flake8: name: flake8 @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v6 - run: | - uv run --python=3.13 --group=dev flake8 $(git ls-files | grep 'py$') --color=always + uv run --python=3.14 --group=dev flake8 $(git ls-files | grep 'py$') --color=always tests: name: pytest suite diff --git a/.github/workflows/typeshed_primer.yml b/.github/workflows/typeshed_primer.yml index be56599..5e6e0df 100644 --- a/.github/workflows/typeshed_primer.yml +++ b/.github/workflows/typeshed_primer.yml @@ -39,7 +39,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: "3.14" - name: Install uv run: curl -LsSf https://astral.sh/uv/install.sh | sh - run: uv pip install flake8-noqa --system diff --git a/flake8_pyi/visitor.py b/flake8_pyi/visitor.py index 4bb1cb6..35d6329 100644 --- a/flake8_pyi/visitor.py +++ b/flake8_pyi/visitor.py @@ -2114,8 +2114,7 @@ def visit_arg(self, node: ast.arg) -> None: def visit_arguments(self, node: ast.arguments) -> None: args = node.posonlyargs + node.args defaults = [None] * (len(args) - len(node.defaults)) + node.defaults - assert len(args) == len(defaults) - for arg, default in zip(args, defaults): + for arg, default in zip(args, defaults, strict=True): self.check_arg_default(arg, default) if node.vararg is not None: self.visit(node.vararg) From f19cbf452f5dc6133589e2fc3e2996aa79e529ee Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 7 Jan 2026 12:36:01 +0000 Subject: [PATCH 3/3] update black and isort to the latest version --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08cd7cd..cab692d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,11 +12,11 @@ repos: - id: name-tests-test args: [--pytest-test-first] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.11.0 # must match pyproject.toml + rev: 25.12.0 # must match pyproject.toml hooks: - id: black - repo: https://github.com/pycqa/isort - rev: 6.1.0 # must match pyproject.toml + rev: 7.0.0 # must match pyproject.toml hooks: - id: isort name: isort (python) diff --git a/pyproject.toml b/pyproject.toml index 350cf3f..7b85612 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,10 +52,10 @@ dependencies = [ [dependency-groups] dev = [ - "black==25.11.0", # Must match .pre-commit-config.yaml + "black==25.12.0", # Must match .pre-commit-config.yaml "flake8-bugbear==24.12.12", "flake8-noqa==1.4.0", - "isort==6.1.0", # Must match .pre-commit-config.yaml + "isort==7.0.0", # Must match .pre-commit-config.yaml "mypy==1.15.0", "pre-commit-hooks==5.0.0", # Must match .pre-commit-config.yaml "pytest==8.3.5",