Skip to content

Commit b067988

Browse files
committed
DEP: drop support for CPython 3.9
1 parent f39ed50 commit b067988

File tree

9 files changed

+57
-36
lines changed

9 files changed

+57
-36
lines changed

.github/workflows/build-test.yaml

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,51 @@ jobs:
2222
# run all tests even if e.g. image tests fail early
2323
fail-fast: false
2424
matrix:
25-
os: [
26-
macos-latest,
27-
windows-latest,
28-
ubuntu-latest,
29-
]
25+
os:
26+
- ubuntu-latest
27+
- macos-latest
3028
python-version: ['3.12']
3129
dependencies: [full]
3230
tests-type: [unit]
3331
test-runner: [pytest]
32+
venv-loc: [bin]
3433
include:
34+
- os: windows-latest
35+
python-version: '3.12'
36+
dependencies: full
37+
tests-type: unit
38+
test-runner: pytest
39+
venv-loc: Scripts
3540
- os: ubuntu-20.04
36-
python-version: '3.9.2'
41+
python-version: '3.10.3'
3742
dependencies: minimal
3843
tests-type: unit
3944
test-runner: pytest
45+
venv-loc: bin
4046
- os: ubuntu-latest
4147
# this job is necessary for non-answer, 'yield' based tests
42-
# because pytest doesn't support such tests, and nose is not
43-
# compatible with Python 3.10
44-
python-version: '3.9'
48+
# because pytest doesn't support such tests
49+
python-version: '3.10'
4550
dependencies: full
4651
tests-type: unit
4752
test-runner: nose
53+
venv-loc: bin
4854
- os: ubuntu-latest
4955
# answer tests use 'yield', so they require nose
5056
# they are also attached to a specific, occasionally updated, Python version
5157
# but it does *not* have to match the current minimal supported version
52-
python-version: '3.9'
58+
python-version: '3.10'
5359
dependencies: full
5460
tests-type: answer
5561
test-runner: nose
62+
venv-loc: bin
5663
- os: ubuntu-latest
5764
# minimal tests with latest Python and no optional dependencies
5865
python-version: '3.x'
5966
dependencies: ''
6067
tests-type: unit
6168
test-runner: pytest
69+
venv-loc: bin
6270

6371
runs-on: ${{ matrix.os }}
6472

@@ -84,15 +92,34 @@ jobs:
8492
shell: bash
8593
env:
8694
dependencies: ${{ matrix.dependencies }}
87-
run: source ./tests/ci_install.sh
95+
run: |
96+
python -m venv .venv
97+
source .venv/${{matrix.venv-loc}}/activate
98+
source ./tests/ci_install.sh
99+
100+
- name: Install and patch nosetest
101+
if: matrix.test-runner == 'nose'
102+
run: |
103+
source .venv/${{matrix.venv-loc}}/activate
104+
python -m pip install -r nose_requirements.txt
105+
find .venv/lib/python${{matrix.python-version}}/site-packages/nose -name '*.py' \
106+
-exec sed -i -e s/collections.Callable/collections.abc.Callable/g '{}' ';'
107+
108+
- name: Show final env
109+
run: |
110+
source .venv/${{matrix.venv-loc}}/activate
111+
python -m pip list
88112
89-
- run: python -m pip list
90113
- name: Run Unit Tests (pytest)
91114
if: matrix.test-runner == 'pytest'
92-
run: pytest --color=yes
115+
run: |
116+
source .venv/${{matrix.venv-loc}}/activate
117+
pytest --color=yes
93118
- name: Run Tests (nose)
94119
if: matrix.test-runner == 'nose'
95-
run: cat nose_ignores.txt | xargs python -m nose -c nose_unit.cfg --traverse-namespace
120+
run: |
121+
source .venv/${{matrix.venv-loc}}/activate
122+
cat nose_ignores.txt | xargs python -m nose -c nose_unit.cfg --traverse-namespace
96123
97124
image-tests:
98125
name: Image tests

.github/workflows/type-checking.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# run with oldest supported python version
3333
# so that we always get compatible versions of
3434
# core dependencies at type-check time
35-
python-version: '3.9'
35+
python-version: '3.10'
3636

3737
- name: Build
3838
run: |

.github/workflows/wheels.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Set up Python
5252
uses: actions/setup-python@v5
5353
with:
54-
python-version: '3.9'
54+
python-version: '3.10'
5555

5656
- name: Build sdist
5757
run: pipx run build --sdist

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ repos:
4343
args: [
4444
--fix,
4545
--show-fixes,
46-
# the following line can be removed after support for Python 3.9 is dropped
47-
--extend-select=B905, # zip-without-explicit-strict
4846
]
4947

5048
- repo: https://github.com/pre-commit/pygrep-hooks

