From b2b8adb232a9e251a1a88644c7acf6b7b15d012c Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 3 Dec 2026 12:52:02 +0100 Subject: [PATCH] maint: require Python 3.13 or newer (SPEC 0) SPEC 0 drops Python 3.12 after 2026-10-01. requires-python moves to >=3.13, the classifiers and the test-install matrix cover 3.13 to 3.15, and datetime.UTC replaces timezone.utc (ruff UP017 under the new target). Python 3.10 to 3.12 users keep 25.x. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pythonpackage.yml | 2 +- CHANGES.rst | 2 ++ pyproject.toml | 6 ++---- templateflow/__init__.py | 4 ++-- templateflow/conf/_s3.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index bc0bf766..9582a3f0 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -63,7 +63,7 @@ jobs: needs: build strategy: matrix: - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + python-version: ['3.13', '3.14', '3.15'] mode: ['wheel'] include: - {python-version: '3.13', mode: 'repo'} diff --git a/CHANGES.rst b/CHANGES.rst index 3f425322..166de63c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,8 @@ Unreleased (26.0.0) =================== TemplateFlow 2.0 file names: the client reads the v2 skeleton and resolves old names. +* Python 3.13 or newer, following `SPEC 0 `__ + (tested on 3.13 to 3.15). Python 3.10 to 3.12 users keep templateflow 25.x. * New home folders start from the v2 skeleton (``templateflow-skel-v2.zip``): current names only, with ``renames.tsv`` and a manifest of every file's size and checksum. Updates make the home match it: they add files, refresh text files, prune stubs of diff --git a/pyproject.toml b/pyproject.toml index 117bae15..06e80130 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,14 +12,12 @@ classifiers = [ "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: Image Recognition", "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", ] license = {file = "LICENSE"} -requires-python = ">=3.10" +requires-python = ">=3.13" dependencies = [ "acres >= 0.5.0", "platformdirs >= 4.0", diff --git a/templateflow/__init__.py b/templateflow/__init__.py index f407eaf8..e0781120 100644 --- a/templateflow/__init__.py +++ b/templateflow/__init__.py @@ -22,11 +22,11 @@ # """TemplateFlow is the Zone of Templates.""" +from datetime import UTC as _UTC from datetime import datetime as _dt -from datetime import timezone as _tz __packagename__ = 'templateflow' -__copyright__ = f'{_dt.now(tz=_tz.utc).year} The NiPreps Developers' +__copyright__ = f'{_dt.now(tz=_UTC).year} The NiPreps Developers' try: from ._version import __version__ except ModuleNotFoundError: diff --git a/templateflow/conf/_s3.py b/templateflow/conf/_s3.py index c2bc8b09..9d2224d1 100644 --- a/templateflow/conf/_s3.py +++ b/templateflow/conf/_s3.py @@ -46,7 +46,7 @@ import os from contextlib import suppress from dataclasses import dataclass, field -from datetime import datetime, timezone +from datetime import UTC, datetime from hashlib import md5 from io import BytesIO from json import dumps, loads @@ -210,7 +210,7 @@ def write_state(dest, state: dict) -> None: path.parent.mkdir(parents=True, exist_ok=True) state = { **state, - 'Updated': datetime.now(tz=timezone.utc).isoformat(timespec='seconds'), + 'Updated': datetime.now(tz=UTC).isoformat(timespec='seconds'), 'Client': __version__, } path.write_text(dumps(state, indent=2) + '\n')