Skip to content

Update boilerplate, add Python 3.15, drop Python 3.11, adopt the dead-code hook - #90

Merged
hmgaudecker merged 7 commits into
mainfrom
boilerplate-update-py315
Nov 23, 2026
Merged

hmgaudecker merged 7 commits into
mainfrom
boilerplate-update-py315

Conversation

@hmgaudecker

@hmgaudecker hmgaudecker commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Why

  • The boilerplate, hook and action versions had fallen behind, and Python 3.15 was not tested.
  • numpy requires Python >=3.12 from 2.5 on; 2.4 was the last line to allow 3.11. networkx 3.7 and jax 0.12 require >=3.12 as well. The py311 environment could therefore only ever resolve networkx 3.6.1 and numpy 2.4, so that CI job tested a frozen dependency set.

What

Boilerplate, Python 3.15, ty as a hook

  • Python 3.15: py315 pixi environment, CI matrix entry, classifier, requires-python upper bound, max_supported_python. pixi.lock regenerated (lock format v7).
  • ty runs as the ty-pre-commit hook (ty==0.0.108) against the py314 pixi environment. The type-checking environment and ty task are removed; CI's run-ty job runs prek run ty, which needs prek>=0.5.9 to install the hook.
  • Refreshed hook and action versions: pyproject-fmt, check-jsonschema, ruff, checkout, setup-pixi, pixi, codecov, setup-python. pixi run --locked in CI.
  • Template hooks added: codespell, pixi-lock-check (pre-push), pre-push-hooks-installed, notebook-cell-source-format, no-hardcoded-user-paths, no-section-separator-comments, no-internal-references.
  • The docs build requires jupyter-book>=2.1.7 and mystmd>=1.13.0.
  • CLAUDE.md and GEMINI.md removed; AGENTS.md is the only instruction file.
  • Fixes required by the new versions:
    • tuple[T, *Unpack[...]] unpacked a TypeVarTuple twice; it's now *MixedTupleType.
    • ty rule renames in ignore comments, plus one unused ignore removed.
    • RUF036 union order.
    • A README typo.
    • Notebook sources stored as line arrays.

Dead-code hook

  • Adopts the vulture-based dead-code hook from .ai-instructions, with [tool.dead-code] public = ["src/dags/"], a ci.skip entry, and a run-ty step with the submodule checked out. .ai-instructions is excluded from ty, since the hook script imports vulture from its own environment.
  • Its first run reported _is_python_identifier in tree/tree_utils.py as used only by tests. Nothing in dags or the gettsim workspace calls it, so it is removed along with its test.

Python 3.11 dropped (#91, merged into this branch)

  • requires-python = ">=3.12"; the py311 pixi feature, environment, classifier and CI matrix entry are gone.
  • Generic functions declare their type parameters with PEP 695 syntax (def with_signature[**P, R](...)). The module-level ParamSpec, TypeVar and TypeVarTuple objects are no longer needed, so dags.typing is removed and dags.tree.typing loses T.
  • dags.typing only held those four type variables. ttsim, gettsim, gettsim-personas and pylcm do not import it.

Supersedes #84, #87 and #89.

Checks

  • prek run --all-files (including ty): exit 0.
  • Tests: 172 passed on each of py312, py313, py314 and py315 (194 before, minus the 22 cases of the removed function's test).

https://claude.ai/code/session_01K77bhqW4p5VmpnXm4hkZ77

hmgaudecker and others added 2 commits November 16, 2026 12:08
- Python 3.15: py315 environment, CI matrix entry, classifier, requires-python
  bound, max_supported_python; pixi.lock regenerated (lock format v7).
- ty runs as the ty-pre-commit hook against the py314 pixi env; the
  type-checking environment and ty task are gone.
- Hook and action versions refreshed; template hooks added (codespell,
  pixi-lock-check, pre-push-hooks-installed, notebook-cell-source-format,
  no-hardcoded-user-paths, no-section-separator-comments,
  no-internal-references).
- CLAUDE.md and GEMINI.md removed; AGENTS.md is the only instruction file.
- .ai-instructions bumped, and excluded from ty.
- Fixes the new hook versions demanded: a doubly unpacked TypeVarTuple in
  output.py, renamed ty rules, RUF036 union order, a README typo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the vulture-based dead-code hook from .ai-instructions, its
[tool.dead-code] table (src/dags/ as public API), its ci.skip entry and a
run-ty CI step with the submodule checked out.

Its first run reported _is_python_identifier in tree_utils.py as used only by
tests. Nothing in dags or the gettsim workspace calls it, so it goes, with its
regex constant and its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.52%. Comparing base (b82a152) to head (50cd43d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #90      +/-   ##
==========================================
- Coverage   96.56%   96.52%   -0.04%     
==========================================
  Files          27       26       -1     
  Lines        1398     1382      -16     
==========================================
- Hits         1350     1334      -16     
  Misses         48       48              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

hmgaudecker and others added 2 commits November 16, 2026 13:09
The lock held prek 0.3.4, whose bundled uv 0.10.2 cannot parse
ty-pre-commit's pyproject.toml (dependency tables with hashes), so the
run-ty job failed while installing the hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build fetches the newest MyST book theme, which no longer supports
mystmd 1.8.2; the old engine reports the mismatch and then hangs, so Read the
Docs kills the build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hmgaudecker hmgaudecker changed the title Update boilerplate, add Python 3.15, adopt the dead-code hook Update boilerplate, add Python 3.15, drop Python 3.11, adopt the dead-code hook Nov 19, 2026

@timmens timmens left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! I do have some comments about the ai-instructions submodule, but I'll raise that in the respective repository.

I also had some minimal clean up comments for which I took the liberty to quickly fix them myself; feel free to revert the changes.

@timmens

timmens commented Nov 21, 2026

Copy link
Copy Markdown
Member

@janosg double-checking with you whether there is a good reason not to drop the Python 3.11 support?

@janosg

janosg commented Nov 21, 2026

Copy link
Copy Markdown
Member

We can drop it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K77bhqW4p5VmpnXm4hkZ77
@hmgaudecker
hmgaudecker merged commit 129e541 into main Nov 23, 2026
22 checks passed
@hmgaudecker
hmgaudecker deleted the boilerplate-update-py315 branch November 23, 2026 10:11
@hmgaudecker hmgaudecker mentioned this pull request Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants