Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jobs:
fail-fast: true
matrix:
include:
- dockerfile: ./docker/3.10/Debian/Dockerfile
mtag: py3.10-debian
- dockerfile: ./docker/3.10/Ubuntu/Dockerfile
mtag: py3.10-ubuntu
- dockerfile: ./docker/3.11/Debian/Dockerfile
mtag: py3.11-debian
- dockerfile: ./docker/3.11/Ubuntu/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy-type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13"]

steps:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pip-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13"]
os: [ubuntu-24.04, windows-latest, macos-latest]

# Force UTF-8 everywhere (Windows is the one that really needs it)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -101,10 +101,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
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.
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.
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.

Tips
----
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Prepare a computer as a convenient platform for further development of the Pytho
5. Create virtual environment for TIAToolbox using

```sh
$ conda create -n tiatoolbox-dev python=3.10 # select version of your choice
$ conda create -n tiatoolbox-dev python=3.11 # select version of your choice
$ conda activate tiatoolbox-dev
$ pip install -r requirements/requirements_dev.txt
```
Expand Down
15 changes: 0 additions & 15 deletions docker/3.10/Debian/Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions docker/3.10/Ubuntu/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ MacPorts
Installing Stable Release
=========================

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

Recommended
-----------
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ line-length = 88
# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Minimum Python version 3.10.
target-version = "py310"
# Minimum Python version 3.11.
target-version = "py311"

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

[tool.mypy]
ignore_missing_imports = true
python_version = "3.10"
python_version = "3.11"
3 changes: 1 addition & 2 deletions requirements/requirements.conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ channels:
- defaults
dependencies:
- cython
- openslide
- pip>=20.0.2
- pixman>=0.39.0
- python>=3.10, <=3.13
- python>=3.11, <=3.13
- pip:
- -r requirements.txt
3 changes: 1 addition & 2 deletions requirements/requirements.dev.conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ channels:
- defaults
dependencies:
- cython
- openslide
- pip>=20.0.2
- pixman>=0.39.0
- python>=3.10, <=3.13
- python>=3.11, <=3.13
- pip:
- -r requirements_dev.txt
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ scikit-learn>=1.2.0
scipy>=1.8
shapely>=2.0.0
SimpleITK>=2.2.1
sphinx>=5.3.0
sphinx>=5.3.0, <9.0.0
tifffile>=2022.10.10, <=2025.5.10
timm>=1.0.3
torch>=2.5.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.win64.conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ dependencies:
- openjpeg>=2.4.0
- pip>=20.0.2
- pixman>=0.39.0
- python>=3.10, <=3.13
- python>=3.11, <=3.13
- pip:
- -r requirements.txt
2 changes: 1 addition & 1 deletion requirements/requirements.win64.dev.conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ dependencies:
- openjpeg>=2.4.0
- pip>=20.0.2
- pixman>=0.39.0
- python>=3.10, <=3.13
- python>=3.11, <=3.13
- pip:
- -r requirements_dev.txt
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@
setup(
author="TIA Centre",
author_email="TIA@warwick.ac.uk",
python_requires=">=3.10, <3.14",
python_requires=">=3.11, <3.14",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_annotation_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -1827,13 +1827,13 @@ def test_load_cases_error(
store._load_cases(["foo"], lambda: None, lambda: None)

@staticmethod
def test_py310_init(
def test_py311_init(
fill_store: Callable, # noqa: ARG004
store_cls: type[AnnotationStore],
monkeypatch: object,
) -> None:
"""Test that __init__ is compatible with Python 3.10."""
py310_version = (3, 10, 0)
"""Test that __init__ is compatible with Python 3.11."""
py311_version = (3, 11, 0)

class Connection(sqlite3.Connection):
"""Mock SQLite connection."""
Expand All @@ -1847,7 +1847,7 @@ def create_function(
"""Mock create_function without `deterministic` kwarg."""
return self.create_function(self, name, num_params)

monkeypatch.setattr(sys, "version_info", py310_version)
monkeypatch.setattr(sys, "version_info", py311_version)
monkeypatch.setattr(sqlite3, "Connection", Connection)
_ = store_cls()

Expand Down
2 changes: 1 addition & 1 deletion tiatoolbox/annotation/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
TYPE_CHECKING,
Any,
ClassVar,
Self,
TypeVar,
cast,
overload,
Expand All @@ -72,7 +73,6 @@
from shapely.geometry import LineString, Point, Polygon
from shapely.geometry import mapping as geometry2feature
from shapely.geometry import shape as feature2geometry
from typing_extensions import Self

import tiatoolbox
from tiatoolbox import DuplicateFilter, logger
Expand Down
8 changes: 4 additions & 4 deletions tiatoolbox/wsicore/wsireader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import re
from collections import defaultdict
from datetime import datetime, timezone
from datetime import UTC, datetime
from numbers import Number
from pathlib import Path
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -4681,14 +4681,14 @@ def us_date(string: str) -> datetime:
"""Return datetime parsed according to US date format (UTC-aware)."""
# and we immediately attach UTC.
dt = datetime.strptime(string, r"%m/%d/%y") # noqa: DTZ007
return dt.replace(tzinfo=timezone.utc)
return dt.replace(tzinfo=UTC)

def time(string: str) -> datetime:
"""Return datetime parsed according to HMS format (UTC-aware)."""
# parse to time first; although .time() is tz-agnostic
# DTZ007 is triggered by strptime
t = datetime.strptime(string, r"%H:%M:%S").time() # noqa: DTZ007
today_utc = datetime.now(timezone.utc)
today_utc = datetime.now(UTC)
return today_utc.replace(
hour=t.hour, minute=t.minute, second=t.second, microsecond=0
)
Expand All @@ -4698,7 +4698,7 @@ def time(string: str) -> datetime:
for cast in casting_precedence:
try:
value = cast(value_string)
except ValueError: # noqa: PERF203
except ValueError:
continue
Comment thread
shaneahmed marked this conversation as resolved.
else:
return key, value
Expand Down
Loading