Skip to content

Commit fa75f22

Browse files
authored
⬆️ Drop Python 3.9 (#1468)
Python 3.9 reaches its end of life on [2025-10](https://devguide.python.org/versions/).
1 parent 6ec1f9c commit fa75f22

File tree

20 files changed

+66
-58
lines changed

20 files changed

+66
-58
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Python
1414
uses: actions/setup-python@v5
1515
with:
16-
python-version: '3.9'
16+
python-version: '3.10'
1717
- uses: pre-commit/[email protected]
1818

1919
tests-core:
@@ -23,12 +23,12 @@ jobs:
2323
fail-fast: false # Set on "false" to get the results of ALL builds
2424
matrix:
2525
os: ["ubuntu-latest"]
26-
python-version: ["3.9", "3.12", "3.13"]
26+
python-version: ["3.10", "3.12", "3.13"]
2727
sphinx-version: ["7.4", "8.2"]
2828
include:
2929
# corner cases for Windows
3030
- os: "windows-latest"
31-
python-version: "3.9"
31+
python-version: "3.10"
3232
sphinx-version: "7.4"
3333
- os: "windows-latest"
3434
python-version: "3.12"
@@ -39,7 +39,7 @@ jobs:
3939
exclude:
4040
# Sphinx 8.2 only supports py3.11+
4141
- os: "ubuntu-latest"
42-
python-version: "3.9"
42+
python-version: "3.10"
4343
sphinx-version: "8.2"
4444

4545
steps:
@@ -81,7 +81,7 @@ jobs:
8181
matrix:
8282
include:
8383
- os: "ubuntu-latest"
84-
python-version: "3.9"
84+
python-version: "3.10"
8585
sphinx-version: "7.4"
8686
- os: "ubuntu-latest"
8787
python-version: "3.13"

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Or use tox (recommended):
8585

8686
.. code-block:: bash
8787
88-
tox -e py39
88+
tox -e py310
8989
9090
Note some tests use `syrupy <https://github.com/tophat/syrupy>`__ to perform snapshot testing.
9191
These snapshots can be updated by running:

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ classifiers = [
1717
'Operating System :: OS Independent',
1818
'Programming Language :: Python',
1919
'Programming Language :: Python :: 3',
20-
'Programming Language :: Python :: 3.9',
2120
'Programming Language :: Python :: 3.10',
2221
'Programming Language :: Python :: 3.11',
2322
'Programming Language :: Python :: 3.12',
@@ -26,7 +25,7 @@ classifiers = [
2625
'Topic :: Utilities',
2726
'Framework :: Sphinx :: Extension',
2827
]
29-
requires-python = ">=3.9,<4"
28+
requires-python = ">=3.10,<4"
3029
dependencies = [
3130
"sphinx>=7.4,<9",
3231
"requests-file~=2.1", # external links
@@ -145,19 +144,19 @@ disable_error_code = ["no-redef"]
145144

146145
legacy_tox_ini = """
147146
[tox]
148-
envlist = py39
147+
envlist = py10
149148
150149
[testenv]
151150
usedevelop = true
152151
153-
[testenv:py{39,310,311,312,313}]
152+
[testenv:py{310,311,312,313}]
154153
extras =
155154
test
156155
test-parallel
157156
commands =
158157
pytest --ignore tests/benchmarks {posargs:tests}
159158
160-
[testenv:py{39,310,311,312,313}-benchmark]
159+
[testenv:py{310,311,312,313}-benchmark]
161160
extras =
162161
test
163162
benchmark

sphinx_needs/api/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from __future__ import annotations
88

9-
from typing import Callable
9+
from collections.abc import Callable
1010

1111
from sphinx.application import Sphinx
1212
from sphinx.util.logging import SphinxLoggerAdapter

sphinx_needs/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

3-
from collections.abc import Mapping
3+
from collections.abc import Callable, Mapping
44
from dataclasses import MISSING, dataclass, field, fields
5-
from typing import TYPE_CHECKING, Any, Callable, Literal, TypedDict
5+
from typing import TYPE_CHECKING, Any, Literal, TypedDict
66

77
from docutils.parsers.rst import directives
88
from sphinx.application import Sphinx

sphinx_needs/debug.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
import inspect
99
import json
1010
import os.path
11+
from collections.abc import Callable
1112
from datetime import datetime
1213
from functools import wraps
1314
from pathlib import Path
1415
from timeit import default_timer as timer # Used for timing measurements
15-
from typing import Any, Callable, TypeVar
16+
from typing import Any, TypeVar
1617

1718
from jinja2 import Environment, PackageLoader, select_autoescape
1819
from sphinx.application import Sphinx

sphinx_needs/directives/need.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

33
import re
4-
from collections.abc import Sequence
5-
from typing import Any, Callable
4+
from collections.abc import Callable, Sequence
5+
from typing import Any
66

77
from docutils import nodes
88
from sphinx.addnodes import desc_name, desc_signature

sphinx_needs/directives/needbar.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ def process_needbar(
390390

391391
if current_needbar["stacked"]:
392392
# handle stacked bar
393-
y_offset = [i + j for i, j in zip(y_offset, local_data_number[x])]
393+
y_offset = [
394+
i + j for i, j in zip(y_offset, local_data_number[x], strict=False)
395+
]
394396

395397
if current_needbar["show_sum"]:
396398
try:
@@ -427,7 +429,8 @@ def process_needbar(
427429
matplotlib.pyplot.setp(bar_labels, rotation=int(sum_rotation))
428430

429431
centers = [
430-
(i + j) / 2.0 for i, j in zip(index[0], index[len(local_data_number) - 1])
432+
(i + j) / 2.0
433+
for i, j in zip(index[0], index[len(local_data_number) - 1], strict=False)
431434
]
432435
if not current_needbar["horizontal"]:
433436
# We want to support even older version of matplotlib, which do not support axes.set_xticks(labels)

sphinx_needs/directives/needextend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3-
from collections.abc import Sequence
4-
from typing import Any, Callable
3+
from collections.abc import Callable, Sequence
4+
from typing import Any
55

66
from docutils import nodes
77
from docutils.parsers.rst import directives

sphinx_needs/directives/needflow/_graphviz.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import html
44
import textwrap
5+
from collections.abc import Callable
56
from functools import cache
6-
from typing import Callable, Literal, TypedDict
7+
from typing import Literal, TypedDict
78
from urllib.parse import urlparse
89

910
from docutils import nodes

0 commit comments

Comments
 (0)