Skip to content

Commit f66f644

Browse files
committed
Upgrade to Python 3.15t
1 parent 7e7894f commit f66f644

7 files changed

Lines changed: 30 additions & 617 deletions

File tree

‎.devcontainer/devcontainer.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
//
1010
// This repo tracks the latest-and-greatest CPython on the newest stable
1111
// Debian. Images are published per CPython minor version on Debian 13
12-
// "Trixie" (3.11-trixie ... 3.14-trixie); bump this to the newest available
12+
// "Trixie" (3.11-trixie ... 3.15-trixie); bump this to the newest available
1313
// when a new stable CPython ships.
14-
// NOTE: these images do not publish free-threaded (`t`) variants, so 3.14t
14+
// NOTE: these images do not publish free-threaded (`t`) variants, so 3.15t
1515
// cannot be selected via the tag alone -- but the repo's `.python-version`
16-
// pins 3.14t, and `uv run`/`uv sync` in the container honor it, so uv gives
17-
// contributors free-threaded 3.14t regardless of the base tag.
16+
// pins 3.15t, and `uv run`/`uv sync` in the container honor it, so uv gives
17+
// contributors free-threaded 3.15t regardless of the base tag.
1818
"image": "mcr.microsoft.com/devcontainers/python:latest",
1919

2020
// Install the tools post_install and CI expect (pre-commit + ruff), plus uv

‎.github/workflows/build.yml‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@ jobs:
2222
allow-prereleases: true
2323
- run: uv sync --group=test
2424
- name: Run tests
25-
# opencv-python is gated out on 3.14t (no cp314t wheel yet), so skip the
25+
# opencv-python is gated out on 3.15t (no cp315t wheel yet), so skip the
2626
# files that import cv2. Pure-Python algorithms in computer_vision/ and
2727
# data_compression/ still run; digital_image_processing/ is almost entirely
28-
# cv2-based so it is skipped as a tree. Re-enable when a cp314t wheel ships.
28+
# cv2-based so it is skipped as a tree. Re-enable when a cp315t wheel ships.
2929
# --ignore-gil-enabled: some compiled deps (sklearn, xgboost, ...) don't
3030
# yet ship the Py_mod_gil slot, so importing them re-enables the GIL under
31-
# 3.14t. That's an upstream-wheel gap, not our code; the flag lets the suite
31+
# 3.15t. That's an upstream-wheel gap, not our code; the flag lets the suite
3232
# run anyway and pytest-run-parallel still reports which tests are not
3333
# thread-safe. Drop the flag once the scientific stack ships free-threaded wheels.
34-
# qiskit is likewise gated out of the 3.14t deps (Qiskit/qiskit#16893), so the
35-
# single file that imports it (quantum/q_fourier_transform.py) is skipped too.
3634
run: uv run --with=pytest-run-parallel pytest
3735
--iterations=8 --parallel-threads=auto --ignore-gil-enabled
3836
--ignore=computer_vision/flip_augmentation.py
@@ -42,7 +40,6 @@ jobs:
4240
--ignore=digital_image_processing/
4341
--ignore=docs/conf.py
4442
--ignore=project_euler/
45-
--ignore=quantum/q_fourier_transform.py
4643
--ignore=scripts/validate_solutions.py
4744
--ignore=web_programming/current_stock_price.py
4845
--ignore=web_programming/fetch_anime_and_play.py

‎.github/workflows/ty.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ jobs:
2828
# [build-system], so uv treats the project as virtual and installs only
2929
# its dependencies -- no "Multiple top-level packages discovered in a
3030
# flat-layout" error and no need for a src-layout. (`uv pip install .`
31-
# would force that wheel build and fail.) Pin a regular GIL 3.14 so typed
32-
# third-party dependencies resolve; the free-threaded 3.14t interpreter the
31+
# would force that wheel build and fail.) Pin a regular GIL 3.15 so typed
32+
# third-party dependencies resolve; the free-threaded 3.15t interpreter the
3333
# test matrix uses lacks wheels for several of them. ty itself is pulled in
3434
# ephemerally with `--with` so it needn't be added to the lockfile.
35-
- run: uv sync --python 3.14
36-
# Pin the *run* to the same regular-GIL 3.14 too. Without `--python 3.14`
35+
- run: uv sync --python 3.15
36+
# Pin the *run* to the same regular-GIL 3.15 too. Without `--python 3.15`
3737
# here, `uv run` re-resolved the project's default interpreter -- the
38-
# free-threaded 3.14t used by the test matrix -- so ty type-checked against
38+
# free-threaded 3.15t used by the test matrix -- so ty type-checked against
3939
# an env where many third-party stubs don't resolve, drowning real findings
40-
# in `unresolved-import` / `unresolved-attribute` noise. Pinning 3.14 lets
40+
# in `unresolved-import` / `unresolved-attribute` noise. Pinning 3.15 lets
4141
# ty see the synced dependencies, so the `[tool.ty.rules]` severities in
4242
# pyproject.toml apply to a meaningful baseline.
4343
#
@@ -50,4 +50,4 @@ jobs:
5050
# to make ty a required gate once the [tool.ty] baseline is clean.
5151
# `continue-on-error: true` above stays as a belt-and-suspenders guard so a
5252
# ty *crash* (not a diagnostic) can never block a merge either.
53-
- run: uv run --python 3.14 --with ty ty check --output-format=github --exit-zero
53+
- run: uv run --python 3.15 --with ty ty check --output-format=github --exit-zero

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pre-commit run --all-files --show-diff-on-failure
100100

