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..41096a0 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -29,13 +29,13 @@ 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 - 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 @@ -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/.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/.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/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/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) diff --git a/pyproject.toml b/pyproject.toml index 343ed9e..7b85612 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", @@ -53,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", @@ -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"