Skip to content

Commit 9d55ccd

Browse files
committed
py39+
1 parent e492aeb commit 9d55ccd

22 files changed

+64
-78
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ jobs:
1515
- os: ubuntu-latest
1616
python: pypy-3.9
1717
toxenv: py
18-
- os: ubuntu-latest
19-
python: 3.8
20-
toxenv: py
2118
- os: ubuntu-latest
2219
python: 3.9
2320
toxenv: py
@@ -28,11 +25,14 @@ jobs:
2825
python: '3.11'
2926
toxenv: py
3027
- os: ubuntu-latest
31-
python: '3.12-dev'
28+
python: '3.12'
29+
toxenv: py
30+
- os: ubuntu-latest
31+
python: '3.13'
3232
toxenv: py
3333
# windows
3434
- os: windows-latest
35-
python: 3.8
35+
python: 3.9
3636
toxenv: py
3737
# misc
3838
- os: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ repos:
1212
hooks:
1313
- id: setup-cfg-fmt
1414
- repo: https://github.com/asottile/reorder-python-imports
15-
rev: v3.12.0
15+
rev: v3.14.0
1616
hooks:
1717
- id: reorder-python-imports
1818
args: [
1919
--application-directories, '.:src',
20-
--py38-plus,
20+
--py39-plus,
2121
--add-import, 'from __future__ import annotations',
2222
]
2323
- repo: https://github.com/asottile/pyupgrade
24-
rev: v3.15.0
24+
rev: v3.19.1
2525
hooks:
2626
- id: pyupgrade
27-
args: [--py38-plus]
27+
args: [--py39-plus]
2828
- repo: https://github.com/psf/black
2929
rev: 23.12.1
3030
hooks:
@@ -35,7 +35,7 @@ repos:
3535
hooks:
3636
- id: flake8
3737
- repo: https://github.com/pre-commit/mirrors-mypy
38-
rev: v1.8.0
38+
rev: v1.15.0
3939
hooks:
4040
- id: mypy
4141
exclude: ^(docs/|example-plugin/)

bin/gen-pycodestyle-plugin

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ from __future__ import annotations
33

44
import inspect
55
import os.path
6+
from collections.abc import Generator
67
from typing import Any
78
from typing import Callable
8-
from typing import Generator
99
from typing import NamedTuple
1010

1111
import pycodestyle
@@ -42,7 +42,7 @@ class Call(NamedTuple):
4242
return cls(func.__name__, inspect.isgeneratorfunction(func), params)
4343

4444

45-
def lines() -> Generator[str, None, None]:
45+
def lines() -> Generator[str]:
4646
logical = []
4747
physical = []
4848

@@ -58,8 +58,8 @@ def lines() -> Generator[str, None, None]:
5858
yield "# fmt: off"
5959
yield "from __future__ import annotations"
6060
yield ""
61+
yield "from collections.abc import Generator"
6162
yield "from typing import Any"
62-
yield "from typing import Generator"
6363
yield ""
6464
imports = sorted(call.name for call in logical + physical)
6565
for name in imports:
@@ -71,7 +71,7 @@ def lines() -> Generator[str, None, None]:
7171
logical_params = {param for call in logical for param in call.params}
7272
for param in sorted(logical_params):
7373
yield f" {param}: Any,"
74-
yield ") -> Generator[tuple[int, str], None, None]:"
74+
yield ") -> Generator[tuple[int, str]]:"
7575
yield ' """Run pycodestyle logical checks."""'
7676
for call in sorted(logical):
7777
yield call.to_src()
@@ -82,7 +82,7 @@ def lines() -> Generator[str, None, None]:
8282
physical_params = {param for call in physical for param in call.params}
8383
for param in sorted(physical_params):
8484
yield f" {param}: Any,"
85-
yield ") -> Generator[tuple[int, str], None, None]:"
85+
yield ") -> Generator[tuple[int, str]]:"
8686
yield ' """Run pycodestyle physical checks."""'
8787
for call in sorted(physical):
8888
yield call.to_src()

docs/source/internal/releases.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ for users.
8181

8282
Before releasing, the following tox test environments must pass:
8383

84-
- Python 3.8 (a.k.a., ``tox -e py38``)
84+
- Python 3.9 (a.k.a., ``tox -e py39``)
8585

