Skip to content

armgit / Soup

Public Imported from GitHub
0

Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.

ci: test Python 3.11-3.13, drop 3.10 (#1805) (#2089)

Alpamys Makazhanb2276bdbe975
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f53d9cec..2ab43982 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -159,7 +159,7 @@ jobs:
# nightly run on main, a manual FULL: seven test cells (no Windows or macOS
# dispatch on 3.11) + the six gated jobs
# pull request labelled ci:full APPROVAL: the four required test cells (ubuntu
- # on 3.10 and 3.12, Windows and macOS on
+ # on 3.11 and 3.12, Windows and macOS on
# 3.12) + the four gated jobs that run on a
# pull request (not type-check, not
# torchao-contract: 2026-10-19, below)
@@ -174,13 +174,27 @@ jobs:
# (x1.33 on that limit). What it gives up: 3 of 64 failing attempts failed on
# windows-3.11 alone, and a failure like that now surfaces on the release
# branch instead of before merge. Branch protection requires neither cell.
+ # Since #1805 (2026-10-21) 3.11 is the oldest supported Python, so Windows and
+ # macOS meet the floor on release/** only; FULL spends those two slots on 3.13.
+ #
+ # 2026-10-21 (#1805): the support matrix is 3.11 / 3.12 / 3.13. 3.10 left it (end
+ # of life on 2026-10-01), 3.13 joined it, and requires-python moved with them to
+ # ">=3.11,<3.14" (tests/test_requires_python_bound.py derives the bound from
+ # RELEASE). 3.13 runs on every OS in FULL and RELEASE and in no pull-request run:
+ # QUICK and APPROVAL stay on 3.12, so a new interpreter cannot turn every open
+ # pull request red at once (the reasoning of the pinned stack below). What it
+ # gives up: a failure that exists only on 3.13 shows on `main` in the next nightly
+ # run, not before merge. Moving the pull-request gate to 3.13 later means changing
+ # APPROVAL, QUICK, the cell `RUN_SUITE` keeps and branch protection together
+ # (tests/test_ci_full_matrix_on_approval.py names every one of them).
#
# 2026-10-07: a labelled pull request runs APPROVAL, no longer FULL. An approval
# run was seven test cells, two of them on macOS, the binding limit above; it is
- # four, one on macOS. What it gives up: a failure that exists only on ubuntu
- # 3.11, Windows 3.10 or macOS 3.10 is not caught before merge and shows on
- # `main` in the next nightly run instead. Branch protection must not require
- # any of the three: they come off it together with this change.
+ # four, one on macOS. What it gives up: a failure that exists only on a
+ # nightly-only cell (then ubuntu 3.11, Windows 3.10 and macOS 3.10; since #1805
+ # the three 3.13 cells) is not caught before merge and shows on `main` in the
+ # next nightly run instead. Branch protection must not require any of the
+ # three: they came off it together with this change.
#
# A quick push costs 3 jobs (lint, plan, one ubuntu cell) instead of 15, and
# none of them on Windows or macOS. A maintainer adds `ci:full` at approval.
@@ -194,10 +208,10 @@ jobs:
# What this costs, and why the merge gate still holds:
#
# - Contributors see only ubuntu / Python 3.12 until approval. A failure that
- # exists only on Windows, macOS or 3.10 surfaces at approval, so that round
- # trip starts later than it used to. One that needs ubuntu on 3.11, or Windows
- # or macOS on 3.10, surfaces after the merge, in the nightly run; one that
- # needs Windows or macOS on 3.11, on the release branch.
+ # exists only on Windows, macOS or 3.11 surfaces at approval, so that round
+ # trip starts later than it used to. One that needs 3.13, on any OS, surfaces
+ # after the merge, in the nightly run; one that needs Windows or macOS on 3.11,
+ # on the release branch.
# - The required smokes (mlx-smoke, pytorch-smoke, transformers-floor) read as
# SKIPPED on a quick run, and branch protection counts a job skipped by its
# `if:` as passing. So the smokes are not what blocks a merge; the test cells
@@ -217,7 +231,7 @@ jobs:
# starts a second approval run, in a concurrency group of its own so it cannot
# cancel the first, and no later push cancels it either. Add other labels
# before `ci:full`.
- # - Coverage uploads from the ubuntu / 3.10 cell only -- the ubuntu cell every
+ # - Coverage uploads from the ubuntu / 3.11 cell only -- the ubuntu cell every
# gated run has and a quick run does not -- so a pull request's Codecov report
# arrives at approval. That cell is also the only one that MEASURES coverage
# (2026-10-19), so the 77% floor is enforced there: a quick run has no such cell
@@ -256,7 +270,7 @@ jobs:
# should read. Measured 2026-10-12..19: about 136 job-minutes a day went to the other
# cells and the smokes of pull requests that changed only these paths (about 185 before
# the warm-cache fix of 2026-10-19). What it gives up: a docs-only change that breaks a
- # test only on Windows, macOS or Python 3.10 (a test that reads one of these paths)
+ # test only on Windows, macOS or Python 3.11 (a test that reads one of these paths)
# shows in the nightly run instead; ubuntu / 3.12 still runs every test. A push, the
# nightly run, a manual dispatch and a release branch are not affected: `docs_only` is
# false for them. Never filter `pull_request` by `paths` for this: a filtered workflow
@@ -278,23 +292,24 @@ jobs:
# The four matrices, each declared once as a JSON literal the tests parse.
# RELEASE is the support matrix, every cell: tests/test_requires_python_bound.py
# derives requires-python from it. FULL is RELEASE minus Windows and macOS on
- # 3.11. APPROVAL is the oldest and the newest Python, the oldest on ubuntu
+ # 3.11. APPROVAL is the oldest Python and the newest one a pull request runs
+ # (3.12: 3.13 is FULL and RELEASE only, see above), the oldest on ubuntu
# only, and tests/test_ci_full_matrix_on_approval.py pins it to exactly the
# required `test (...)` contexts. QUICK is one required cell. Keep the key
# order (it names the checks) and the versions as strings (a JSON 3.10 is 3.1).
RELEASE_MATRIX: >-
{"os": ["ubuntu-latest", "windows-latest", "macos-latest"],
- "python-version": ["3.10", "3.11", "3.12"]}
+ "python-version": ["3.11", "3.12", "3.13"]}
FULL_MATRIX: >-
{"os": ["ubuntu-latest", "windows-latest", "macos-latest"],
- "python-version": ["3.10", "3.11", "3.12"],
+ "python-version": ["3.11", "3.12", "3.13"],
"exclude": [{"os": "windows-latest", "python-version": "3.11"},
{"os": "macos-latest", "python-version": "3.11"}]}
APPROVAL_MATRIX: >-
{"os": ["ubuntu-latest", "windows-latest", "macos-latest"],
- "python-version": ["3.10", "3.12"],
- "exclude": [{"os": "windows-latest", "python-version": "3.10"},
- {"os": "macos-latest", "python-version": "3.10"}]}
+ "python-version": ["3.11", "3.12"],
+ "exclude": [{"os": "windows-latest", "python-version": "3.11"},
+ {"os": "macos-latest", "python-version": "3.11"}]}
QUICK_MATRIX: '{"os": ["ubuntu-latest"], "python-version": ["3.12"]}'
# The pinned upstream stack, named once. QUICK and APPROVAL hand it to the
# jobs as `-c <path>`; FULL and RELEASE hand them nothing.
@@ -602,6 +617,7 @@ jobs:
# #1802: the training stack requires newer core dependencies, so its floor job
# cannot exercise every light-core floor. Install only the core here, on the
# oldest supported Python (PyYAML 6.0 has wheels for it), and start the CLI.
+ # 3.11 since #1805; PyYAML 6.0 and pydantic-core 2.0.1 ship cp311 manylinux wheels.
core-floor:
needs: plan
if: needs.plan.outputs.full == 'true'
@@ -614,7 +630,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
- python-version: "3.10"
+ python-version: "3.11"
- name: Isolate core floors from runner tooling
# Runner/image tooling can require newer packages (wheel>=0.46 needs
# packaging>=24) than the core floor. Keep that graph outside this cell.
@@ -793,7 +809,8 @@ jobs:
# No pip cache (dropped 2026-10-19; it was ubuntu / 3.12 only). Measured over the
# last 12 pull-request runs: the cached ubuntu / 3.12 cell spent 0.49 min (0.33
# to 0.60) restoring the cache plus 1.54 min installing = 2.03 min, the uncached
- # ubuntu / 3.10 cell 1.80 min installing, so the cache cost more than it saved.
+ # ubuntu / 3.10 cell (3.11 since #1805) 1.80 min installing, so the cache cost more
+ # than it saved.
# It also held 6.1 GB of the 8.8 GB the repository uses of its 10 GB Actions
# cache (two 3 GB entries, a new one whenever pyproject.toml or a constraints
# file changes), which is what evicted the small HF caches.
@@ -846,7 +863,8 @@ jobs:
# ~/.cache/huggingface, not what greps for repo-shaped strings in
# tests/ suggest (most of those are config fixtures that never
# download). The list grew because run 30942028585 reddened
- # windows/3.10 on a 429 for SmolLM2-135M-Instruct/config.json — a repo
+ # windows/3.10 (a cell that left the matrix with #1805) on a 429 for
+ # SmolLM2-135M-Instruct/config.json — a repo
# this step did not warm, so the retry loop above never protected it.
#
# "gpt2" is deliberately unqualified: tests ask for the bare id, which
@@ -956,10 +974,11 @@ jobs:
# unchanged. `--dist load` hands the tests of one file to several workers
# and is not used: it was no faster, and one timing test failed under it.
#
- # 2026-10-19: coverage is measured in ONE cell, ubuntu / 3.10, the cell that
- # uploads it. The 77% floor (`--cov-fail-under` in pyproject.toml's `addopts`) is
- # enforced there; every other cell runs the next step with `--no-cov`, which turns
- # the tracer and the floor off for it. A coverage floor measured on seven more
+ # 2026-10-19: coverage is measured in ONE cell, ubuntu / 3.11 (3.10 until #1805,
+ # the oldest supported Python either way), the cell that uploads it. The 77% floor
+ # (`--cov-fail-under` in pyproject.toml's `addopts`) is enforced there; every other
+ # cell runs the next step with `--no-cov`, which turns the tracer and the floor off
+ # for it. A coverage floor measured on seven more
# cells says nothing the one cell does not, and the tracer slows the suite on all
# of them: measured locally, serial, on 147 CLI tests (Python 3.12), 33 s without
# coverage and 85 s with it (CI itself is not measured yet). The two steps carry
@@ -981,7 +1000,8 @@ jobs:
# run for five minutes, before the cap above ends it, so a hang leaves its location in
# the log of the cell that hit it (checked under `-n 2` with a sleeping test: the dump
# comes from the worker, one per attempt). Why: in the nightly run of 2026-10-20,
- # `test (windows-latest, 3.10)` ran to the job's 90-minute limit inside ONE test
+ # `test (windows-latest, 3.10)` (gone since #1805) ran to the job's 90-minute limit
+ # inside ONE test
# (tests/test_mcp_capacity_all_runs.py::test_launching_run_older_than_list_window_blocks,
# started 03:56:45, the other four workers idle from then on), and a macOS pull-request
# cell of 2026-10-13 held its runner for 46 minutes. Measured: the slowest single test
@@ -989,21 +1009,24 @@ jobs:
# two finished tests of one worker, an upper bound), and the longest test step of the
# last 7 days took 27.7 minutes, so none of the caps can fire on a healthy run. A test
# that needs longer marks itself `@pytest.mark.timeout(N)`.
- if: env.RUN_SUITE == 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
+ if: env.RUN_SUITE == 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
timeout-minutes: 45
run: pytest tests/ -n logical --dist loadfile -v --tb=short -o faulthandler_timeout=300 --timeout=600 --timeout-method=thread --max-worker-restart=2 --junitxml=report.xml --cov=soup_cli --cov-report=xml:coverage.xml --cov-report=term-missing:skip-covered
- name: Run unit tests without coverage
- # Same options as the step above minus the coverage reports; `--junitxml` stays,
- # because the nightly test-count badge reads report.xml from ubuntu / 3.11. The
- # same two caps.
- if: env.RUN_SUITE == 'true' && (matrix.os != 'ubuntu-latest' || matrix.python-version != '3.10')
+ # Same options as the step above minus the coverage reports; `--junitxml` stays in
+ # both, because the nightly test-count badge reads report.xml from ubuntu / 3.11,
+ # which runs the step above since #1805 and ran this one before: with it in both,
+ # moving the badge or the coverage cell cannot leave the badge without a report.
+ # The same two caps.
+ if: env.RUN_SUITE == 'true' && (matrix.os != 'ubuntu-latest' || matrix.python-version != '3.11')
timeout-minutes: 45
run: pytest tests/ -n logical --dist loadfile -v --tb=short -o faulthandler_timeout=300 --timeout=600 --timeout-method=thread --max-worker-restart=2 --junitxml=report.xml --no-cov
- name: Upload coverage to Codecov
- # ubuntu / 3.10 is the ubuntu cell every gated run has (release, full,
- # approval) and a quick run does not. It was 3.11 until the approval run
- # stopped having that cell.
- if: env.RUN_SUITE == 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
+ # ubuntu / 3.11 is the ubuntu cell every gated run has (release, full,
+ # approval) and a quick run does not: the oldest supported Python. It was 3.11
+ # until the approval run of 2026-10-07 stopped having that cell, 3.10 from then
+ # on, and 3.11 again since #1805 made it the oldest.
+ if: env.RUN_SUITE == 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
files: coverage.xml
diff --git a/AGENTS.md b/AGENTS.md
index 31a9d2a2..6eaee8f5 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -2,7 +2,7 @@
Tool-agnostic entry point for AI coding agents (Codex, Cursor, Aider, Claude Code, etc.).
-**Soup** is a CLI-first LLM fine-tuning tool. Python 3.10+, Apache-2.0.
+**Soup** is a CLI-first LLM fine-tuning tool. Python 3.11–3.13 (`requires-python = ">=3.11,<3.14"`), Apache-2.0.
## Build & test
@@ -13,7 +13,8 @@ ruff check src/soup_cli/ tests/ # Lint — must be clean before any commit
```
- `pytest -m smoke` runs the slow tests that download models and train (skipped by default).
-- CI matrix: Python 3.10 / 3.11 / 3.12 × Ubuntu / Windows / macOS.
+- CI matrix: Python 3.11 / 3.12 / 3.13 × Ubuntu / Windows / macOS (3.13 in the nightly and
+ release runs; pull requests run 3.11 and 3.12).
## Conventions (must follow)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fe059fb6..e0396120 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -13,9 +13,9 @@ cd Soup
### 2. Set Up Development Environment
-**Requirements:** Python 3.10, 3.11 or 3.12 (`requires-python = ">=3.10,<3.13"`). CI runs
-exactly those three; `tests/test_requires_python_bound.py` derives the declared bound from
-the CI matrix, so widening one without the other fails the suite.
+**Requirements:** Python 3.11, 3.12 or 3.13 (`requires-python = ">=3.11,<3.14"`; 3.10 was
+dropped in #1805). CI runs exactly those three; `tests/test_requires_python_bound.py` derives
+the declared bound from the CI matrix, so widening one without the other fails the suite.
Work inside a virtualenv, then install the project in editable mode with dev
dependencies:
@@ -583,7 +583,7 @@ Great areas for first contributions:
GitHub Actions runs on every push and PR:
- **ruff** linting on Python 3.11 (must pass)
-- **pytest** on Python 3.10, 3.11, 3.12 across Ubuntu, Windows, macOS (must pass)
+- **pytest** on Python 3.11, 3.12, 3.13 across Ubuntu, Windows, macOS (must pass)
- **transformers-floor** on Ubuntu / Python 3.11 (#478): installs
`.[dev]` under `.github/constraints/transformers-floor.txt`, asserts the
pinned `transformers` version, and runs the static `dtype=` / `torch_dtype=`
@@ -603,14 +603,16 @@ GitHub Actions runs on every push and PR:
**Pull requests run a quick subset first.** A push to a pull request runs `lint`
and the tests on Ubuntu / Python 3.12 only. The required cells (Ubuntu on Python
-3.10 and 3.12, Windows and macOS on 3.12, plus the smoke jobs) run when a
+3.11 and 3.12, Windows and macOS on 3.12, plus the smoke jobs) run when a
maintainer adds the `ci:full` label at approval, and on every later push while
the label stays. Until then the other `test (...)` checks show as *Expected* and
the smoke jobs as *skipped*; neither is a failure on your side. A PR is merged
only when those checks are green on its current head. After the merge, `main`
runs the same quick set on every commit and the full matrix (every Python from
-3.10 to 3.12, with 3.11 on Ubuntu only) once a night; a push to a `release/**`
-branch runs every cell.
+3.11 to 3.13, with 3.11 on Ubuntu only) once a night; a push to a `release/**`
+branch runs every cell. Python 3.13 runs in the nightly and release runs only, not
+on a pull request, so a failure that exists only there shows on `main` in the
+next nightly run.
**A draft pull request runs no CI.** Nothing starts while a pull request is a
draft, whatever is pushed to it. Mark it ready for review and the quick set
diff --git a/README.ar.md b/README.ar.md
index e1939c25..0a358f38 100644
--- a/README.ar.md
+++ b/README.ar.md
@@ -1,4 +1,4 @@
-<!-- synced-from: README.md sha256:44c28c06ff7d2445391cfcc7cd483b096453a302085ff8ac52cb48fa79ce4da5 -->
+<!-- synced-from: README.md sha256:4675902b8ea66e77e0822a60fdc9d3205a11eb02fb70cdf3b5670bd9ef1af391 -->
<p align="center">🌍 <a href="README.md">English</a> | <a href="README.tr.md">Türkçe</a> | <strong>العربية</strong> | <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a></p>
<p align="center">
@@ -27,7 +27,7 @@
<p align="center">
<a href="https://pypi.org/project/soup-cli/"><img src="https://img.shields.io/pypi/v/soup-cli?color=blue" alt="PyPI"></a>
<a href="https://pepy.tech/project/soup-cli"><img src="https://img.shields.io/pepy/dt/soup-cli?color=blue" alt="التنزيلات"></a>
- <img src="https://img.shields.io/badge/python-3.10--3.12-blue" alt="Python 3.10-3.12">
+ <img src="https://img.shields.io/badge/python-3.11--3.13-blue" alt="Python 3.11-3.13">
<img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="ترخيص Apache-2.0">
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/MakazhanAlpamys/65fdc943f85f3b2c46ecddb415c2b779/raw/soup_tests.json" alt="الاختبارات"></a>
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://github.com/MakazhanAlpamys/Soup/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
@@ -139,7 +139,7 @@ soup train
في v0.77؛ فكلا المشروعين الأصليين مؤرشف ولا يُثبَّت أي من الملحقين (extras) إلى جانب
<span dir="ltr">`[train]`</span>.
-> Python **3.10–3.12** فقط. وعلى الإصدار 3.13 وما بعده كان pip يختار حزم PyTorch (wheels) غير مختبرة تنهار في
+> Python **3.11–3.13** فقط. وعلى الإصدار 3.14 وما بعده كان pip يختار حزم PyTorch (wheels) غير مختبرة تنهار في
> الامتداد الأصلي قبل أن يعمل Soup أصلًا.
تجد أبرز ما في الإصدارات الأقدم في صفحة [GitHub Releases](https://github.com/MakazhanAlpamys/Soup/releases).
@@ -351,7 +351,7 @@ docker compose up # أو ابنِ الصورة محليًا
## المتطلبات
-- Python 3.10 أو 3.11 أو 3.12 (هذه هي الإصدارات التي يختبرها CI؛ أما 3.13 وما بعده فغير مدعوم بعد لأن
+- Python 3.11 أو 3.12 أو 3.13 (هذه هي الإصدارات التي يختبرها CI؛ أما 3.14 وما بعده فغير مدعوم بعد لأن
حزمة PyTorch لم يُتحقَّق منها هناك)
- GPU يدعم CUDA (موصى به) أو Apple Silicon (MPS) أو CPU (تجريبي — بطيء جدًا)
- 8 GB فأكثر من VRAM للنماذج بحجم 7B مع QLoRA
diff --git a/README.ja.md b/README.ja.md
index cca573e3..afb0cf1c 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -1,4 +1,4 @@
-<!-- synced-from: README.md sha256:44c28c06ff7d2445391cfcc7cd483b096453a302085ff8ac52cb48fa79ce4da5 -->
+<!-- synced-from: README.md sha256:4675902b8ea66e77e0822a60fdc9d3205a11eb02fb70cdf3b5670bd9ef1af391 -->
<p align="center">🌍 <a href="README.md">English</a> | <a href="README.tr.md">Türkçe</a> | <a href="README.ar.md">العربية</a> | <strong>日本語</strong> | <a href="README.zh.md">中文</a></p>
<p align="center">
@@ -27,7 +27,7 @@
<p align="center">
<a href="https://pypi.org/project/soup-cli/"><img src="https://img.shields.io/pypi/v/soup-cli?color=blue" alt="PyPI"></a>
<a href="https://pepy.tech/project/soup-cli"><img src="https://img.shields.io/pepy/dt/soup-cli?color=blue" alt="ダウンロード数"></a>
- <img src="https://img.shields.io/badge/python-3.10--3.12-blue" alt="Python 3.10-3.12">
+ <img src="https://img.shields.io/badge/python-3.11--3.13-blue" alt="Python 3.11-3.13">
<img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="Apache-2.0 ライセンス">
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/MakazhanAlpamys/65fdc943f85f3b2c46ecddb415c2b779/raw/soup_tests.json" alt="テスト"></a>
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://github.com/MakazhanAlpamys/Soup/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
@@ -138,7 +138,7 @@ LLM の学習は、今でも骨の折れる作業です。経験豊富なチー
- **非推奨:** `soup export --format awq` と `--format gptq` は v0.77 で削除されます。どちらの
上流プロジェクトもアーカイブ済みで、どちらの extra も `[train]` と一緒にはインストールできません。
-> Python は **3.10–3.12** のみ対応です。3.13 以降では、pip がテストされていない PyTorch の wheel を解決し、
+> Python は **3.11–3.13** のみ対応です。3.14 以降では、pip がテストされていない PyTorch の wheel を解決し、
> Soup が動き出す前にネイティブ拡張の中でクラッシュしていました。
過去のハイライトは [GitHub Releases](https://github.com/MakazhanAlpamys/Soup/releases) ページにあります。
@@ -345,8 +345,8 @@ docker compose up # またはローカルでビルド
## 動作要件
-- Python 3.10、3.11、または 3.12(CI がテストしているバージョンです。PyTorch スタックがまだ検証されて
- いないため、3.13 以降は未サポートです)
+- Python 3.11、3.12、または 3.13(CI がテストしているバージョンです。PyTorch スタックがまだ検証されて
+ いないため、3.14 以降は未サポートです)
- CUDA 対応 GPU(推奨)、Apple Silicon(MPS)、または CPU(実験的 — 非常に遅い)
- QLoRA で 7B モデルを扱うには 8 GB 以上の VRAM
diff --git a/README.md b/README.md
index fe3243dd..1ccd8110 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@
<p align="center">
<a href="https://pypi.org/project/soup-cli/"><img src="https://img.shields.io/pypi/v/soup-cli?color=blue" alt="PyPI"></a>
<a href="https://pepy.tech/project/soup-cli"><img src="https://img.shields.io/pepy/dt/soup-cli?color=blue" alt="Downloads"></a>
- <img src="https://img.shields.io/badge/python-3.10--3.12-blue" alt="Python 3.10-3.12">
+ <img src="https://img.shields.io/badge/python-3.11--3.13-blue" alt="Python 3.11-3.13">
<img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="Apache-2.0 License">
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/MakazhanAlpamys/65fdc943f85f3b2c46ecddb415c2b779/raw/soup_tests.json" alt="Tests"></a>
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://github.com/MakazhanAlpamys/Soup/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
@@ -139,8 +139,8 @@ that will refuse them. A config that loaded before can stop loading: run
- **Deprecated:** `soup export --format awq` and `--format gptq` will be removed in v0.77; both
upstream projects are archived and neither extra installs next to `[train]`.
-> Python **3.10–3.12** only. On 3.13+, pip used to resolve untested PyTorch wheels that
-> crash in the native extension before Soup runs at all.
+> From v0.77, Python **3.11–3.13** only: 3.10 reached end of life on 2026-10-01 (pip there stays
+> on v0.76); on 3.14+, pip falls back to v0.72.4 (no upper bound) and untested PyTorch wheels.
Older highlights live on the [GitHub Releases](https://github.com/MakazhanAlpamys/Soup/releases) page.
@@ -347,7 +347,7 @@ docker compose up # or build locally
## Requirements
-- Python 3.10, 3.11 or 3.12 (those are the versions CI tests; 3.13+ is not supported yet
+- Python 3.11, 3.12 or 3.13 (those are the versions CI tests; 3.14+ is not supported yet
because the PyTorch stack has not been validated there)
- GPU with CUDA (recommended), Apple Silicon (MPS), or CPU (experimental — very slow)
- 8 GB+ VRAM for 7B models with QLoRA
diff --git a/README.tr.md b/README.tr.md
index 02d8f578..9539f755 100644
--- a/README.tr.md
+++ b/README.tr.md
@@ -1,4 +1,4 @@
-<!-- synced-from: README.md sha256:44c28c06ff7d2445391cfcc7cd483b096453a302085ff8ac52cb48fa79ce4da5 -->
+<!-- synced-from: README.md sha256:4675902b8ea66e77e0822a60fdc9d3205a11eb02fb70cdf3b5670bd9ef1af391 -->
<p align="center">🌍 <a href="README.md">English</a> | <strong>Türkçe</strong> | <a href="README.ar.md">العربية</a> | <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a></p>
<p align="center">
@@ -27,7 +27,7 @@
<p align="center">
<a href="https://pypi.org/project/soup-cli/"><img src="https://img.shields.io/pypi/v/soup-cli?color=blue" alt="PyPI"></a>
<a href="https://pepy.tech/project/soup-cli"><img src="https://img.shields.io/pepy/dt/soup-cli?color=blue" alt="İndirmeler"></a>
- <img src="https://img.shields.io/badge/python-3.10--3.12-blue" alt="Python 3.10-3.12">
+ <img src="https://img.shields.io/badge/python-3.11--3.13-blue" alt="Python 3.11-3.13">
<img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="Apache-2.0 Lisansı">
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/MakazhanAlpamys/65fdc943f85f3b2c46ecddb415c2b779/raw/soup_tests.json" alt="Testler"></a>
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://github.com/MakazhanAlpamys/Soup/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
@@ -141,8 +141,10 @@ veriyor ve onları reddedecek sürümü belirtiyor. Daha önce yüklenen bir yap
- **Kullanımdan kaldırıldı:** `soup export --format awq` ve `--format gptq` v0.77'de kaldırılacak; her
iki üst proje de arşivlenmiş durumda ve ekstralardan hiçbiri `[train]` ile yan yana kurulamıyor.
-> Yalnızca Python **3.10–3.12**. 3.13+ sürümlerinde pip, Soup daha hiç çalışmadan yerel (native)
-> uzantıda çöken, test edilmemiş PyTorch wheel paketlerini seçiyordu.
+> v0.77'den itibaren yalnızca Python **3.11–3.13**. Python 3.10, 2026-10-01'de kullanım ömrünün
+> sonuna (end of life) ulaştı; 3.10 üzerinde pip v0.76'yı kurmaya devam eder. 3.14+ sürümlerinde
+> pip, üst sınırı olmayan son sürüm olan v0.72.4'e geri döner ve orada test edilmemiş PyTorch
+> wheel paketlerini seçer.
Eski sürümlerin öne çıkanları [GitHub Releases](https://github.com/MakazhanAlpamys/Soup/releases) sayfasında.
@@ -350,8 +352,8 @@ docker compose up # ya da yerel olarak derleyin
## Gereksinimler
-- Python 3.10, 3.11 veya 3.12 (CI'ın test ettiği sürümler bunlar; PyTorch yığını orada henüz
- doğrulanmadığı için 3.13+ şimdilik desteklenmiyor)
+- Python 3.11, 3.12 veya 3.13 (CI'ın test ettiği sürümler bunlar; PyTorch yığını orada henüz
+ doğrulanmadığı için 3.14+ şimdilik desteklenmiyor)
- CUDA'lı GPU (önerilen), Apple Silicon (MPS) veya CPU (deneysel — çok yavaş)
- QLoRA ile 7B modeller için 8 GB+ VRAM
diff --git a/README.zh.md b/README.zh.md
index cd946d99..7d3bba9a 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -1,4 +1,4 @@
-<!-- synced-from: README.md sha256:44c28c06ff7d2445391cfcc7cd483b096453a302085ff8ac52cb48fa79ce4da5 -->
+<!-- synced-from: README.md sha256:4675902b8ea66e77e0822a60fdc9d3205a11eb02fb70cdf3b5670bd9ef1af391 -->
<p align="center">🌍 <a href="README.md">English</a> | <a href="README.tr.md">Türkçe</a> | <a href="README.ar.md">العربية</a> | <a href="README.ja.md">日本語</a> | <strong>中文</strong></p>
<p align="center">
@@ -27,7 +27,7 @@
<p align="center">
<a href="https://pypi.org/project/soup-cli/"><img src="https://img.shields.io/pypi/v/soup-cli?color=blue" alt="PyPI"></a>
<a href="https://pepy.tech/project/soup-cli"><img src="https://img.shields.io/pepy/dt/soup-cli?color=blue" alt="下载量"></a>
- <img src="https://img.shields.io/badge/python-3.10--3.12-blue" alt="Python 3.10-3.12">
+ <img src="https://img.shields.io/badge/python-3.11--3.13-blue" alt="Python 3.11-3.13">
<img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="Apache-2.0 许可证">
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/MakazhanAlpamys/65fdc943f85f3b2c46ecddb415c2b779/raw/soup_tests.json" alt="测试"></a>
<a href="https://github.com/MakazhanAlpamys/Soup/actions"><img src="https://github.com/MakazhanAlpamys/Soup/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
@@ -134,7 +134,7 @@ NF4 达到 **952 MHz 下 119.6 tok/s,峰值 3.32 GB**(修复前)——与
- **已弃用:** `soup export --format awq` 和 `--format gptq` 将在 v0.77 移除;这两个上游项目都已归档,
两个 extra 也都无法与 `[train]` 一起安装。
-> 仅支持 Python **3.10–3.12**。在 3.13+ 上,pip 过去会解析到未测试过的 PyTorch
+> 仅支持 Python **3.11–3.13**。在 3.14+ 上,pip 过去会解析到未测试过的 PyTorch
> wheel,在 Soup 运行之前就崩在原生扩展里。
更早的更新记录在 [GitHub Releases](https://github.com/MakazhanAlpamys/Soup/releases) 页面。
@@ -339,7 +339,7 @@ docker compose up # 或在本地构建
## 环境要求
-- Python 3.10、3.11 或 3.12(这是 CI 测试的版本;3.13+ 暂不支持,因为 PyTorch
+- Python 3.11、3.12 或 3.13(这是 CI 测试的版本;3.14+ 暂不支持,因为 PyTorch
技术栈还没在那上面验证过)
- 带 CUDA 的 GPU(推荐)、Apple Silicon(MPS)、或 CPU(实验性——非常慢)
- 7B 模型跑 QLoRA 需要 8 GB+ 显存
diff --git a/changelog.d/0.76.0/2089.removed.md b/changelog.d/0.76.0/2089.removed.md
new file mode 100644
index 00000000..80aaf860
--- /dev/null
+++ b/changelog.d/0.76.0/2089.removed.md
@@ -0,0 +1 @@
+- **Breaking: Python 3.10 is no longer supported (#1805, in #2089).** From 0.77 the package declares `requires-python = ">=3.11,<3.14"` (it was `">=3.10,<3.13"`): Python 3.10 reached end of life on 2026-10-01, and pip on 3.10 keeps installing 0.76. Python 3.13 is now supported and tested in CI, on Ubuntu, Windows and macOS in every nightly and release run; pull-request runs stay on 3.11 and 3.12.
diff --git a/docs/models.md b/docs/models.md
index 99a87bc1..5faa926e 100644
--- a/docs/models.md
+++ b/docs/models.md
@@ -102,11 +102,13 @@ Rows are `{"audio": <path>, "text": <transcript>}` with `data.format: asr`. See
## Optional Extras
-> **Python 3.10, 3.11 or 3.12.** Since v0.73.0 the package declares
-> `requires-python = ">=3.10,<3.13"`. Those are exactly the versions CI tests. Without the
-> upper bound, pip on 3.13+ resolved PyTorch wheels nobody had validated, and the failure was
-> not a Soup error message — it was a loader crash inside `c10.dll` / `libc10.so` before any
-> Soup code ran. If you are on 3.13+, create a 3.12 environment; support widens when CI does.
+> **Python 3.11, 3.12 or 3.13.** Since v0.77 the package declares
+> `requires-python = ">=3.11,<3.14"` (v0.73.0 to v0.76: `">=3.10,<3.13"`). Those are exactly
+> the versions CI tests. Python 3.10 reached end of life on 2026-10-01; on it, pip keeps
+> installing v0.76. Without the upper bound, pip on an untested Python resolved PyTorch wheels
+> nobody had validated, and the failure was not a Soup error message — it was a loader crash
+> inside `c10.dll` / `libc10.so` before any Soup code ran. If you are on 3.14+, create a 3.13
+> environment; support widens when CI does.
### Quoting the extra
diff --git a/notebooks/proof-4gb.ipynb b/notebooks/proof-4gb.ipynb
index c0631021..f084ec80 100644
--- a/notebooks/proof-4gb.ipynb
+++ b/notebooks/proof-4gb.ipynb
@@ -51,7 +51,7 @@
"Nothing here needs torchao, so it is removed rather than upgraded (upgrading risks\n",
"pulling a wheel built against a different torch).\n",
"\n",
- "**Colab's default Python can be newer than this project supports.** `soup-cli` caps at `<3.13` on purpose (untested torch/bitsandbytes wheels on newer interpreters fail with an opaque loader crash, not a clean error). Colab's hosted runtime does not let you pick an arbitrary kernel the way local Jupyter does, so if you land on Python 3.13+, the next cell falls back to installing with `--ignore-requires-python` — that trades the guarantee for a best-effort install, on the assumption that the `[train]` extras (torch,\n",
+ "**Colab's default Python can be newer than the pinned release supports.** `soup-cli==0.75.0` declares `>=3.10,<3.13` on purpose (untested torch/bitsandbytes wheels on newer interpreters fail with an opaque loader crash, not a clean error). Soup itself supports 3.11–3.13 from v0.77 (#1805), so the fallback below goes away when the pin moves to v0.77 or later. Colab's hosted runtime does not let you pick an arbitrary kernel the way local Jupyter does, so if you land on Python 3.13+, the next cell falls back to installing with `--ignore-requires-python` — that trades the guarantee for a best-effort install, on the assumption that the `[train]` extras (torch,\n",
"transformers, peft, bitsandbytes, accelerate) have caught up with a 3.13 wheel by the time you are reading this. If anything below fails with an import or ABI error, that assumption did not hold on this Colab image; open an issue with the\n",
"traceback rather than treating it as this notebook's bug.\n"
]
@@ -80,6 +80,9 @@
"source": [
"import sys\n",
"\n",
+ "# The window of the PINNED release (soup-cli 0.75.0 declares >=3.10,<3.13), not of\n",
+ "# Soup today: v0.77 and later declare >=3.11,<3.14 (#1805). Re-derive both bounds\n",
+ "# when the pin below moves.\n",
"PY_OK = sys.version_info < (3, 13)\n",
"print(f\"Colab Python: {sys.version.split()[0]} (soup-cli supports <3.13)\")\n",
"if not PY_OK:\n",
@@ -124,14 +127,17 @@
"\n",
"import sys\n",
"\n",
+ "# Only the pinned 0.75.0 needs this on 3.13; drop it with the pin (see section 1).\n",
"_extra_flag = \"--ignore-requires-python\" if sys.version_info >= (3, 13) else \"\"\n",
- "# huggingface-hub>=1.32 keeps blobs in a cache-wide store that soup-cli 0.75.0 refuses (#1509); drop this cap when the notebook re-pins to a release that carries the fix.\n",
+ "# huggingface-hub>=1.32 keeps blobs in a cache-wide store that soup-cli 0.75.0\n",
+ "# refuses (#1509); drop this cap when the notebook re-pins to a release that\n",
+ "# carries the fix.\n",
"%pip install -q \"huggingface-hub<1.32.0\" \"soup-cli[train]==0.75.0\" {_extra_flag}\n",
"\n",
- "import importlib.util\n",
+ "import importlib.util # noqa: E402 (after %pip install)\n",
"\n",
- "import soup_cli\n",
- "import soup_cli.utils.gpu\n",
+ "import soup_cli # noqa: E402\n",
+ "import soup_cli.utils.gpu # noqa: E402\n",
"\n",
"print(\"soup\", soup_cli.__version__)\n",
"print(\"pre-Ampere fix present:\", hasattr(soup_cli.utils.gpu, \"bf16_fp16_flags\"))\n",
diff --git a/pyproject.toml b/pyproject.toml
index d3b38478..964c18c1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,13 +11,14 @@ license = "Apache-2.0"
# Explicit, so the files that ship do not depend on hatchling's default globs (#1677).
# An explicit list replaces the default: a file added later must be named here too.
license-files = ["LICENSE", "NOTICE"]
-# Upper-bounded on purpose (#358). CI tests 3.10 / 3.11 / 3.12 and nothing above.
-# Without a ceiling, pip on 3.13+ resolves torch wheels nobody here has run, and
+# Upper-bounded on purpose (#358). CI tests 3.11 / 3.12 / 3.13 and nothing above;
+# 3.10 left with #1805 (end of life on 2026-10-01), when 3.13 joined.
+# Without a ceiling, pip on 3.14+ resolves torch wheels nobody here has run, and
# the failure is not a Soup error message — it is a loader crash inside c10.dll /
# libc10.so before any Soup code executes, so the user has nothing to act on.
# `tests/test_requires_python_bound.py` derives this bound from the CI matrix, so
# widening one without the other fails the suite.
-requires-python = ">=3.10,<3.13"
+requires-python = ">=3.11,<3.14"
authors = [
{ name = "Makazhan Alpamys and the Soup contributors", email = "[email protected]" },
]
@@ -274,7 +275,7 @@ artifacts = [
]
[tool.ruff]
-target-version = "py310"
+target-version = "py311"
line-length = 100
[tool.ruff.lint]
@@ -285,7 +286,7 @@ select = ["E", "F", "I", "N", "W"]
# none of which ship complete stubs. This config surfaces type issues in our own
# code without drowning in third-party `Any`s. The CI `type-check` job is
# non-blocking; tighten incrementally as modules gain annotations.
-python_version = "3.10"
+python_version = "3.11"
files = ["src/soup_cli"]
ignore_missing_imports = true
follow_imports = "silent"
diff --git a/scripts/sync_recipe_count.py b/scripts/sync_recipe_count.py
index 9786383f..9041fd7e 100644
--- a/scripts/sync_recipe_count.py
+++ b/scripts/sync_recipe_count.py
@@ -147,7 +147,7 @@ def apply_changes(
one-number edit arrives as a whole-file diff. Bytes translate nothing, so
a run touches exactly the characters it means to.
(``Path.read_text(newline=...)`` would say this more directly but only
- exists on 3.13+, and this project supports 3.10.)
+ exists on 3.13+, and this project supports 3.11 and 3.12 too.)
"""
resolved_sites = _resolve_sites(sites)
diff --git a/src/soup_cli/config/unknown_keys.py b/src/soup_cli/config/unknown_keys.py
index abf4691c..18fb1a89 100644
--- a/src/soup_cli/config/unknown_keys.py
+++ b/src/soup_cli/config/unknown_keys.py
@@ -112,8 +112,9 @@ def _nested_models(model: type[pydantic.BaseModel], field: str) -> list[type]:
# must be filtered before issubclass: on Python 3.10 a GenericAlias
# like list[str] passes isinstance(c, type) and then raises
# TypeError from issubclass (3.11 made isinstance return False).
- # The repo supports 3.10, and any walk of a full model_dump() — what
- # sweep's pre-flight feeds this — visits list[...]/dict[...] fields.
+ # Kept from when the floor was 3.10 (3.11 since #1805): any walk of a full
+ # model_dump() — what sweep's pre-flight feeds this — visits list[...] and
+ # dict[...] fields.
if isinstance(c, type)
and typing.get_origin(c) is None
and issubclass(c, pydantic.BaseModel)
diff --git a/src/soup_cli/utils/best_of_n_artifact.py b/src/soup_cli/utils/best_of_n_artifact.py
index 64189d0f..842da9cb 100644
--- a/src/soup_cli/utils/best_of_n_artifact.py
+++ b/src/soup_cli/utils/best_of_n_artifact.py
@@ -120,6 +120,9 @@ def _validate_sampler(sampler: Any) -> dict:
or len(model) > 256
or os.path.isabs(model)
or ntpath.isabs(model)
+ # By name, not only through isabs: Python 3.13 no longer calls a rooted path
+ # without a drive ("/x", "\x") absolute on Windows, and 3.11-3.12 do.
+ or model.startswith(("/", "\\"))
or "\\" in model
or model.startswith(("./", "../", "~/"))
):
@@ -154,6 +157,8 @@ def _validate_sampler(sampler: Any) -> dict:
or len(revision) > 256
or os.path.isabs(revision)
or ntpath.isabs(revision)
+ # As for the model: a rooted path without a drive is not absolute on 3.13.
+ or revision.startswith(("/", "\\"))
or "\\" in revision
or revision.startswith(("./", "../", "~/"))
):
diff --git a/src/soup_cli/utils/env_lock.py b/src/soup_cli/utils/env_lock.py
index 0f2e0e36..335e2947 100644
--- a/src/soup_cli/utils/env_lock.py
+++ b/src/soup_cli/utils/env_lock.py
@@ -340,7 +340,7 @@ def current_declared_bounds_check(dist_name: str = _SELF_DIST) -> BoundsCheck:
tightened in ``pyproject.toml`` is only enforced here after a reinstall —
#368 review.
"""
- # `requires-python = ">=3.10"`, so `importlib.metadata` is always importable
+ # `requires-python = ">=3.11"`, so `importlib.metadata` is always importable
# here; guarding it would be an unreachable branch that silently reports
# clean (#368 review).
from importlib.metadata import PackageNotFoundError, requires
diff --git a/src/soup_cli/utils/quest.py b/src/soup_cli/utils/quest.py
index f3ec72bc..9741c941 100644
--- a/src/soup_cli/utils/quest.py
+++ b/src/soup_cli/utils/quest.py
@@ -775,7 +775,14 @@ def validate_metadata(metadata: Any) -> dict[str, Any]:
value = base_model[len(LOCAL_BASE_PREFIX) :]
if len(value) != 64 or any(character not in "0123456789abcdef" for character in value):
raise ValueError("Invalid QuEST local base_model digest")
- elif posixpath.isabs(base_model) or ntpath.isabs(base_model) or base_model.startswith("."):
+ elif (
+ posixpath.isabs(base_model)
+ or ntpath.isabs(base_model)
+ # By name, not only through isabs: Python 3.13's ntpath.isabs no longer calls a
+ # rooted path without a drive ("\x") absolute, and 3.11-3.12 do.
+ or base_model.startswith(("/", "\\"))
+ or base_model.startswith(".")
+ ):
raise ValueError("QuEST v2 base_model must not contain a local path")
if metadata["group_size"] != GROUP_SIZE or metadata["weight_bits"] != WEIGHT_BITS:
raise ValueError("Invalid QuEST W4 group declaration")
diff --git a/src/soup_cli/utils/stripe_roots.py b/src/soup_cli/utils/stripe_roots.py
index 2b94c9db..2e54790c 100644
--- a/src/soup_cli/utils/stripe_roots.py
+++ b/src/soup_cli/utils/stripe_roots.py
@@ -184,10 +184,12 @@ def check_stripe_root(
"letter or UNC share"
)
expanded = os.path.expanduser(entry)
+ # Checked before isabs: Python 3.13 no longer calls a rooted path without a drive
+ # ("\data", "/data") absolute on Windows, and 3.11-3.12 do; the message is the same on all.
+ if os.name == "nt" and expanded[:1] in ("\\", "/") and not os.path.splitdrive(expanded)[0]:
+ return None, "must name a drive letter or a UNC share"
if not os.path.isabs(expanded):
return None, "must be an absolute path"
- if os.name == "nt" and not os.path.splitdrive(expanded)[0]:
- return None, "must name a drive letter or a UNC share"
if os.path.islink(expanded):
return None, "must not be a symlink"
if os.name == "nt":
diff --git a/tests/test_ci_docs_only_fast_path.py b/tests/test_ci_docs_only_fast_path.py
index ee0e29ff..676f3853 100644
--- a/tests/test_ci_docs_only_fast_path.py
+++ b/tests/test_ci_docs_only_fast_path.py
@@ -445,7 +445,7 @@ class TestTheTestCellsSkipOnlyInADocsOnlyRun:
]
assert sorted(f"{cell['os']} {cell['python-version']}" for cell in idle) == [
"macos-latest 3.12",
- "ubuntu-latest 3.10",
+ "ubuntu-latest 3.11",
"windows-latest 3.12",
]
@@ -463,7 +463,7 @@ class TestTheTestCellsSkipOnlyInADocsOnlyRun:
def test_the_coverage_cell_and_the_badge_step_never_run_in_a_docs_only_run(self) -> None:
"""No coverage report exists to upload when the cell that measures it did nothing."""
- coverage_cell = {"os": "ubuntu-latest", "python-version": "3.10"}
+ coverage_cell = {"os": "ubuntu-latest", "python-version": "3.11"}
assert "Upload coverage to Codecov" not in _steps_that_run(coverage_cell, "true")
assert "Upload coverage to Codecov" in _steps_that_run(coverage_cell, "false")
diff --git a/tests/test_ci_full_matrix_on_approval.py b/tests/test_ci_full_matrix_on_approval.py
index df81104c..65b9f5e0 100644
--- a/tests/test_ci_full_matrix_on_approval.py
+++ b/tests/test_ci_full_matrix_on_approval.py
@@ -9,9 +9,11 @@ four matrices by event:
-- the release checklist needs all of them green on the tagged commit;
* FULL, the same minus Windows and macOS on 3.11, for the nightly run on ``main``
and a manual dispatch;
-* APPROVAL, the four cells branch protection requires (the oldest and the newest
- Python on ubuntu, the newest on Windows and macOS), for pull requests a
- maintainer has labelled ``ci:full``;
+* APPROVAL, the four cells branch protection requires (the oldest Python and the
+ newest one a pull request runs on ubuntu, that newest on Windows and macOS), for
+ pull requests a maintainer has labelled ``ci:full``. Since #1805 the support
+ matrix also lists 3.13, which FULL and RELEASE run on every OS and no
+ pull-request run does;
* QUICK, ``test (ubuntu-latest, 3.12)`` alone, for a push to ``main`` and for any
other pull-request run.
@@ -86,8 +88,12 @@ PR_SKIP = "github.event_name != 'pull_request'"
#: The support matrix: what RELEASE runs, and what requires-python must match.
SUPPORT_MATRIX = {
"os": ["ubuntu-latest", "windows-latest", "macos-latest"],
- "python-version": ["3.10", "3.11", "3.12"],
+ "python-version": ["3.11", "3.12", "3.13"],
}
+#: The Pythons of the support matrix that no pull-request run tests (#1805, 2026-10-21):
+#: 3.13 runs on every OS in FULL and RELEASE, and QUICK and APPROVAL stay on 3.12, so a new
+#: interpreter cannot turn every open pull request red at once. Only the newest may be here.
+NIGHTLY_ONLY_PYTHONS = ("3.13",)
#: What FULL leaves out of it. 3.11 still runs on ubuntu in every full run.
FULL_EXCLUDE = (
{"os": "windows-latest", "python-version": "3.11"},
@@ -95,8 +101,8 @@ FULL_EXCLUDE = (
)
#: What APPROVAL leaves out of its two Pythons: the oldest runs on ubuntu only.
APPROVAL_EXCLUDE = (
- {"os": "windows-latest", "python-version": "3.10"},
- {"os": "macos-latest", "python-version": "3.10"},
+ {"os": "windows-latest", "python-version": "3.11"},
+ {"os": "macos-latest", "python-version": "3.11"},
)
QUICK_MATRIX = {"os": ["ubuntu-latest"], "python-version": ["3.12"]}
#: The four ``test`` contexts a merge waits on: what APPROVAL runs, and what branch
@@ -105,9 +111,11 @@ QUICK_MATRIX = {"os": ["ubuntu-latest"], "python-version": ["3.12"]}
#: repos/MakazhanAlpamys/Soup/branches/main/protection``, it still listed the seven
#: cells of FULL; the three in NIGHTLY_ONLY_CONTEXTS come off it right after this
#: change merges, never before. A cell named any other way is a context nobody waits on.
+#: #1805 (2026-10-21) swapped ``test (ubuntu-latest, 3.10)`` for ``test (ubuntu-latest,
+#: 3.11)``: branch protection swaps them when it merges.
REQUIRED_TEST_CONTEXTS = frozenset(
{
- "test (ubuntu-latest, 3.10)",
+ "test (ubuntu-latest, 3.11)",
"test (ubuntu-latest, 3.12)",
"test (windows-latest, 3.12)",
"test (macos-latest, 3.12)",
@@ -117,9 +125,9 @@ REQUIRED_TEST_CONTEXTS = frozenset(
#: failure that exists on one of them alone shows on ``main`` the next night.
NIGHTLY_ONLY_CONTEXTS = frozenset(
{
- "test (ubuntu-latest, 3.11)",
- "test (windows-latest, 3.10)",
- "test (macos-latest, 3.10)",
+ "test (ubuntu-latest, 3.13)",
+ "test (windows-latest, 3.13)",
+ "test (macos-latest, 3.13)",
}
)
#: The two cells only a push to ``release/**`` runs. Not required, so not a merge gate.
@@ -228,6 +236,15 @@ def _version(text: str) -> tuple[int, ...]:
return tuple(int(part) for part in text.split("."))
+def _gated_pythons() -> list[str]:
+ """The support matrix's Pythons that a pull-request run may test."""
+ return [
+ python
+ for python in SUPPORT_MATRIX["python-version"]
+ if python not in NIGHTLY_ONLY_PYTHONS
+ ]
+
+
# --- A small evaluator for the GitHub expressions these tests need -----------
#
# It covers exactly what ci.yml's concurrency key and the plan decision use:
@@ -710,7 +727,7 @@ class TestMatrix:
# such as {"python-version": "3.11"} would drop the ubuntu cell too).
assert _cells(_matrix("RELEASE_MATRIX")) - _cells(full) == RELEASE_ONLY_CONTEXTS
- def test_approval_is_the_oldest_and_newest_python_with_the_oldest_on_ubuntu_only(self):
+ def test_approval_is_the_oldest_and_newest_gated_python_with_the_oldest_on_ubuntu_only(self):
approval = _matrix("APPROVAL_MATRIX")
assert list(approval) == ["os", "python-version", "exclude"], (
"the key order names the checks"
@@ -719,10 +736,28 @@ class TestMatrix:
pythons = SUPPORT_MATRIX["python-version"]
assert approval["python-version"] == [
min(pythons, key=_version),
- max(pythons, key=_version),
+ max(_gated_pythons(), key=_version),
]
assert _rules(approval["exclude"]) == _rules(APPROVAL_EXCLUDE)
+ def test_the_nightly_only_python_is_the_newest_and_runs_on_every_os_each_night(self):
+ """#1805: 3.13 joined the support matrix without joining the pull-request gate. That
+ holds only while every nightly run tests it on every OS, and only for the newest
+ Python: an ungated floor would let a pull request break the oldest one unseen."""
+ gated = _gated_pythons()
+ assert gated, "no Python is left for a pull-request run to test"
+ assert set(NIGHTLY_ONLY_PYTHONS) <= set(SUPPORT_MATRIX["python-version"])
+ for python in NIGHTLY_ONLY_PYTHONS:
+ assert _version(python) > max(_version(each) for each in gated), python
+ nightly = {
+ cell["os"]
+ for cell in _cell_dicts(_matrix("FULL_MATRIX"))
+ if cell["python-version"] == python
+ }
+ assert nightly == set(SUPPORT_MATRIX["os"]), (python, nightly)
+ for name in ("APPROVAL_MATRIX", "QUICK_MATRIX"):
+ assert python not in _matrix(name)["python-version"], (name, python)
+
def test_approval_names_exactly_the_required_test_contexts(self):
assert _cells(_matrix("APPROVAL_MATRIX")) == REQUIRED_TEST_CONTEXTS
@@ -734,14 +769,13 @@ class TestMatrix:
REQUIRED_TEST_CONTEXTS | NIGHTLY_ONLY_CONTEXTS | RELEASE_ONLY_CONTEXTS
)
- def test_the_quick_matrix_is_the_newest_python_on_ubuntu(self):
+ def test_the_quick_matrix_is_the_newest_gated_python_on_ubuntu(self):
quick = _matrix("QUICK_MATRIX")
assert quick == QUICK_MATRIX
assert list(quick) == ["os", "python-version"]
names = _cells(quick)
assert len(names) == 1 and names <= REQUIRED_TEST_CONTEXTS
- support_pythons = SUPPORT_MATRIX["python-version"]
- assert quick["python-version"] == [max(support_pythons, key=_version)]
+ assert quick["python-version"] == [max(_gated_pythons(), key=_version)]
@pytest.mark.parametrize("name", MATRIX_NAMES)
def test_the_matrix_literals_are_single_lines(self, name):
@@ -1498,8 +1532,9 @@ class TestCoverageUpload:
COVERAGE_STEP = "Run unit tests with coverage"
NO_COVERAGE_STEP = "Run unit tests without coverage"
-#: The one cell that measures coverage, enforces the floor and uploads the report.
-COVERAGE_CELL = {"os": "ubuntu-latest", "python-version": "3.10"}
+#: The one cell that measures coverage, enforces the floor and uploads the report: ubuntu on
+#: the oldest supported Python (3.10 until #1805).
+COVERAGE_CELL = {"os": "ubuntu-latest", "python-version": "3.11"}
ALL_MATRICES = ("RELEASE_MATRIX", "FULL_MATRIX", "APPROVAL_MATRIX", "QUICK_MATRIX")
@@ -1519,8 +1554,9 @@ def _cells_running(step: dict[str, Any], matrix: str) -> list[dict[str, str]]:
class TestCoverageIsMeasuredInOneCell:
- """2026-10-19: coverage is measured in ubuntu / 3.10 only, the cell that uploads it. The
- floor is enforced there; every other cell runs the suite with `--no-cov`."""
+ """2026-10-19: coverage is measured in ubuntu / 3.11 only (3.10 until #1805), the cell
+ that uploads it. The floor is enforced there; every other cell runs the suite with
+ `--no-cov`."""
@pytest.mark.parametrize("matrix", ("RELEASE_MATRIX", "FULL_MATRIX", "APPROVAL_MATRIX"))
def test_every_gated_run_measures_coverage_in_exactly_the_uploading_cell(self, matrix):
@@ -1528,7 +1564,7 @@ class TestCoverageIsMeasuredInOneCell:
assert _cells_running(_test_step("Upload coverage to Codecov"), matrix) == [COVERAGE_CELL]
def test_a_quick_run_measures_no_coverage_and_so_does_not_check_the_floor(self):
- """Known and accepted: the quick run has no ubuntu / 3.10 cell. The approval run a
+ """Known and accepted: the quick run has no ubuntu / 3.11 cell. The approval run a
merge waits for has it, and so does the nightly run."""
assert _cells_running(_test_step(COVERAGE_STEP), "QUICK_MATRIX") == []
@@ -1565,8 +1601,9 @@ class TestCoverageIsMeasuredInOneCell:
@pytest.mark.parametrize("step", (COVERAGE_STEP, NO_COVERAGE_STEP))
def test_both_steps_still_write_what_later_steps_read(self, step):
- """The nightly test-count badge reads report.xml from ubuntu / 3.11, a cell that now
- runs the unmeasured step: `--junitxml` must not be left to the measuring one."""
+ """The nightly test-count badge reads report.xml from ubuntu / 3.11, which runs the
+ measuring step since #1805 and ran the unmeasured one before: `--junitxml` stays in
+ both, so moving the badge or the coverage cell cannot leave it without a report."""
args = shlex.split(str(_test_step(step)["run"]))
assert "--junitxml=report.xml" in args, step
diff --git a/tests/test_ci_pinned_upstream.py b/tests/test_ci_pinned_upstream.py
index 5fb5bf92..d1467576 100644
--- a/tests/test_ci_pinned_upstream.py
+++ b/tests/test_ci_pinned_upstream.py
@@ -21,8 +21,8 @@ event, through the step's own shell. This file pins the constraints file itself:
workflows) -- outside one, ``pip`` cannot resolve the cell at all, so a pull request
that moves a bound moves the pin with it. An extra no pinned job installs is not read.
-``pyproject.toml`` is read with regular expressions, not ``tomllib``, which is 3.11+ while
-this repository supports 3.10: the convention of ``tests/test_requires_python_bound.py``.
+``pyproject.toml`` is read with regular expressions, not ``tomllib``: the convention of
+``tests/test_requires_python_bound.py``, set while the floor was 3.10, which has no ``tomllib``.
"""
from __future__ import annotations
diff --git a/tests/test_ci_pip_download_cache.py b/tests/test_ci_pip_download_cache.py
index 73dd65c5..ce53efd9 100644
--- a/tests/test_ci_pip_download_cache.py
+++ b/tests/test_ci_pip_download_cache.py
@@ -51,15 +51,15 @@ RUN_KINDS = (
# Literal outcomes over the entire supported 3x3 matrix, independent of the policy
# expression and of which cells a particular workflow kind currently selects: none caches.
SUPPORT_CELLS = (
- ("ubuntu-latest", "Linux", "3.10"),
("ubuntu-latest", "Linux", "3.11"),
("ubuntu-latest", "Linux", "3.12"),
- ("windows-latest", "Windows", "3.10"),
+ ("ubuntu-latest", "Linux", "3.13"),
("windows-latest", "Windows", "3.11"),
("windows-latest", "Windows", "3.12"),
- ("macos-latest", "macOS", "3.10"),
+ ("windows-latest", "Windows", "3.13"),
("macos-latest", "macOS", "3.11"),
("macos-latest", "macOS", "3.12"),
+ ("macos-latest", "macOS", "3.13"),
)
RUNNER_OS = {"ubuntu-latest": "Linux", "windows-latest": "Windows", "macos-latest": "macOS"}
diff --git a/tests/test_ci_test_cells_run_in_parallel.py b/tests/test_ci_test_cells_run_in_parallel.py
index c4341dc5..7f8e1cc9 100644
--- a/tests/test_ci_test_cells_run_in_parallel.py
+++ b/tests/test_ci_test_cells_run_in_parallel.py
@@ -9,8 +9,8 @@ clean:
* `-n logical` with the plugin's `psutil` extra installed, which is what counts the CPUs;
* nothing in `pyproject.toml` turns workers on, so a local `pytest tests/` stays serial.
-pyproject is read with regular expressions, not ``tomllib``, which is 3.11+ while this
-repository supports 3.10: the convention of ``tests/test_requires_python_bound.py``.
+pyproject is read with regular expressions, not ``tomllib``: the convention of
+``tests/test_requires_python_bound.py``, set while the floor was 3.10, which has no ``tomllib``.
"""
from __future__ import annotations
@@ -29,9 +29,10 @@ PYPROJECT = ROOT / "pyproject.toml"
CONTRIBUTING = ROOT / "CONTRIBUTING.md"
RUN_STEP = "Run unit tests with coverage"
-# 2026-10-19: every cell but ubuntu / 3.10 runs this one, with `--no-cov`. Coverage is
-# measured in one cell (tests/test_ci_full_matrix_on_approval.py::TestCoverageIsMeasuredInOneCell);
-# the parallelism pins below hold for both steps, because most cells now run the second.
+# 2026-10-19: every cell but ubuntu / 3.11 (3.10 until #1805) runs this one, with
+# `--no-cov`. Coverage is measured in one cell
+# (tests/test_ci_full_matrix_on_approval.py::TestCoverageIsMeasuredInOneCell); the
+# parallelism pins below hold for both steps, because most cells now run the second.
NO_COV_STEP = "Run unit tests without coverage"
RUN_STEPS = (RUN_STEP, NO_COV_STEP)
INSTALL_STEP = "Install dependencies"
diff --git a/tests/test_click_argument_help.py b/tests/test_click_argument_help.py
index 1bb7a86f..4a423be1 100644
--- a/tests/test_click_argument_help.py
+++ b/tests/test_click_argument_help.py
@@ -16,8 +16,8 @@ environment that resolved click 8.5 (whatever the cause), and the declaration te
fails when the pin is removed from ``pyproject.toml`` even on an environment that
happens to hold a good click.
-``pyproject.toml`` is parsed with a regex, not ``tomllib``: ``tomllib`` is 3.11+ and
-this repo supports 3.10 (the convention of ``tests/test_issue636_torch_floor.py``).
+``pyproject.toml`` is parsed with a regex, not ``tomllib`` (the convention of
+``tests/test_issue636_torch_floor.py``, set while the floor was 3.10, which has no ``tomllib``).
Before widening the bound, check that ``soup adapters check --help`` still shows its
description with the newest click and the newest typer Soup allows.
"""
diff --git a/tests/test_disk_tier_stripe_roots.py b/tests/test_disk_tier_stripe_roots.py
index b20eb1a0..a83948c7 100644
--- a/tests/test_disk_tier_stripe_roots.py
+++ b/tests/test_disk_tier_stripe_roots.py
@@ -85,12 +85,13 @@ class TestOneEntry:
validate_stripe_root(stripe + char, primary_root=primary)
@pytest.mark.skipif(os.name != "nt", reason="Windows drive-relative spelling")
- def test_a_path_without_a_drive_is_refused_on_windows(self, layout):
+ @pytest.mark.parametrize("separator", ["\\", "/"], ids=["backslash", "slash"])
+ def test_a_path_without_a_drive_is_refused_on_windows(self, layout, separator):
"""Security LOW-6: os.path.isabs on a path that starts with a separator but names no
- drive is True on 3.10-3.12, and the recorded root would then depend on the drive of
- the current directory."""
+ drive is True on 3.10-3.12 (False on 3.13), and the recorded root would then depend on
+ the drive of the current directory. Same message on every version."""
primary, stripe = layout
- no_drive = os.path.splitdrive(os.path.realpath(stripe))[1]
+ no_drive = os.path.splitdrive(os.path.realpath(stripe))[1].replace("\\", separator)
with pytest.raises(StripeRootError, match="must name a drive letter or a UNC share"):
validate_stripe_root(no_drive, primary_root=primary)
diff --git a/tests/test_gen_reference_docs.py b/tests/test_gen_reference_docs.py
index 5a0abd25..b35ad4f1 100644
--- a/tests/test_gen_reference_docs.py
+++ b/tests/test_gen_reference_docs.py
@@ -7,7 +7,7 @@ Four things are held here.
parameters. Wording is NOT compared, on purpose: a pull request that rewords a help
string or a description must not go red here. The byte-exact check (``--check``) is
a release-time one and runs only with ``SOUP_DOCS_EXACT=1``.
-2. **The render is the same everywhere.** CI runs this on Python 3.10 and 3.12, on
+2. **The render is the same everywhere.** CI runs this on Python 3.11 to 3.13, on
Linux, Windows and macOS, so every helper that keeps the output identical across
them is pinned on its own: the type spelling, the default and constraint rendering,
the cell escaping, the Rich-markup stripping.
diff --git a/tests/test_issue1677_licence_files.py b/tests/test_issue1677_licence_files.py
index ab4a5857..7176cdc2 100644
--- a/tests/test_issue1677_licence_files.py
+++ b/tests/test_issue1677_licence_files.py
@@ -13,8 +13,8 @@ Three locks:
2. ``LICENSE`` carries the two passages that had drifted, and not the drifted wording.
3. The holder line is one string in ``NOTICE``, the READMEs and the package authors.
-``pyproject.toml`` is read with a regex, not ``tomllib``, which is 3.11+ while this
-project supports 3.10 (same reason as ``test_requires_python_bound.py``).
+``pyproject.toml`` is read with a regex, not ``tomllib``, as ``test_requires_python_bound.py``
+did while the floor was 3.10, which has no ``tomllib``.
"""
from __future__ import annotations
diff --git a/tests/test_issue602_qwen4_ple_streaming.py b/tests/test_issue602_qwen4_ple_streaming.py
index cd2f68a9..6da74ea0 100644
--- a/tests/test_issue602_qwen4_ple_streaming.py
+++ b/tests/test_issue602_qwen4_ple_streaming.py
@@ -1185,8 +1185,8 @@ def test_qwen4_oq_torch_floor_matches_project_and_doctor():
# A substring test is satisfied by the string appearing anywhere --
# a comment, another extra, or a docstring -- so it would keep passing
# after the floor had been moved or removed from the place that matters.
- # `tomllib` is 3.11+ and this repo supports 3.10, so this is a bounded
- # regex over one block rather than a TOML parse.
+ # A bounded regex over one block rather than a TOML parse: written while the
+ # floor was 3.10, which has no `tomllib`.
block = re.search(r"^train = \[(.*?)^\]", project, re.S | re.M)
assert block is not None, "pyproject.toml has no `train` extra"
entries = re.findall(r'"([^"]+)"', block.group(1))
diff --git a/tests/test_issue636_torch_floor.py b/tests/test_issue636_torch_floor.py
index 8a439459..7e7374ba 100644
--- a/tests/test_issue636_torch_floor.py
+++ b/tests/test_issue636_torch_floor.py
@@ -20,9 +20,9 @@ These tests pin both halves:
* doctor's torch literal equals the pyproject declaration — hermetic, repo text
against src literal, the pin that keeps the second copy honest.
-pyproject is parsed with regex rather than ``tomllib`` because ``tomllib`` is
-3.11+ and this repo supports 3.10 — the same convention as
-``tests/test_requires_python_bound.py``.
+pyproject is parsed with regex rather than ``tomllib``, the convention
+``tests/test_requires_python_bound.py`` set while the floor was 3.10, which has no
+``tomllib``.
"""
from __future__ import annotations
diff --git a/tests/test_python_floor_consistency.py b/tests/test_python_floor_consistency.py
new file mode 100644
index 00000000..6926810e
--- /dev/null
+++ b/tests/test_python_floor_consistency.py
@@ -0,0 +1,75 @@
+"""The supported Python window is declared once, in ``requires-python``; the rest must agree.
+
+Moving the floor from 3.10 to 3.11 (#1805) touched five places: ``requires-python``, the
+``core-floor`` job in ``ci.yml`` (it installs the core on the oldest supported Python), ruff's
+``target-version``, mypy's ``python_version`` and the README badge.
+``tests/test_requires_python_bound.py`` ties ``requires-python`` to the CI support matrix; this
+file ties the other four to ``requires-python``, so a later move cannot leave one behind.
+"""
+
+from __future__ import annotations
+
+import re
+import tomllib
+from pathlib import Path
+
+import yaml
+
+ROOT = Path(__file__).resolve().parents[1]
+CI = ROOT / ".github" / "workflows" / "ci.yml"
+README = ROOT / "README.md"
+BADGE_RE = re.compile(
+ r'<img src="https://img\.shields\.io/badge/python-(\d+)\.(\d+)--(\d+)\.(\d+)-blue"'
+ r' alt="Python (\d+)\.(\d+)-(\d+)\.(\d+)">'
+)
+
+
+def _pyproject() -> dict:
+ return tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
+
+
+def _window() -> tuple[tuple[int, int], tuple[int, int]]:
+ """(floor, newest supported) from ``requires-python = ">=A.B,<C.D"``."""
+ spec = _pyproject()["project"]["requires-python"]
+ floor = re.search(r">=\s*(\d+)\.(\d+)", spec)
+ ceiling = re.search(r"<\s*(\d+)\.(\d+)", spec)
+ assert floor and ceiling, f"requires-python {spec!r} needs a >= floor and a < ceiling"
+ ceiling_major, ceiling_minor = int(ceiling.group(1)), int(ceiling.group(2))
+ assert ceiling_minor >= 1, f"cannot name the newest Python below {spec!r}"
+ return (int(floor.group(1)), int(floor.group(2))), (ceiling_major, ceiling_minor - 1)
+
+
+def _dotted(version: tuple[int, int]) -> str:
+ return f"{version[0]}.{version[1]}"
+
+
+def test_the_core_floor_job_runs_the_oldest_supported_python():
+ floor, _ = _window()
+ steps = yaml.safe_load(CI.read_text(encoding="utf-8"))["jobs"]["core-floor"]["steps"]
+ setups = [
+ step for step in steps if str(step.get("uses", "")).startswith("actions/setup-python@")
+ ]
+ assert len(setups) == 1, setups
+ assert str(setups[0]["with"]["python-version"]) == _dotted(floor), (
+ "core-floor must install the core on the floor requires-python declares"
+ )
+
+
+def test_ruff_targets_the_floor():
+ floor, _ = _window()
+ assert _pyproject()["tool"]["ruff"]["target-version"] == f"py{floor[0]}{floor[1]}"
+
+
+def test_mypy_checks_against_the_floor():
+ floor, _ = _window()
+ assert _pyproject()["tool"]["mypy"]["python_version"] == _dotted(floor)
+
+
+def test_the_readme_badge_names_the_supported_window():
+ floor, newest = _window()
+ badges = BADGE_RE.findall(README.read_text(encoding="utf-8"))
+ assert len(badges) == 1, f"expected one Python badge in README.md, found {badges}"
+ numbers = tuple(int(part) for part in badges[0])
+ expected = (*floor, *newest)
+ assert numbers[:4] == expected, f"badge URL {numbers[:4]}, requires-python {expected}"
+ assert numbers[4:] == expected, f"badge alt text {numbers[4:]}, requires-python {expected}"
diff --git a/tests/test_requires_python_bound.py b/tests/test_requires_python_bound.py
index 6d159b85..107b6a2a 100644
--- a/tests/test_requires_python_bound.py
+++ b/tests/test_requires_python_bound.py
@@ -1,8 +1,9 @@
"""`requires-python` must carry an UPPER bound, and it must match the CI matrix.
-`requires-python = ">=3.10"` with no ceiling tells pip that every future Python is
-supported. It is not: CI tests 3.10, 3.11 and 3.12 only. On 3.13+ pip happily
-resolves a torch wheel nobody here has ever run, and the failure is not a Soup
+`requires-python = ">=3.11"` with no ceiling tells pip that every future Python is
+supported. It is not: CI tests 3.11, 3.12 and 3.13 only (3.10 left and 3.13 joined
+with #1805). On 3.14+ pip happily resolves a torch wheel nobody here has ever run,
+and the failure is not a Soup
error message — it is a loader crash inside `c10.dll` / `libc10.so` before any
Soup code executes, so the user has nothing to act on.
@@ -13,8 +14,8 @@ exists to catch. Widening the matrix and widening the bound must happen together
The matrix is read from the `plan` job's `RELEASE_MATRIX` literal: the support
matrix, every cell, which pushes to `release/**` run. The `test` job's own matrix
is whatever `plan` outputs -- FULL (the same minus Windows and macOS on 3.11), the
-four APPROVAL cells or a single QUICK cell -- which is a run-time choice, not the
-support statement.
+four APPROVAL cells or a single QUICK cell, neither of which runs 3.13 -- which is a
+run-time choice, not the support statement.
"""
import json
@@ -93,7 +94,7 @@ class TestRequiresPythonHasAnUpperBound:
)
def test_the_ceiling_excludes_the_first_untested_python(self):
- """`<3.13` when the newest tested is 3.12 — the exclusive bound is the
+ """`<3.14` when the newest tested is 3.13 — the exclusive bound is the
next minor after the last one CI actually runs."""
_, ceiling = _parse_bounds(_requires_python(PYPROJECT.read_text(encoding="utf-8")))
newest_major, newest_minor = _ci_python_versions()[-1]
diff --git a/tests/test_rooted_paths_without_a_drive.py b/tests/test_rooted_paths_without_a_drive.py
new file mode 100644
index 00000000..743d7905
--- /dev/null
+++ b/tests/test_rooted_paths_without_a_drive.py
@@ -0,0 +1,168 @@
+r"""A rooted path without a drive is never a public identifier, on any Python.
+
+Python 3.13 changed ``ntpath.isabs``: a path that starts with exactly one ``/`` or ``\`` and
+names no drive (``/x``, ``\x``) is no longer absolute, where 3.11 and 3.12 call it absolute.
+Three checks relied on ``isabs`` alone to refuse such a path, so on 3.13 they began to accept
+what they had refused (#1805):
+
+* ``best_of_n_artifact``: the sampler ``model`` and ``revision`` must be public identifiers
+ (``/x`` passed on Windows, where ``os.path`` is ``ntpath``);
+* ``quest``: a v2 ``base_model`` must not name a local path (``\x`` passed on every OS, the
+ check calls ``ntpath.isabs`` itself).
+
+Each check now refuses a leading separator by name. Every case runs twice: with ``isabs`` as
+the running interpreter has it, and with ``isabs`` replaced, in the two modules only, by the
+3.13 Windows rule. The second run fails on 3.12 too if a check goes back to ``isabs`` alone.
+"""
+
+from __future__ import annotations
+
+import ntpath
+import os
+import sys
+
+import pytest
+
+from soup_cli.utils import best_of_n_artifact, quest
+from soup_cli.utils.best_of_n_artifact import validate_sampler_spec
+from soup_cli.utils.quest import (
+ CALIBRATION_SCALES,
+ EXPECTED_MODULES,
+ build_metadata,
+ validate_metadata,
+)
+
+_REAL_NT_ISABS = ntpath.isabs
+_SEPARATORS = ("/", "\\")
+#: Exactly one leading separator, no drive: absolute on 3.11-3.12, not on 3.13.
+ROOTED_WITHOUT_A_DRIVE = ("/x", "\\x", "/org/model", "\\org\\model")
+
+
+def _isabs_as_on_windows_313(path: str) -> bool:
+ """``ntpath.isabs`` with Python 3.13's rule; everything else is the real function."""
+ text = os.fspath(path)
+ if text[:1] in _SEPARATORS and text[1:2] not in _SEPARATORS:
+ return False
+ return _REAL_NT_ISABS(text)
+
+
+class _PathAsOnWindows313:
+ """``os.path`` of a Windows 3.13 host, as far as ``isabs`` goes."""
+
+ isabs = staticmethod(_isabs_as_on_windows_313)
+
+ def __getattr__(self, name: str):
+ return getattr(os.path, name)
+
+
+class _OsAsOnWindows313:
+ path = _PathAsOnWindows313()
+
+ def __getattr__(self, name: str):
+ return getattr(os, name)
+
+
+class _NtpathAs313:
+ isabs = staticmethod(_isabs_as_on_windows_313)
+
+ def __getattr__(self, name: str):
+ return getattr(ntpath, name)
+
+
[email protected](params=["this-python", "windows-3.13"])
+def isabs_rule(request, monkeypatch):
+ """Patch only the two modules under test, never ``os.path`` itself, so nothing else in
+ the process sees the simulated rule."""
+ if request.param == "windows-3.13":
+ monkeypatch.setattr(best_of_n_artifact, "os", _OsAsOnWindows313())
+ monkeypatch.setattr(best_of_n_artifact, "ntpath", _NtpathAs313())
+ monkeypatch.setattr(quest, "ntpath", _NtpathAs313())
+ assert best_of_n_artifact.os.path.isabs("/x") is False
+ assert quest.ntpath.isabs("\\x") is False
+ return request.param
+
+
+def _sampler(**changes) -> dict:
+ sampler = {
+ "kind": "local",
+ "model": "org/model",
+ "n": 2,
+ "temperature": 0.7,
+ "max_new_tokens": 16,
+ "revision": "main",
+ "device": "cpu",
+ "seed": 0,
+ "trust_remote_code": False,
+ }
+ sampler.update(changes)
+ return sampler
+
+
+def _quest_metadata(base_model: str) -> dict:
+ metadata = build_metadata(
+ activation_scales={name: CALIBRATION_SCALES[0] for name in EXPECTED_MODULES},
+ base_model="org/model",
+ calibration_sha256="ab" * 32,
+ )
+ metadata["base_model"] = base_model
+ return metadata
+
+
+class TestTheSimulatedRule:
+ """CONTROL: the stand-in must be 3.13's rule, or the second run proves nothing."""
+
+ def test_one_leading_separator_without_a_drive_is_not_absolute(self):
+ for path in ROOTED_WITHOUT_A_DRIVE:
+ assert _isabs_as_on_windows_313(path) is False, path
+
+ def test_a_drive_or_a_unc_share_still_is(self):
+ assert _isabs_as_on_windows_313("C:\\x") is True
+ assert _isabs_as_on_windows_313("C:/x") is True
+ assert _isabs_as_on_windows_313("\\\\server\\share\\x") is True
+
+ @pytest.mark.skipif(sys.version_info < (3, 13), reason="the rule of 3.13 and later")
+ def test_it_matches_the_real_function_from_3_13(self):
+ for path in (*ROOTED_WITHOUT_A_DRIVE, "C:\\x", "\\\\server\\share\\x", "org/model"):
+ assert ntpath.isabs(path) is _isabs_as_on_windows_313(path), path
+
+ @pytest.mark.skipif(sys.version_info >= (3, 13), reason="the rule before 3.13")
+ def test_before_3_13_the_real_function_disagrees(self):
+ """The difference the checks must not depend on."""
+ assert ntpath.isabs("/x") is True
+ assert ntpath.isabs("\\x") is True
+
+
[email protected]("path", ROOTED_WITHOUT_A_DRIVE)
+class TestBestOfNSampler:
+ def test_a_rooted_model_is_not_a_public_identifier(self, isabs_rule, path):
+ with pytest.raises(ValueError, match="candidate sampler model must be a public identifier"):
+ validate_sampler_spec(_sampler(model=path))
+
+ def test_a_rooted_model_is_refused_for_a_provider_too(self, isabs_rule, path):
+ provider = {
+ "kind": "provider",
+ "provider": "ollama",
+ "model": path,
+ "n": 2,
+ "temperature": 0.7,
+ "max_new_tokens": 16,
+ }
+ with pytest.raises(ValueError, match="candidate sampler model must be a public identifier"):
+ validate_sampler_spec(provider)
+
+ def test_a_rooted_revision_is_refused(self, isabs_rule, path):
+ with pytest.raises(ValueError, match="candidate sampler revision is invalid"):
+ validate_sampler_spec(_sampler(revision=path))
+
+
[email protected]("path", ROOTED_WITHOUT_A_DRIVE)
+def test_a_rooted_quest_base_model_is_a_local_path(isabs_rule, path):
+ with pytest.raises(ValueError, match="QuEST v2 base_model must not contain a local path"):
+ validate_metadata(_quest_metadata(path))
+
+
+def test_public_identifiers_still_pass(isabs_rule):
+ """The new refusal is a leading separator only: an organisation/name id is untouched."""
+ spec = validate_sampler_spec(_sampler(model="org/model", revision="v1.0"))
+ assert (spec["model"], spec["revision"]) == ("org/model", "v1.0")
+ assert validate_metadata(_quest_metadata("org/model"))["base_model"] == "org/model"
diff --git a/tests/test_train_extra_declares_requests.py b/tests/test_train_extra_declares_requests.py
index 284b3e88..233bd25b 100644
--- a/tests/test_train_extra_declares_requests.py
+++ b/tests/test_train_extra_declares_requests.py
@@ -15,9 +15,9 @@ runtime half is carried by the model-backed smoke tests (``tests/test_grpo.py``,
``tests/test_issue300_online_dpo_train.py``): they import the real trl trainers
in the environment pip resolved from this file.
-pyproject is parsed with regex rather than ``tomllib`` because ``tomllib`` is
-3.11+ and this repo supports 3.10 — the same convention as
-``tests/test_issue636_torch_floor.py``.
+pyproject is parsed with regex rather than ``tomllib``, the convention
+``tests/test_issue636_torch_floor.py`` set while the floor was 3.10, which has no
+``tomllib``.
"""
from __future__ import annotations