From 81d318e7e6c55d171bba4010a765299b593f4703 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Thu, 8 Oct 2026 15:32:15 -0400 Subject: [PATCH] py311+ --- .github/workflows/main.yml | 4 ++-- README.rst | 2 +- pyflakes/test/test_api.py | 12 ++++-------- pyflakes/test/test_other.py | 3 +-- pyflakes/test/test_type_annotations.py | 3 +-- setup.py | 2 +- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 635a0498..5619c5ae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,11 +11,11 @@ jobs: uses: asottile/workflows/.github/workflows/tox.yml@v1.11.1 with: # Include pypy3 + minimum py3 + maximum py3 on Windows - env: '["pypy3", "py310", "py314"]' + env: '["pypy3", "py311", "py314"]' os: windows-latest main-linux: uses: asottile/workflows/.github/workflows/tox.yml@v1.11.1 with: - env: '["pypy3", "py310", "py311", "py312", "py313", "py314", "py315"]' + env: '["pypy3", "py311", "py312", "py313", "py314", "py315"]' os: ubuntu-latest diff --git a/README.rst b/README.rst index e729329e..3e0ba211 100644 --- a/README.rst +++ b/README.rst @@ -25,7 +25,7 @@ Useful tips: * Be sure to install it for a version of Python which is compatible with your codebase: ``python#.# -m pip install pyflakes`` (for example, - ``python3.10 -m pip install pyflakes``) + ``python3.15 -m pip install pyflakes``) * You can also invoke Pyflakes with ``python#.# -m pyflakes .`` if you want to run it for a specific python version. diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py index 92a7240e..a01446d5 100644 --- a/pyflakes/test/test_api.py +++ b/pyflakes/test/test_api.py @@ -400,11 +400,11 @@ def baz(): with self.makeTempFile(source) as sourcePath: self.assertHasErrors( sourcePath, - ["""\ -%s:8:12: unterminated triple-quoted string literal (detected at line 8) + [f"""\ +{sourcePath}:8:12: unterminated triple-quoted string literal (detected at line 8) '''quux''' ^ -""" % (sourcePath,)]) +"""]) def test_eofSyntaxError(self): """ @@ -579,11 +579,7 @@ def test_misencodedFileUTF16(self): x = "%s" """ % SNOWMAN).encode('utf-16') with self.makeTempFile(source) as sourcePath: - if sys.version_info < (3, 11, 4): # pragma: <3.11 cover - expected = f"{sourcePath}: problem decoding source\n" - else: # pragma: >=3.11 cover - expected = f"{sourcePath}:1: source code string cannot contain null bytes\n" # noqa: E501 - + expected = f"{sourcePath}:1: source code string cannot contain null bytes\n" # noqa: E501 self.assertHasErrors(sourcePath, [expected]) def test_checkRecursive(self): diff --git a/pyflakes/test/test_other.py b/pyflakes/test/test_other.py index 7e62354d..aea7245c 100644 --- a/pyflakes/test/test_other.py +++ b/pyflakes/test/test_other.py @@ -1668,8 +1668,7 @@ def test_exceptionUnusedInExcept(self): except Exception as e: pass ''', m.UnusedVariable) - @skipIf(version_info < (3, 11), 'new in Python 3.11') - def test_exception_unused_in_except_star(self): # pragma: >=3.11 cover + def test_exception_unused_in_except_star(self): self.flakes(''' try: pass diff --git a/pyflakes/test/test_type_annotations.py b/pyflakes/test/test_type_annotations.py index 093144fd..50cebd8e 100644 --- a/pyflakes/test/test_type_annotations.py +++ b/pyflakes/test/test_type_annotations.py @@ -830,8 +830,7 @@ def test_namedtuple_non_list_args(self): NamedTuple("NT", y) """) - @skipIf(version_info < (3, 11), 'new in Python 3.11') - def test_variadic_generics(self): # pragma: >=3.11 cover + def test_variadic_generics(self): self.flakes(""" from typing import Generic from typing import TypeVarTuple diff --git a/setup.py b/setup.py index e0561ff4..57a55926 100755 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ def get_long_description(): author_email="code-quality@python.org", url="https://github.com/PyCQA/pyflakes", packages=["pyflakes", "pyflakes.scripts", "pyflakes.test"], - python_requires='>=3.10', + python_requires='>=3.11', classifiers=[ "Development Status :: 6 - Mature", "Environment :: Console",