86-
- Python 3.12 (a.k.a., ``tox -e py312``)
86+
- Python 3.13 (a.k.a., ``tox -e py313``)
8787

8888
- PyPy 3 (a.k.a., ``tox -e pypy3``)
8989

docs/source/user/invocation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ like so:
1414

1515
Where you simply allow the shell running in your terminal to locate |Flake8|.
1616
In some cases, though, you may have installed |Flake8| for multiple versions
17-
of Python (e.g., Python 3.8 and Python 3.9) and you need to call a specific
17+
of Python (e.g., Python 3.13 and Python 3.14) and you need to call a specific
1818
version. In that case, you will have much better results using:
1919

2020
.. prompt:: bash
2121

22-
python3.8 -m flake8
22+
python3.13 -m flake8
2323

2424
Or
2525

2626
.. prompt:: bash
2727

28-
python3.9 -m flake8
28+
python3.14 -m flake8
2929

3030
Since that will tell the correct version of Python to run |Flake8|.
3131

3232
.. note::
3333

34-
Installing |Flake8| once will not install it on both Python 3.8 and
35-
Python 3.9. It will only install it for the version of Python that
34+
Installing |Flake8| once will not install it on both Python 3.13 and
35+
Python 3.14. It will only install it for the version of Python that
3636
is running pip.
3737

3838
It is also possible to specify command-line options directly to |Flake8|:

example-plugin/setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
"License :: OSI Approved :: MIT License",
2424
"Programming Language :: Python",
2525
"Programming Language :: Python :: 3",
26-
"Programming Language :: Python :: 3.8",
27-
"Programming Language :: Python :: 3.9",
2826
"Topic :: Software Development :: Libraries :: Python Modules",
2927
"Topic :: Software Development :: Quality Assurance",
3028
],

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ install_requires =
3131
mccabe>=0.7.0,<0.8.0
3232
pycodestyle>=2.12.0,<2.13.0
3333
pyflakes>=3.2.0,<3.3.0
34-
python_requires = >=3.8.1
34+
python_requires = >=3.9
3535
package_dir =
3636
=src
3737

src/flake8/checker.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
import operator
1010
import signal
1111
import tokenize
12+
from collections.abc import Generator
13+
from collections.abc import Sequence
1214
from typing import Any
13-
from typing import Generator
14-
from typing import List
1515
from typing import Optional
16-
from typing import Sequence
17-
from typing import Tuple
1816

1917
from flake8 import defaults
2018
from flake8 import exceptions
@@ -27,7 +25,7 @@
2725
from flake8.plugins.finder import LoadedPlugin
2826
from flake8.style_guide import StyleGuideManager
2927

30-
Results = List[Tuple[str, int, int, str, Optional[str]]]
28+
Results = list[tuple[str, int, int, str, Optional[str]]]
3129

3230
LOG = logging.getLogger(__name__)
3331

@@ -53,7 +51,7 @@
5351
@contextlib.contextmanager
5452
def _mp_prefork(
5553
plugins: Checkers, options: argparse.Namespace
56-
) -> Generator[None, None, None]:
54+
) -> Generator[None]:
5755
# we can save significant startup work w/ `fork` multiprocessing
5856
global _mp_plugins, _mp_options
5957
_mp_plugins, _mp_options = plugins, options

src/flake8/discover_files.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import logging
55
import os.path
6+
from collections.abc import Generator
7+
from collections.abc import Sequence
68
from typing import Callable
7-
from typing import Generator
8-
from typing import Sequence
99

1010
from flake8 import utils
1111

@@ -16,7 +16,7 @@ def _filenames_from(
1616
arg: str,
1717
*,
1818
predicate: Callable[[str], bool],
19-
) -> Generator[str, None, None]:
19+
) -> Generator[str]:
2020
"""Generate filenames from an argument.
2121
2222
:param arg:
@@ -55,7 +55,7 @@ def expand_paths(
5555
stdin_display_name: str,
5656
filename_patterns: Sequence[str],
5757
exclude: Sequence[str],
58-
) -> Generator[str, None, None]:
58+
) -> Generator[str]:
5959
"""Expand out ``paths`` from commandline to the lintable files."""
6060
if not paths:
6161
paths = ["."]

src/flake8/main/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import json
66
import logging
77
import time
8-
from typing import Sequence
8+
from collections.abc import Sequence
99

1010
import flake8
1111
from flake8 import checker

0 commit comments

Comments
 (0)