Skip to content

Commit

Permalink
DEP: drop support for CPython 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Sep 3, 2024
1 parent f39ed50 commit 32d1f7b
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 37 deletions.
55 changes: 41 additions & 14 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,51 @@ jobs:
# run all tests even if e.g. image tests fail early
fail-fast: false
matrix:
os: [
macos-latest,
windows-latest,
ubuntu-latest,
]
os:
- ubuntu-latest
- macos-latest
python-version: ['3.12']
dependencies: [full]
tests-type: [unit]
test-runner: [pytest]
venv-loc: [bin]
include:
- os: windows-latest
python-version: '3.12'
dependencies: full
tests-type: unit
test-runner: pytest
venv-loc: Scripts
- os: ubuntu-20.04
python-version: '3.9.2'
python-version: '3.10.3'
dependencies: minimal
tests-type: unit
test-runner: pytest
venv-loc: bin
- os: ubuntu-latest
# this job is necessary for non-answer, 'yield' based tests
# because pytest doesn't support such tests, and nose is not
# compatible with Python 3.10
python-version: '3.9'
# because pytest doesn't support such tests
python-version: '3.10'
dependencies: full
tests-type: unit
test-runner: nose
venv-loc: bin
- os: ubuntu-latest
# answer tests use 'yield', so they require nose
# they are also attached to a specific, occasionally updated, Python version
# but it does *not* have to match the current minimal supported version
python-version: '3.9'
python-version: '3.10'
dependencies: full
tests-type: answer
test-runner: nose
venv-loc: bin
- os: ubuntu-latest
# minimal tests with latest Python and no optional dependencies
python-version: '3.x'
dependencies: ''
tests-type: unit
test-runner: pytest
venv-loc: bin

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

Expand All @@ -84,15 +92,34 @@ jobs:
shell: bash
env:
dependencies: ${{ matrix.dependencies }}
run: source ./tests/ci_install.sh
run: |
python -m venv .venv
source .venv/${{matrix.venv-loc}}/activate
source ./tests/ci_install.sh
- name: Install and patch nosetest
if: matrix.test-runner == 'nose'
run: |
source .venv/${{matrix.venv-loc}}/activate
python -m pip install -r nose_requirements.txt
find .venv/lib/python${{matrix.python-version}}/site-packages/nose -name '*.py' \
-exec sed -i -e s/collections.Callable/collections.abc.Callable/g '{}' ';'
- name: Show final env
run: |
source .venv/${{matrix.venv-loc}}/activate
python -m pip list
- run: python -m pip list
- name: Run Unit Tests (pytest)
if: matrix.test-runner == 'pytest'
run: pytest --color=yes
run: |
source .venv/${{matrix.venv-loc}}/activate
pytest --color=yes
- name: Run Tests (nose)
if: matrix.test-runner == 'nose'
run: cat nose_ignores.txt | xargs python -m nose -c nose_unit.cfg --traverse-namespace
run: |
source .venv/${{matrix.venv-loc}}/activate
cat nose_ignores.txt | xargs python -m nose -c nose_unit.cfg --traverse-namespace
image-tests:
name: Image tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/type-checking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# run with oldest supported python version
# so that we always get compatible versions of
# core dependencies at type-check time
python-version: '3.9'
python-version: '3.10'

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.10'

- name: Build sdist
run: pipx run build --sdist
Expand Down
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ repos:
args: [
--fix,
--show-fixes,
# the following line can be removed after support for Python 3.9 is dropped
--extend-select=B905, # zip-without-explicit-strict
]