101101
We want your work to be readable by others; therefore, we encourage you to note the following:
102102

103-
- Please write in free-threaded Python 3.14t+. For instance: `print()` is a function in Python 3, so `print "Hello"` will *not* work, but `print("Hello")` will.
103+
- Please write in free-threaded Python 3.15t+. For instance: `print()` is a function in Python 3, so `print "Hello"` will *not* work, but `print("Hello")` will.
104104

105105
- Please focus hard on the naming of functions, classes, and variables. Help your reader by using __descriptive names__ that can help you to remove redundant comments.
106106
- Single-letter variable names are *old school*, so please avoid them unless their life only spans a few lines.

‎pyproject.toml‎

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ name = "thealgorithms-python"
33
version = "0.0.1"
44
description = "TheAlgorithms in Python"
55
authors = [ { name = "TheAlgorithms Contributors" } ]
6-
requires-python = ">=3.14"
6+
requires-python = ">=3.15"
77
classifiers = [
88
"Programming Language :: Python :: 3 :: Only",
9-
"Programming Language :: Python :: 3.14",
109
"Programming Language :: Python :: 3.15",
1110
"Programming Language :: Python :: Free Threading :: 2 - Beta",
1211
]
@@ -39,30 +38,21 @@ docs = [
3938
"sphinx>=8.2",
4039
"sphinx-autoapi>=3.4",
4140
]
42-
# opencv-python has no free-threaded (cp314t) wheel yet and fails to build from
43-
# source under 3.14t (CMake), which blocks `uv sync` for every job. Keep it in an
41+
# opencv-python has no free-threaded (cp315t) wheel yet and fails to build from
42+
# source under 3.15t (CMake), which blocks `uv sync` for every job. Keep it in an
4443
# optional group so the free-threaded CI can install everything else and actually
4544
# run pytest-run-parallel on the pure-Python algorithms. Re-fold into core deps
46-
# once a cp314t wheel ships (upstream: opencv/opencv#27933).
45+
# once a cp315t wheel ships (upstream: opencv/opencv#27933).
4746
cv = [
4847
"opencv-python>=4.10.0.84",
4948
]
5049
euler-validate = [
5150
"httpx2>=2.0.1",
5251
"numpy>=2.1.3",
5352
]
54-
# qiskit does not yet run on free-threaded CPython: its compiled core re-enables
55-
# the GIL under 3.14t and the team is still scoping free-threading support
56-
# (upstream: Qiskit/qiskit#16893). Keep it in an optional group so the
57-
# free-threaded CI can install everything else; only quantum/q_fourier_transform.py
58-
# imports it, and that file is ignored in the 3.14t test run. Re-fold into core
59-
# deps once qiskit supports free-threading.
60-
quantum = [
61-
"qiskit>=2",
62-
]
6353

6454
[tool.ruff]
65-
target-version = "py314"
55+
target-version = "py315"
6656
output-format = "full"
6757
lint.select = [
6858
# https://docs.astral.sh/ruff/rules
@@ -321,14 +311,11 @@ skip = """\
321311
nary.txt,strings/words.txt\
322312
"""
323313

324-
[tool.mypy]
325-
python_version = "3.14"
326-
327314
[tool.ty]
328-
# Type-check against a regular (GIL) 3.14 interpreter. Pinning this keeps ty's
315+
# Type-check against a regular (GIL) 3.15 interpreter. Pinning this keeps ty's
329316
# assumptions consistent with the CI job in .github/workflows/ty.yml, where the
330-
# free-threaded 3.14t test venv would otherwise leave several stubs unresolved.
331-
environment.python-version = "3.14"
317+
# free-threaded 3.15t test venv would otherwise leave several stubs unresolved.
318+
environment.python-version = "3.15"
332319
rules.call-non-callable = "ignore"
333320
rules.deprecated = "ignore"
334321
rules.invalid-argument-type = "ignore"

‎quantum/q_fourier_transform.py‎

Lines changed: 0 additions & 133 deletions
This file was deleted.

0 commit comments

Comments
 (0)