Skip to content

Commit 9e8f35b

Browse files
committed
Drop support for running with Python 3.9
1 parent bf496e0 commit 9e8f35b

File tree

10 files changed

+51
-56
lines changed

10 files changed

+51
-56
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: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,29 +133,23 @@ Check `git diff` before committing!
133133

134134
### Python version options
135135

136-
**`--py37-plus`**
137-
Set the minimum Python syntax version to **3.7**. (Default: **3.9**)
138-
139-
**`--py38-plus`**
140-
Set the minimum Python syntax version to **3.8**. (Default: **3.9**)
141-
142136
**`--py39-plus`**
143-
Set the minimum Python syntax version to **3.9**. This is the default.
137+
Set the minimum Python syntax version to **3.9**. (Default: **3.10**)
144138

145139
**`--py310-plus`**
146-
Set the minimum Python syntax version to **3.10**. (Default: **3.9**)
140+
Set the minimum Python syntax version to **3.10**. This is the default.
147141

148142
**`--py311-plus`**
149-
Set the minimum Python syntax version to **3.11**. (Default: **3.9**)
143+
Set the minimum Python syntax version to **3.11**. (Default: **3.10**)
150144

151145
**`--py312-plus`**
152-
Set the minimum Python syntax version to **3.12**. (Default: **3.9**)
146+
Set the minimum Python syntax version to **3.12**. (Default: **3.10**)
153147

154148
**`--py313-plus`**
155-
Set the minimum Python syntax version to **3.13**. (Default: **3.9**)
149+
Set the minimum Python syntax version to **3.13**. (Default: **3.10**)
156150

157151
**`--py314-plus`**
158-
Set the minimum Python syntax version to **3.14**. (Default: **3.9**)
152+
Set the minimum Python syntax version to **3.14**. (Default: **3.10**)
159153

160154

