From d158e4731e9df23cee6b1426ab76a092221f81ab Mon Sep 17 00:00:00 2001 From: priya-sundaram-dev Date: Fri, 28 Aug 2026 05:57:55 +0000 Subject: [PATCH 1/5] ci: switch default Python to free-threaded 3.14t Change the interpreter used across CI workflows from 3.14 to the free-threaded build 3.14t to surface which dependencies and tests are not yet free-threading compatible. Opened as DRAFT for documentation purposes per maintainer request (#15081). --- .github/workflows/build.yml | 2 +- .github/workflows/directory_writer.yml | 2 +- .github/workflows/project_euler.yml | 4 ++-- .github/workflows/sphinx.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ed88a88f2bb..607080437816 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: cache-dependency-glob: uv.lock - uses: actions/setup-python@v7 with: - python-version-file: pyproject.toml + python-version: 3.14t allow-prereleases: true - run: uv sync --group=test - name: Run tests diff --git a/.github/workflows/directory_writer.yml b/.github/workflows/directory_writer.yml index 9df64222cd56..4201b31c755b 100644 --- a/.github/workflows/directory_writer.yml +++ b/.github/workflows/directory_writer.yml @@ -11,7 +11,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v7 with: - python-version-file: pyproject.toml + python-version: 3.14t allow-prereleases: true - name: Write DIRECTORY.md run: | diff --git a/.github/workflows/project_euler.yml b/.github/workflows/project_euler.yml index 06f865f0bcdf..0c2486716743 100644 --- a/.github/workflows/project_euler.yml +++ b/.github/workflows/project_euler.yml @@ -25,7 +25,7 @@ jobs: - uses: astral-sh/setup-uv@v7 - uses: actions/setup-python@v7 with: - python-version-file: pyproject.toml + python-version: 3.14t allow-prereleases: true - run: uv sync --group=euler-validate --group=test - run: uv run pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/ @@ -43,7 +43,7 @@ jobs: - uses: astral-sh/setup-uv@v7 - uses: actions/setup-python@v7 with: - python-version-file: pyproject.toml + python-version: 3.14t allow-prereleases: true - run: uv sync --group=euler-validate --group=test - run: uv run pytest scripts/validate_solutions.py diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 3828bea0eaf0..b7e3303f321b 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -36,7 +36,7 @@ jobs: - uses: astral-sh/setup-uv@v7 - uses: actions/setup-python@v7 with: - python-version-file: pyproject.toml + python-version: 3.14t allow-prereleases: true - run: uv sync --group=docs - uses: actions/configure-pages@v6 From 19702af75610f3e281c83ab084d7a5fa46587ca3 Mon Sep 17 00:00:00 2001 From: Priya Sundaram Date: Fri, 28 Aug 2026 06:28:04 +0000 Subject: [PATCH 2/5] deps: bump pandas 2.2.3 -> 2.3.3 (first release with Python 3.14 + free-threaded wheels) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1a55feda3cbb..904c61f1d31c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ "matplotlib>=3.9.3", "numpy>=2.1.3", "opencv-python>=4.10.0.84", - "pandas>=2.2.3", + "pandas>=2.3.3", "pillow>=11.3", "rich>=13.9.4", "scikit-learn>=1.5.2", From 9f20d6a2fa7293c5c0b3e42e44708745be050c76 Mon Sep 17 00:00:00 2001 From: Priya Sundaram Date: Fri, 28 Aug 2026 09:29:38 +0000 Subject: [PATCH 3/5] ci(3.14t): gate opencv-python into optional 'cv' group + skip cv2 files opencv-python has no cp314t wheel yet and fails to build from source under free-threaded 3.14t (CMake), blocking uv sync for every job. Move it to an optional [dependency-groups] cv group so the ft CI installs everything else and runs pytest-run-parallel on the pure-Python algorithms. Skip the 20 files that import cv2 (computer_vision augmentations, data_compression PSNR, and the mostly-cv2 digital_image_processing/ tree). Re-fold once a cp314t wheel ships (upstream: opencv/opencv#27933). --- .github/workflows/build.yml | 9 +++++++++ pyproject.toml | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 607080437816..00b263e232ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,9 +22,18 @@ jobs: - run: uv sync --group=test - name: Run tests # TODO: #8818 Re-enable quantum tests + # opencv-python is gated out on 3.14t (no cp314t wheel yet), so skip the + # files that import cv2. Pure-Python algorithms in computer_vision/ and + # data_compression/ still run; digital_image_processing/ is almost entirely + # cv2-based so it is skipped as a tree. Re-enable when a cp314t wheel ships. run: uv run --with=pytest-run-parallel pytest --iterations=8 --parallel-threads=auto --ignore=computer_vision/cnn_classification.py + --ignore=computer_vision/flip_augmentation.py + --ignore=computer_vision/harris_corner.py + --ignore=computer_vision/mosaic_augmentation.py + --ignore=data_compression/peak_signal_to_noise_ratio.py + --ignore=digital_image_processing/ --ignore=docs/conf.py --ignore=dynamic_programming/k_means_clustering_tensorflow.py --ignore=machine_learning/local_weighted_learning/local_weighted_learning.py diff --git a/pyproject.toml b/pyproject.toml index 904c61f1d31c..5b9960d325a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,6 @@ dependencies = [ "lxml>=6", "matplotlib>=3.9.3", "numpy>=2.1.3", - "opencv-python>=4.10.0.84", "pandas>=2.3.3", "pillow>=11.3", "rich>=13.9.4", @@ -33,6 +32,14 @@ dependencies = [ ] [dependency-groups] +# opencv-python has no free-threaded (cp314t) wheel yet and fails to build from +# source under 3.14t (CMake), which blocks `uv sync` for every job. Keep it in an +# optional group so the free-threaded CI can install everything else and actually +# run pytest-run-parallel on the pure-Python algorithms. Re-fold into core deps +# once a cp314t wheel ships (upstream: opencv/opencv#27933). +cv = [ + "opencv-python>=4.10.0.84", +] test = [ "pytest>=8.4.1", "pytest-cov>=6", From 2725960da3463484bb1eeca7bccecb911d9db963 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2026 09:30:02 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyproject.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5b9960d325a3..dcbc3d796435 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,14 +32,6 @@ dependencies = [ ] [dependency-groups] -# opencv-python has no free-threaded (cp314t) wheel yet and fails to build from -# source under 3.14t (CMake), which blocks `uv sync` for every job. Keep it in an -# optional group so the free-threaded CI can install everything else and actually -# run pytest-run-parallel on the pure-Python algorithms. Re-fold into core deps -# once a cp314t wheel ships (upstream: opencv/opencv#27933). -cv = [ - "opencv-python>=4.10.0.84", -] test = [ "pytest>=8.4.1", "pytest-cov>=6", @@ -49,6 +41,14 @@ docs = [ "sphinx-autoapi>=3.4", "sphinx-pyproject>=0.3", ] +# opencv-python has no free-threaded (cp314t) wheel yet and fails to build from +# source under 3.14t (CMake), which blocks `uv sync` for every job. Keep it in an +# optional group so the free-threaded CI can install everything else and actually +# run pytest-run-parallel on the pure-Python algorithms. Re-fold into core deps +# once a cp314t wheel ships (upstream: opencv/opencv#27933). +cv = [ + "opencv-python>=4.10.0.84", +] euler-validate = [ "httpx>=0.28.1", "numpy>=2.1.3", From 87909f63b10fded0bc058a300bd0baea4a99fc3b Mon Sep 17 00:00:00 2001 From: priya-sundaram-dev Date: Fri, 28 Aug 2026 09:58:59 +0000 Subject: [PATCH 5/5] ci(3.14t): add --ignore-gil-enabled so sklearn/xgboost imports don't abort the run --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00b263e232ec..e20398973ff6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,13 @@ jobs: # files that import cv2. Pure-Python algorithms in computer_vision/ and # data_compression/ still run; digital_image_processing/ is almost entirely # cv2-based so it is skipped as a tree. Re-enable when a cp314t wheel ships. + # --ignore-gil-enabled: some compiled deps (sklearn, xgboost, ...) don't + # yet ship the Py_mod_gil slot, so importing them re-enables the GIL under + # 3.14t. That's an upstream-wheel gap, not our code; the flag lets the suite + # run anyway and pytest-run-parallel still reports which tests are not + # thread-safe. Drop the flag once the scientific stack ships free-threaded wheels. run: uv run --with=pytest-run-parallel pytest - --iterations=8 --parallel-threads=auto + --iterations=8 --parallel-threads=auto --ignore-gil-enabled --ignore=computer_vision/cnn_classification.py --ignore=computer_vision/flip_augmentation.py --ignore=computer_vision/harris_corner.py