From 0b91db909186b3762f6ee68ef3115bdb6b56573b Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Wed, 15 Oct 2025 14:02:21 -0400 Subject: [PATCH] py310+ --- .github/workflows/main.yml | 12 ++++++------ .pre-commit-config.yaml | 10 +++++----- pycodestyle.py | 19 +------------------ setup.cfg | 2 +- tests/test_api.py | 7 +------ 5 files changed, 14 insertions(+), 36 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c53a94f7..75fc886a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,14 +11,11 @@ jobs: matrix: include: - os: windows-latest - py: 3.9 + py: '3.10' toxenv: py - os: ubuntu-latest py: pypy3.10 toxenv: py - - os: ubuntu-latest - py: 3.9 - toxenv: py - os: ubuntu-latest py: '3.10' toxenv: py @@ -32,10 +29,13 @@ jobs: py: '3.13' toxenv: py - os: ubuntu-latest - py: '3.14-dev' + py: '3.14' toxenv: py - os: ubuntu-latest - py: 3.9 + py: '3.15-dev' + toxenv: py + - os: ubuntu-latest + py: '3.10' toxenv: flake8 runs-on: ${{ matrix.os }} steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 66058378..1c698753 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,17 +8,17 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/asottile/reorder-python-imports - rev: v3.15.0 + rev: v3.16.0 hooks: - id: reorder-python-imports - args: [--py39-plus] + args: [--py310-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.20.0 + rev: v3.21.0 hooks: - id: pyupgrade - args: [--py39-plus] + args: [--py310-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.8.0 + rev: v3.1.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/pycqa/flake8 diff --git a/pycodestyle.py b/pycodestyle.py index b3bf4ffc..868e79d5 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -59,15 +59,9 @@ import warnings from fnmatch import fnmatch from functools import lru_cache +from itertools import pairwise from optparse import OptionParser -# this is a performance hack. see https://bugs.python.org/issue43014 -if ( - sys.version_info < (3, 10) and - callable(getattr(tokenize, '_compile', None)) -): # pragma: no cover (=3.9 +python_requires = >=3.10 include_package_data = True zip_safe = False diff --git a/tests/test_api.py b/tests/test_api.py index 32f6ad2a..50cb1b83 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -352,12 +352,7 @@ def test_styleguide_unmatched_triple_quotes(self): pep8style.input_file('stdin', lines=lines) stdout = sys.stdout.getvalue() - if sys.version_info < (3, 10): # pragma: <3.10 cover - expected = [ - 'stdin:2:5: E901 TokenError: EOF in multi-line string', - 'stdin:2:26: E901 SyntaxError: EOF while scanning triple-quoted string literal', # noqa: E501 - ] - elif sys.version_info < (3, 12): # pragma: >=3.10 cover # pragma: <3.12 cover # noqa: E501 + if sys.version_info < (3, 12): # pragma: <3.12 cover # noqa: E501 expected = [ 'stdin:2:5: E901 TokenError: EOF in multi-line string', 'stdin:2:6: E901 SyntaxError: unterminated triple-quoted string literal (detected at line 2)', # noqa: E501