Skip to content

Commit 588526b

Browse files
authored
Drop support for running with Python 3.9 and old --pyXX-plus arguments (#702)
1 parent bf496e0 commit 588526b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+37
-180
lines changed

.github/workflows/cache_ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1818
ARTIFACT_NAME: cleanup_cache
1919
ALL_VENV_PREFIXES: venv, venv-base, pre-commit
20-
ALL_PYTHON_VERSIONS: 3.9, 3.10, 3.11, 3.12, 3.13, 3.14
20+
ALL_PYTHON_VERSIONS: 3.10, 3.11, 3.12, 3.13, 3.14
2121
steps:
2222
- name: Download workflow artifact
2323
id: download-artifact

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
env:
1111
CACHE_VERSION: 1
12-
DEFAULT_PYTHON: "3.9"
12+
DEFAULT_PYTHON: "3.10"
1313
LIB_FOLDER: python_typing_update
1414
PRE_COMMIT_CACHE: ~/.cache/pre-commit
1515

@@ -149,7 +149,7 @@ jobs:
149149
runs-on: *runs-on-ubuntu
150150
strategy:
151151
matrix:
152-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
152+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
153153
outputs:
154154
python-key: ${{ steps.generate-python-key.outputs.key }}
155155
steps:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ repos:
33
rev: v3.20.0
44
hooks:
55
- id: pyupgrade
6-
args: [--py39-plus]
6+
args: [--py310-plus]
77
exclude: &fixtures ^tests/fixtures/.+\.py$
88
- repo: https://github.com/pycqa/flake8
99
rev: 7.3.0

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Marc Mueller
3+
Copyright (c) 2025 Marc Mueller
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 5 additions & 14 deletions

pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ignore=
33
load-plugins =
44
pylint.extensions.typing,
55
pylint.extensions.code_style,
6-
py-version = 3.9
6+
py-version = 3.10
77

88
[BASIC]
99
good-names =

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ keywords = ["typing", "pep585", "pep604"]
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
1616
"Intended Audience :: Developers",
17-
"Programming Language :: Python :: 3.9",
1817
"Programming Language :: Python :: 3.10",
1918
"Programming Language :: Python :: 3.11",
2019
"Programming Language :: Python :: 3.12",
2120
"Programming Language :: Python :: 3.13",
2221
"Programming Language :: Python :: 3.14",
2322
"Topic :: Software Development",
2423
]
25-
requires-python = ">=3.9"
24+
requires-python = ">=3.10"
2625
dependencies = [
2726
"aiofiles==25.1.0",
2827
"autoflake==2.3.1",
@@ -71,7 +70,7 @@ asyncio_default_fixture_loop_scope = "function"
7170

7271
[tool.mypy]
7372
# https://mypy.readthedocs.io/en/stable/config_file.html
74-
python_version = "3.9"
73+
python_version = "3.10"
7574
show_error_codes = true
7675
ignore_missing_imports = true
7776
strict = true

python_typing_update/__main__.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,10 @@ async def async_main(argv: list[str] | None = None) -> int:
105105
)
106106

107107
group_py_version = py_version_options.add_mutually_exclusive_group()
108-
group_py_version.add_argument(
109-
'--py37-plus',
110-
action='store_const', dest='min_version', const=(3, 7), default=(3, 9),
111-
)
112-
group_py_version.add_argument(
113-
'--py38-plus',
114-
action='store_const', dest='min_version', const=(3, 8),
115-
)
116-
group_py_version.add_argument(
117-
'--py39-plus',
118-
action='store_const', dest='min_version', const=(3, 9),
119-
help="Default"
120-
)
121108
group_py_version.add_argument(
122109
'--py310-plus',
123-
action='store_const', dest='min_version', const=(3, 10),
110+
action='store_const', dest='min_version', const=(3, 10), default=(3, 10),
111+
help="Default"
124112
)
125113
group_py_version.add_argument(
126114
'--py311-plus',

python_typing_update/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def typing_update(
4545
version_string = f"--py{''.join(map(str, args.min_version))}-plus"
4646

4747
# Add, replace and reorder imports
48-
reorder_args: list[str | None] = []
48+
reorder_args: list[str] = []
4949
if args.min_version < (3, 10):
5050
reorder_args += ['--add-import', 'from __future__ import annotations']
5151
if args.full_reorder:

tests/fixtures/changed_fixed.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""Update typing syntax for Python 3.8+"""
2-
from __future__ import annotations
2+
from collections.abc import Container, Hashable
3+
from typing import Any, TypeGuard
34

4-
from typing import Any, Container, Hashable
5-
6-
from typing_extensions import TypedDict, TypeGuard
5+
from typing_extensions import TypedDict
76

87
var1: list[str]
98
var2: Any

0 commit comments

Comments
 (0)