Skip to content

Commit 0e6a608

Browse files
authored
Merge pull request #4979 from neutrinoceros/dep/drop_cp39
DEP: drop support for Python 3.9
2 parents 2e65cb9 + 00cf11a commit 0e6a608

File tree

109 files changed

+313
-579
lines changed

Some content is hidden

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

109 files changed

+313
-579
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ ec8bb45ea1603f3862041fa9e8ec274afd9bbbfd
5050

5151
# migration: black -> ruff-format
5252
3214662dc7d53f7ac56b3589c5a27ef075f83ab4
53+
54+
# auto upgrade syntax from Python 3.9 to 3.10
55+
e86625e780b77a42aedad711e5a9a945ce650974

.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
@@ -33,7 +33,7 @@ jobs:
3333
# run with oldest supported python version
3434
# so that we always get compatible versions of
3535
# core dependencies at type-check time
36-
python-version: '3.9'
36+
python-version: '3.10'
3737

3838
- name: Build
3939
run: |

.github/workflows/wheels.yaml

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

5757
- name: Build sdist
5858
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

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,5 @@ recursive-include yt/frontends/amrvac *.par
7373
recursive-exclude requirements *.txt
7474
exclude minimal_requirements.txt
7575
exclude .codecov.yml .coveragerc .git-blame-ignore-revs .gitmodules .hgchurn .mailmap
76-
exclude .pre-commit-config.yaml clean.sh nose_answer.cfg nose_unit.cfg nose_ignores.txt
76+
exclude .pre-commit-config.yaml clean.sh
77+
exclude nose_answer.cfg nose_unit.cfg nose_ignores.txt nose_requirements.txt

doc/source/developing/testing.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ Answer Testing
162162
an `older version of this documentation <https://yt-project.org/docs/4.0.0/developing/testing.html#answer-testing>`_
163163
decribes how the ``nose`` tests work.
164164

165+
.. note::
166+
Given that nose never had support for Python 3.10 (which as of yt 4.4 is our
167+
oldest supported version), it is necessary to patch it to get tests running.
168+
This is the command we run on CI to this end
169+
``find .venv/lib/python3.10/site-packages/nose -name '*.py' -exec sed -i -e s/collections.Callable/collections.abc.Callable/g '{}' ';'``
170+
165171
What Do Answer Tests Do
166172
^^^^^^^^^^^^^^^^^^^^^^^
167173

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
+------------+------------+----------------+-----------------+

minimal_requirements.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was autogenerated by uv via the following command:
2-
# uv pip compile pyproject.toml --python=3.9 --python-platform=x86_64-unknown-linux-gnu --resolution=lowest-direct --no-build
2+
# uv pip compile pyproject.toml --python=3.10 --python-platform=x86_64-unknown-linux-gnu --resolution=lowest-direct --no-build
33
cmyt==1.1.2
44
# via yt (pyproject.toml)
55
colorspacious==1.1.2
@@ -22,7 +22,7 @@ more-itertools==8.4.0
2222
# cmyt
2323
mpmath==1.3.0
2424
# via sympy
25-
numpy==1.19.3
25+
numpy==1.21.3
2626
# via
2727
# yt (pyproject.toml)
2828
# cmyt
@@ -35,7 +35,7 @@ packaging==20.9
3535
# yt (pyproject.toml)
3636
# matplotlib
3737
# setuptools-scm
38-
pillow==8.0.0
38+
pillow==8.3.2
3939
# via
4040
# yt (pyproject.toml)
4141
# matplotlib
@@ -62,8 +62,6 @@ tomli-w==0.4.0
6262
tqdm==3.4.0
6363
# via yt (pyproject.toml)
6464
typing-extensions==4.4.0
65-
# via
66-
# yt (pyproject.toml)
67-
# setuptools-scm
65+
# via yt (pyproject.toml)
6866
unyt==2.9.2
6967
# via yt (pyproject.toml)

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

0 commit comments

Comments
 (0)