Skip to content

Commit 275e4e9

Browse files
🚫 Remove Python 3.10 Support (#1034)
This PR removes **Python 3.10** support across TIAToolbox and updates code, tooling, and documentation to reflect **Python 3.11+** as the new minimum supported version. This aligns the project with modern Python typing, timezone features, and the upstream ecosystem’s deprecation trajectory. ### ✅ Summary of Changes **Packaging & Tooling** - Set minimum supported Python to **3.11** in: - `setup.py` (`python_requires`) - Conda environment YAMLs - `pyproject.toml` (Ruff `target-version` & mypy `python_version`) - Remove Python 3.10 from: - GitHub Actions matrices (`python-package`, `mypy-type-check`, `pip-install`) - Docker publish workflow **Docker Images** - Remove **Debian** and **Ubuntu** Dockerfiles for Python 3.10. **Code Modernization** - Switch from `typing_extensions.Self` → stdlib `typing.Self`. - Replace `timezone.utc` → `datetime.UTC` (Python 3.11+). - Update tests relying on specific Python version semantics (e.g., rename `test_py310_init` → `test_py311_init`). **Documentation** - Update supported Python versions in: - `docs/installation.rst` - `CONTRIBUTING.rst` - `README.md` (example env creation now uses Python 3.11) ### 🔍 Reviewed Changes Copilot reviewed **18 out of 18** modified files and produced **2 comments**. <details> <summary>Summary per file</summary> | File | Description | | ---- | ----------- | | `tiatoolbox/wsicore/wsireader.py` | Switch to `datetime.UTC` and update timezone handling. | | `tiatoolbox/annotation/storage.py` | Replace `typing_extensions.Self` with stdlib `typing.Self`. | | `tests/test_annotation_stores.py` | Update version‑specific test names/values to target 3.11. | | `setup.py` | Set `python_requires >= 3.11` and drop 3.10 classifier. | | `requirements/*.conda.yml` | Require Python ≥ 3.11 across all conda env specs. | | `pyproject.toml` | Update Ruff target version and mypy python_version to 3.11. | | `docs/installation.rst` | Remove 3.10 from “tested versions” list. | | `docker/3.10/*` | Remove 3.10 Ubuntu/Debian Docker image definitions. | | `README.md` | Update conda example to Python 3.11. | | `CONTRIBUTING.rst` | Update contributor guidelines to Python 3.11+. | | `.github/workflows/*` | Remove Python 3.10 from all CI matrices. | </details> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f06bf3b commit 275e4e9

19 files changed

+26
-77
lines changed

.github/workflows/docker-publish.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ jobs:
1515
fail-fast: true
1616
matrix:
1717
include:
18-
- dockerfile: ./docker/3.10/Debian/Dockerfile
19-
mtag: py3.10-debian
20-
- dockerfile: ./docker/3.10/Ubuntu/Dockerfile
21-
mtag: py3.10-ubuntu
2218
- dockerfile: ./docker/3.11/Debian/Dockerfile
2319
mtag: py3.11-debian
2420
- dockerfile: ./docker/3.11/Ubuntu/Dockerfile

.github/workflows/mypy-type-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
strategy:
2020
matrix:
21-
python-version: ["3.10", "3.11", "3.12", "3.13"]
21+
python-version: ["3.11", "3.12", "3.13"]
2222

2323
steps:
2424

.github/workflows/pip-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.10", "3.11", "3.12", "3.13"]
34+
python-version: ["3.11", "3.12", "3.13"]
3535
os: [ubuntu-24.04, windows-latest, macos-latest]
3636

3737
# Force UTF-8 everywhere (Windows is the one that really needs it)

.github/workflows/python-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: true
2222
matrix:
23-
python-version: ["3.10", "3.11", "3.12", "3.13"]
23+
python-version: ["3.11", "3.12", "3.13"]
2424

2525
steps:
2626
- uses: actions/checkout@v4
@@ -101,10 +101,10 @@ jobs:
101101
steps:
102102
- uses: actions/checkout@v4
103103

104-
- name: Set up Python 3.10
104+
- name: Set up Python 3.11
105105
uses: actions/setup-python@v4
106106
with:
107-
python-version: '3.10'
107+
python-version: '3.11'
108108
cache: 'pip'
109109

110110
- name: Install dependencies

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Before you submit a pull request, check that it meets these guidelines:
9898

9999
1. The pull request should include tests.
100100
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the pull request description.
101-
3. The pull request should work for Python 3.10, 3.11, 3.12 and 3.13, and for PyPy. Check https://github.com/TissueImageAnalytics/tiatoolbox/actions/workflows/python-package.yml and make sure that the tests pass for all supported Python versions.
101+
3. The pull request should work for Python 3.11, 3.12, and 3.13 and for PyPy. Check https://github.com/TissueImageAnalytics/tiatoolbox/actions/workflows/python-package.yml and make sure that the tests pass for all supported Python versions.
102102

103103
Tips
104104
----

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Prepare a computer as a convenient platform for further development of the Pytho
106106
5. Create virtual environment for TIAToolbox using
107107

108108
```sh
109-
$ conda create -n tiatoolbox-dev python=3.10 # select version of your choice
109+
$ conda create -n tiatoolbox-dev python=3.11 # select version of your choice
110110
$ conda activate tiatoolbox-dev
111111
$ pip install -r requirements/requirements_dev.txt
112112
```

docker/3.10/Debian/Dockerfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

docker/3.10/Ubuntu/Dockerfile

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ MacPorts
5959
Installing Stable Release
6060
=========================
6161

62-
Please note that TIAToolbox is tested for Python versions 3.10, 3.11, 3.12 and 3.13.
62+
Please note that TIAToolbox is tested for Python versions 3.11, 3.12, and 3.13.
6363

6464
Recommended
6565
-----------

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ line-length = 88
136136
# Allow unused variables when underscore-prefixed.
137137
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
138138

139-
# Minimum Python version 3.10.
140-
target-version = "py310"
139+
# Minimum Python version 3.11.
140+
target-version = "py311"
141141

142142
[tool.ruff.lint.mccabe]
143143
# Unlike Flake8, default to a complexity level of 10.
@@ -174,4 +174,4 @@ skip-magic-trailing-comma = false
174174

175175
[tool.mypy]
176176
ignore_missing_imports = true
177-
python_version = "3.10"
177+
python_version = "3.11"

0 commit comments

Comments
 (0)