From 50276913ab8784a7a2112b8d4e8a184b89805a90 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Sat, 4 Apr 2026 23:07:04 -0700 Subject: [PATCH] fix: align CI Python versions with PyO3 support --- .github/workflows/ci.yml | 1 - pyproject.toml | 1 - tests/test_project_metadata.py | 30 ++++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 tests/test_project_metadata.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ba8b41..4481614 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,6 @@ jobs: - "3.11" - "3.12" - "3.13" - - "3.14" steps: - name: Check out repository diff --git a/pyproject.toml b/pyproject.toml index 5813592..c6a18f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,6 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Rust", "Topic :: Scientific/Engineering :: Mathematics", diff --git a/tests/test_project_metadata.py b/tests/test_project_metadata.py new file mode 100644 index 0000000..070f78a --- /dev/null +++ b/tests/test_project_metadata.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +import re +import tomllib +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] + + +def pyproject_python_versions() -> list[str]: + data = tomllib.loads((ROOT / "pyproject.toml").read_text()) + classifiers = data["project"]["classifiers"] + return sorted( + match.group(1) + for classifier in classifiers + if (match := re.fullmatch(r"Programming Language :: Python :: (3\.\d+)", classifier)) + ) + + +def workflow_python_versions() -> list[str]: + workflow = (ROOT / ".github/workflows/ci.yml").read_text() + return sorted(set(re.findall(r'- "(3\.\d+)"', workflow))) + + +def test_python_version_support_matches_current_bindings() -> None: + expected = ["3.10", "3.11", "3.12", "3.13"] + + assert pyproject_python_versions() == expected + assert workflow_python_versions() == expected