- repo: https://github.com/pre-commit/pygrep-hooks
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ include yt/default.mplstyle
prune yt/frontends/_skeleton
recursive-include yt/frontends/amrvac *.par
exclude .codecov.yml .coveragerc .git-blame-ignore-revs .gitmodules .hgchurn .mailmap
exclude .pre-commit-config.yaml clean.sh nose_answer.cfg nose_unit.cfg nose_ignores.txt
exclude .pre-commit-config.yaml clean.sh
exclude nose_answer.cfg nose_unit.cfg nose_ignores.txt nose_requirements.txt
4 changes: 3 additions & 1 deletion doc/source/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ Here's a summary for most recent releases
+------------+------------+----------------+-----------------+
| yt release | Python 2.7 | Python3 min | Python3 max |
+============+============+================+=================+
| 4.3.x | no | 3.9 | 3.12 (expected) |
| 4.4.x | no | 3.10.3 | 3.13 (expected) |
+------------+------------+----------------|-----------------|
| 4.3.x | no | 3.9.2 | 3.12 |
+------------+------------+----------------+-----------------+
| 4.2.x | no | 3.8 | 3.11 |
+------------+------------+----------------+-----------------+
Expand Down
3 changes: 3 additions & 0 deletions nose_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nose~=1.3.7
nose-exclude
nose-timer~=1.0.0
18 changes: 7 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ classifiers = [
"Programming Language :: C",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand All @@ -41,17 +40,17 @@ classifiers = [
keywords = [
"astronomy astrophysics visualization amr adaptivemeshrefinement",
]
requires-python = ">=3.9.2"
requires-python = ">=3.10.3"
dependencies = [
"cmyt>=1.1.2",
"ewah-bool-utils>=1.2.0",
"matplotlib>=3.5",
"more-itertools>=8.4",
"numpy>=1.19.3, <3", # keep minimal requirement in sync with NPY_TARGET_VERSION
"numpy>=1.21.3, <3", # keep minimal requirement in sync with NPY_TARGET_VERSION
# https://github.com/numpy/numpy/issues/27037
"numpy!=2.0.1 ; platform_machine=='arm64' and platform_system=='Darwin'",
"packaging>=20.9",
"pillow>=8.0.0",
"pillow>=8.3.2",
"tomli-w>=0.4.0",
"tqdm>=3.4.0",
"unyt>=2.9.2",
Expand Down Expand Up @@ -212,9 +211,9 @@ minimal = [
"ewah-bool-utils==1.2.0",
"matplotlib==3.5",
"more-itertools==8.4",
"numpy==1.19.3",
"numpy==1.21.3",
"packaging==20.9",
"pillow==8.0.0",
"pillow==8.3.2",
"tomli-w==0.4.0",
"tqdm==3.4.0",
"unyt==2.9.2",
Expand All @@ -226,9 +225,6 @@ test = [
"pytest>=6.1",
"pytest-mpl>=0.16.1",
"sympy!=1.10,!=1.9", # see https://github.com/sympy/sympy/issues/22241
"nose~=1.3.7; python_version < '3.10'",
"nose-exclude; python_version < '3.10'",
"nose-timer~=1.0.0; python_version < '3.10'",
"imageio!=2.35.0", # see https://github.com/yt-project/yt/issues/4966
]
typecheck = [
Expand Down Expand Up @@ -486,7 +482,7 @@ ignore = [


[tool.mypy]
python_version = 3.9
python_version = '3.10'
show_error_codes = true
ignore_missing_imports = true
warn_unused_configs = true
Expand All @@ -496,7 +492,7 @@ show_error_context = true
exclude = "(test_*|lodgeit)"

[tool.cibuildwheel]
build = "cp39-* cp310-* cp311-* cp312-*"
build = "cp310-* cp311-* cp312-*"
build-verbosity = 1
test-skip = "*-musllinux*"
test-extras = "test"
Expand Down
2 changes: 1 addition & 1 deletion setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def get_python_include_dirs():
NUMPY_MACROS = [
("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"),
# keep in sync with runtime requirements (pyproject.toml)
("NPY_TARGET_VERSION", "NPY_1_19_API_VERSION"),
("NPY_TARGET_VERSION", "NPY_1_21_API_VERSION"),
]


Expand Down
5 changes: 0 additions & 5 deletions tests/ci_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ cp tests/matplotlibrc .

# Step 1: pre-install required packages
if [[ ${dependencies} == "full" || ${dependencies} == "cartopy" ]]; then
# upgrading pip to guarantee installing extra dependencies with [full] is supported
# this is only necessary for some versions of Python 3.8 and 3.9
# see https://github.com/yt-project/yt/issues/4270
python -m pip install 'pip>=21.2'

case ${RUNNER_OS} in
linux|Linux)
sudo apt-get -qqy update
Expand Down

0 comments on commit 32d1f7b

Please sign in to comment.