doc/source/installing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ Here's a summary for most recent releases
3232
+------------+------------+----------------+-----------------+
3333
| yt release | Python 2.7 | Python3 min | Python3 max |
3434
+============+============+================+=================+
35-
| 4.3.x | no | 3.9 | 3.12 (expected) |
35+
| 4.4.x | no | 3.10.3 | 3.13 (expected) |
36+
+------------+------------+----------------|-----------------|
37+
| 4.3.x | no | 3.9.2 | 3.12 |
3638
+------------+------------+----------------+-----------------+
3739
| 4.2.x | no | 3.8 | 3.11 |
3840
+------------+------------+----------------+-----------------+

nose_requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nose~=1.3.7
2+
nose-exclude
3+
nose-timer~=1.0.0

pyproject.toml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ classifiers = [
3030
"Programming Language :: C",
3131
"Programming Language :: Python :: 3",
3232
"Programming Language :: Python :: 3 :: Only",
33-
"Programming Language :: Python :: 3.9",
3433
"Programming Language :: Python :: 3.10",
3534
"Programming Language :: Python :: 3.11",
3635
"Programming Language :: Python :: 3.12",
@@ -41,17 +40,17 @@ classifiers = [
4140
keywords = [
4241
"astronomy astrophysics visualization amr adaptivemeshrefinement",
4342
]
44-
requires-python = ">=3.9.2"
43+
requires-python = ">=3.10.3"
4544
dependencies = [
4645
"cmyt>=1.1.2",
4746
"ewah-bool-utils>=1.2.0",
4847
"matplotlib>=3.5",
4948
"more-itertools>=8.4",
50-
"numpy>=1.19.3, <3", # keep minimal requirement in sync with NPY_TARGET_VERSION
49+
"numpy>=1.21.3, <3", # keep minimal requirement in sync with NPY_TARGET_VERSION
5150
# https://github.com/numpy/numpy/issues/27037
5251
"numpy!=2.0.1 ; platform_machine=='arm64' and platform_system=='Darwin'",
5352
"packaging>=20.9",
54-
"pillow>=8.0.0",
53+
"pillow>=8.3.2",
5554
"tomli-w>=0.4.0",
5655
"tqdm>=3.4.0",
5756
"unyt>=2.9.2",
@@ -212,9 +211,9 @@ minimal = [
212211
"ewah-bool-utils==1.2.0",
213212
"matplotlib==3.5",
214213
"more-itertools==8.4",
215-
"numpy==1.19.3",
214+
"numpy==1.21.3",
216215
"packaging==20.9",
217-
"pillow==8.0.0",
216+
"pillow==8.3.2",
218217
"tomli-w==0.4.0",
219218
"tqdm==3.4.0",
220219
"unyt==2.9.2",
@@ -226,9 +225,6 @@ test = [
226225
"pytest>=6.1",
227226
"pytest-mpl>=0.16.1",
228227
"sympy!=1.10,!=1.9", # see https://github.com/sympy/sympy/issues/22241
229-
"nose~=1.3.7; python_version < '3.10'",
230-
"nose-exclude; python_version < '3.10'",
231-
"nose-timer~=1.0.0; python_version < '3.10'",
232228
"imageio!=2.35.0", # see https://github.com/yt-project/yt/issues/4966
233229
]
234230
typecheck = [
@@ -486,7 +482,7 @@ ignore = [
486482

487483

488484
[tool.mypy]
489-
python_version = 3.9
485+
python_version = '3.10'
490486
show_error_codes = true
491487
ignore_missing_imports = true
492488
warn_unused_configs = true
@@ -496,7 +492,7 @@ show_error_context = true
496492
exclude = "(test_*|lodgeit)"
497493

498494
[tool.cibuildwheel]
499-
build = "cp39-* cp310-* cp311-* cp312-*"
495+
build = "cp310-* cp311-* cp312-*"
500496
build-verbosity = 1
501497
test-skip = "*-musllinux*"
502498
test-extras = "test"

setupext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def get_python_include_dirs():
397397
NUMPY_MACROS = [
398398
("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"),
399399
# keep in sync with runtime requirements (pyproject.toml)
400-
("NPY_TARGET_VERSION", "NPY_1_19_API_VERSION"),
400+
("NPY_TARGET_VERSION", "NPY_1_21_API_VERSION"),
401401
]
402402

403403

tests/ci_install.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ cp tests/matplotlibrc .
55

66
# Step 1: pre-install required packages
77
if [[ ${dependencies} == "full" || ${dependencies} == "cartopy" ]]; then
8-
# upgrading pip to guarantee installing extra dependencies with [full] is supported
9-
# this is only necessary for some versions of Python 3.8 and 3.9
10-
# see https://github.com/yt-project/yt/issues/4270
11-
python -m pip install 'pip>=21.2'
12-
138
case ${RUNNER_OS} in
149
linux|Linux)
1510
sudo apt-get -qqy update

0 commit comments

Comments
 (0)