161155
## License

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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,22 @@ async def async_main(argv: list[str] | None = None) -> int:
107107
group_py_version = py_version_options.add_mutually_exclusive_group()
108108
group_py_version.add_argument(
109109
'--py37-plus',
110-
action='store_const', dest='min_version', const=(3, 7), default=(3, 9),
110+
action='store_const', dest='min_version', const=(3, 7), default=(3, 10),
111+
help=argparse.SUPPRESS,
111112
)
112113
group_py_version.add_argument(
113114
'--py38-plus',
114115
action='store_const', dest='min_version', const=(3, 8),
116+
help=argparse.SUPPRESS,
115117
)
116118
group_py_version.add_argument(
117119
'--py39-plus',
118120
action='store_const', dest='min_version', const=(3, 9),
119-
help="Default"
120121
)
121122
group_py_version.add_argument(
122123
'--py310-plus',
123124
action='store_const', dest='min_version', const=(3, 10),
125+
help="Default"
124126
)
125127
group_py_version.add_argument(
126128
'--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/test_main.py

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def async_test_main(
6363
),
6464
pytest.param(
6565
'empty_line.py', 'empty_line_fixed.py',
66-
None, 0,
66+
['--py39-plus'], 0,
6767
id="typing_updated_empty_line",
6868
),
6969
pytest.param(
@@ -199,27 +199,27 @@ async def test_main_type_alias(
199199
),
200200
pytest.param(
201201
'comment_1.py', 'comment_1_forced.py',
202-
['--force'], 2,
202+
['--py39-plus', '--force'], 2,
203203
id="comment_1_forced",
204204
),
205205
pytest.param(
206206
'comment_2.py', 'comment_2_forced.py',
207-
['--force'], 2,
207+
['--py39-plus', '--force'], 2,
208208
id="comment_2_forced",
209209
),
210210
pytest.param(
211211
'comment_3.py', 'comment_3_forced.py',
212-
['--force'], 2,
212+
['--py39-plus', '--force'], 2,
213213
id="comment_3_forced",
214214
),
215215
pytest.param(
216216
'comment_4.py', 'comment_4_forced.py',
217-
['--force'], 2,
217+
['--py39-plus', '--force'], 2,
218218
id="comment_4_forced",
219219
),
220220
pytest.param(
221221
'comment_5.py', 'comment_5_forced.py',
222-
['--force'], 2,
222+
['--py39-plus', '--force'], 2,
223223
id="comment_5_forced",
224224
),
225225
),
@@ -239,32 +239,32 @@ async def test_main_comment(
239239
(
240240
pytest.param(
241241
'comment_no_issue_1.py', 'comment_no_issue_1_fixed.py',
242-
None, 0,
242+
['--py39-plus'], 0,
243243
id="comment_no_issue_1",
244244
),
245245
pytest.param(
246246
'comment_no_issue_2.py', 'comment_no_issue_2_fixed.py',
247-
None, 0,
247+
['--py39-plus'], 0,
248248
id="comment_no_issue_2",
249249
),
250250
pytest.param(
251251
'comment_no_issue_3.py', 'comment_no_issue_3_fixed.py',
252-
None, 0,
252+
['--py39-plus'], 0,
253253
id="comment_no_issue_3",
254254
),
255255
pytest.param(
256256
'comment_no_issue_4.py', 'comment_no_issue_4_fixed.py',
257-
None, 0,
257+
['--py39-plus'], 0,
258258
id="comment_no_issue_4",
259259
),
260260
pytest.param(
261261
'comment_no_issue_5.py', 'comment_no_issue_5_fixed.py',
262-
None, 0,
262+
['--py39-plus'], 0,
263263
id="comment_no_issue_5",
264264
),
265265
pytest.param(
266266
'comment_no_issue_6.py', 'comment_no_issue_6_fixed.py',
267-
None, 0,
267+
['--py39-plus'], 0,
268268
id="comment_no_issue_6",
269269
),
270270
),
@@ -283,22 +283,22 @@ async def test_main_comment_no_issue(
283283
(
284284
pytest.param(
285285
'comment_import_no_issue_1.py', 'comment_import_no_issue_1_fixed.py',
286-
None, 0,
286+
['--py39-plus'], 0,
287287
id="comment_import_no_issue_1",
288288
),
289289
pytest.param(
290290
'comment_import_no_issue_2.py', 'comment_import_no_issue_2_fixed.py',
291-
None, 0,
291+
['--py39-plus'], 0,
292292
id="comment_import_no_issue_2",
293293
),
294294
pytest.param(
295295
'comment_import_no_issue_3.py', 'comment_import_no_issue_3_fixed.py',
296-
None, 0,
296+
['--py39-plus'], 0,
297297
id="comment_import_no_issue_3",
298298
),
299299
pytest.param(
300300
'comment_import_no_issue_4.py', 'comment_import_no_issue_4_fixed.py',
301-
None, 0,
301+
['--py39-plus'], 0,
302302
id="comment_import_no_issue_4",
303303
),
304304
),
@@ -317,22 +317,22 @@ async def test_main_comment_import_no_issue(
317317
(
318318
pytest.param(
319319
'unused_import_1.py', 'unused_import_1_fixed.py',
320-
None, 0,
320+
['--py39-plus'], 0,
321321
id="unused_import_1_fixed",
322322
),
323323
pytest.param(
324324
'unused_import_2.py', 'unused_import_2_fixed.py',
325-
None, 0,
325+
['--py39-plus'], 0,
326326
id="unused_import_2_fixed",
327327
),
328328
pytest.param(
329329
'unused_import_3.py', 'unused_import_3_fixed.py',
330-
None, 0,
330+
['--py39-plus'], 0,
331331
id="unused_import_3_fixed",
332332
),
333333
pytest.param(
334334
'unused_import_4.py', 'unused_import_4_fixed.py',
335-
None, 0,
335+
['--py39-plus'], 0,
336336
id="unused_import_4_fixed",
337337
),
338338
pytest.param(
@@ -357,22 +357,22 @@ async def test_main_comment_import_no_issue(
357357
),
358358
pytest.param(
359359
'unused_import_5.py', 'unused_import_5_forced.py',
360-
['--force'], 2,
360+
['--py39-plus', '--force'], 2,
361361
id="unused_import_5_forced",
362362
),
363363
pytest.param(
364364
'unused_import_6.py', 'unused_import_6_forced.py',
365-
['--force'], 2,
365+
['--py39-plus', '--force'], 2,
366366
id="unused_import_6_forced",
367367
),
368368
pytest.param(
369369
'unused_import_7.py', 'unused_import_7_forced.py',
370-
['--force'], 2,
370+
['--py39-plus', '--force'], 2,
371371
id="unused_import_7_forced",
372372
),
373373
pytest.param(
374374
'unused_import_8.py', 'unused_import_8_forced.py',
375-
['--force'], 2,
375+
['--py39-plus', '--force'], 2,
376376
id="unused_import_8_forced",
377377
),
378378
),
@@ -392,22 +392,22 @@ async def test_main_unused_import(
392392
(
393393
pytest.param(
394394
'unused_import_comment_1.py', 'unused_import_comment_1_fixed.py',
395-
None, 0,
395+
['--py39-plus'], 0,
396396
id="unused_import_comment_1_fixed",
397397
),
398398
pytest.param(
399399
'unused_import_comment_2.py', 'unused_import_comment_2_fixed.py',
400-
None, 0,
400+
['--py39-plus'], 0,
401401
id="unused_import_comment_2_fixed",
402402
),
403403
pytest.param(
404404
'unused_import_comment_5.py', 'unused_import_comment_5_fixed.py',
405-
None, 0,
405+
['--py39-plus'], 0,
406406
id="unused_import_comment_5_fixed",
407407
),
408408
pytest.param(
409409
'unused_import_comment_6.py', 'unused_import_comment_6_fixed.py',
410-
None, 0,
410+
['--py39-plus'], 0,
411411
id="unused_import_comment_6_fixed",
412412
),
413413
pytest.param(
@@ -432,22 +432,22 @@ async def test_main_unused_import(
432432
),
433433
pytest.param(
434434
'unused_import_comment_3.py', 'unused_import_comment_3_forced.py',
435-
['--force'], 2,
435+
['--py39-plus', '--force'], 2,
436436
id="unused_import_comment_3_forced",
437437
),
438438
pytest.param(
439439
'unused_import_comment_4.py', 'unused_import_comment_4_forced.py',
440-
['--force'], 2,
440+
['--py39-plus', '--force'], 2,
441441
id="unused_import_comment_4_forced",
442442
),
443443
pytest.param(
444444
'unused_import_comment_7.py', 'unused_import_comment_7_forced.py',
445-
['--force'], 2,
445+
['--py39-plus', '--force'], 2,
446446
id="unused_import_comment_7_forced",
447447
),
448448
pytest.param(
449449
'unused_import_comment_8.py', 'unused_import_comment_8_forced.py',
450-
['--force'], 2,
450+
['--py39-plus', '--force'], 2,
451451
id="unused_import_comment_8_forced",
452452
),
453453
),

0 commit comments

Comments
 (0)