From 29c711899b46e141d334e5ab56e99de67a1aee56 Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Sat, 26 Sep 2026 17:12:03 -0400 Subject: [PATCH 1/2] COMP: Make pyproject.toml authoritative for version --- ants/__init__.py | 4 +++- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ants/__init__.py b/ants/__init__.py index c60a176d..c0a6bc09 100644 --- a/ants/__init__.py +++ b/ants/__init__.py @@ -1,5 +1,7 @@ -__version__ = '0.6.3' +from importlib.metadata import version + +__version__ = version("antspyx") from .core import * from .label import * diff --git a/pyproject.toml b/pyproject.toml index 3cebf219..14541f9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ version = "0.6.4" description = "A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more." license = { text = "Apache-2.0" } readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.10" authors = [ { name = "Brian B. Avants", email = "stnava@gmail.com" } ] From cd5843eba778a0f48e6032f1faab769864911eca Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Sat, 26 Sep 2026 17:43:24 -0400 Subject: [PATCH 2/2] CI: Readthedocs cannot read metadata because it doesn't install package We can force an install but easier just to fall back without error --- ants/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ants/__init__.py b/ants/__init__.py index c0a6bc09..f353033d 100644 --- a/ants/__init__.py +++ b/ants/__init__.py @@ -1,7 +1,12 @@ -from importlib.metadata import version +from importlib.metadata import PackageNotFoundError as _PackageNotFoundError +from importlib.metadata import version as _version -__version__ = version("antspyx") +try: + __version__ = _version("antspyx") +except _PackageNotFoundError: + # Documentation builds import the source tree without installing antspyx. + __version__ = "unknown" from .core import * from .label import *