Skip to content

Commit 1e8c0fb

Browse files
authored
Merge branch 'master' into agent/fix-15234-power-sort-comparable
2 parents 03e45c0 + 7f81fcd commit 1e8c0fb

29 files changed

Lines changed: 374 additions & 748 deletions

‎.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

‎.python-version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.14t
1+
3.15t

‎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.

‎data_structures/binary_tree/serialize_deserialize_binary_tree.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TreeNode:
1919
left: TreeNode | None = None
2020
right: TreeNode | None = None
2121

22-
def __post_init__(self):
22+
def __post_init__(self) -> None:
2323
if not isinstance(self.value, int):
2424
raise TypeError("Value must be an integer.")
2525

‎data_structures/heap/min_heap.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, name, val) -> None:
1010
def __str__(self) -> str:
1111
return f"{self.__class__.__name__}({self.name}, {self.val})"
1212

13-
def __lt__(self, other):
13+
def __lt__(self, other) -> bool:
1414
return self.val < other.val
1515

1616

‎data_structures/linked_list/has_loop.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
from collections.abc import Iterator
34
from typing import Any
45

56

@@ -12,7 +13,7 @@ def __init__(self, data: Any) -> None:
1213
self.data: Any = data
1314
self.next_node: Node | None = None
1415

15-
def __iter__(self):
16+
def __iter__(self) -> Iterator[Any]:
1617
node = self
1718
visited = set()
1819
while node:

‎divide_and_conquer/convex_hull.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,30 @@ class Point:
4848
def __init__(self, x, y) -> None:
4949
self.x, self.y = float(x), float(y)
5050

51-
def __eq__(self, other):
51+
def __eq__(self, other) -> bool:
5252
return self.x == other.x and self.y == other.y
5353

54-
def __ne__(self, other):
54+
def __ne__(self, other) -> bool:
5555
return not self == other
5656

57-
def __gt__(self, other):
57+
def __gt__(self, other) -> bool:
5858
if self.x > other.x:
5959
return True
6060
elif self.x == other.x:
6161
return self.y > other.y
6262
return False
6363

64-
def __lt__(self, other):
64+
def __lt__(self, other) -> bool:
6565
return not self > other
6666

67-
def __ge__(self, other):
67+
def __ge__(self, other) -> bool:
6868
if self.x > other.x:
6969
return True
7070
elif self.x == other.x:
7171
return self.y >= other.y
7272
return False
7373

74-
def __le__(self, other):
74+
def __le__(self, other) -> bool:
7575
if self.x < other.x:
7676
return True
7777
elif self.x == other.x:
@@ -81,7 +81,7 @@ def __le__(self, other):
8181
def __repr__(self) -> str:
8282
return f"({self.x}, {self.y})"
8383

84-
def __hash__(self):
84+
def __hash__(self) -> int:
8585
return hash(self.x)
8686

8787

0 commit comments

Comments
 (0)