Skip to content

Drop Python 3.11 support; use PEP 695 type parameters - #91

Open
hmgaudecker wants to merge 3 commits into
boilerplate-update-py315from
drop-py311
Open

hmgaudecker wants to merge 3 commits into
boilerplate-update-py315from
drop-py311

Conversation

@hmgaudecker

Copy link
Copy Markdown
Member

Stacked on #90.

Why

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

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

Checks

Hooks (including ty) pass; 172 tests pass on each of py312, py313, py314 and py315.

https://claude.ai/code/session_01K77bhqW4p5VmpnXm4hkZ77

hmgaudecker and others added 3 commits November 17, 2026 17:59
Follows numpy, which 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, so
the py311 environment could only ever resolve networkx 3.6.1 and numpy 2.4.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K77bhqW4p5VmpnXm4hkZ77
Generic functions name their type parameters in the signature, so the
module-level ParamSpec, TypeVar and TypeVarTuple objects in dags.typing
and dags.tree.typing are no longer needed. dags.typing is removed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K77bhqW4p5VmpnXm4hkZ77
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K77bhqW4p5VmpnXm4hkZ77
@hmgaudecker
hmgaudecker requested a review from timmens November 17, 2026 17:00
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.52%. Comparing base (8c680cc) to head (fec62bf).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           boilerplate-update-py315      #91      +/-   ##
============================================================
- Coverage                     96.54%   96.52%   -0.03%     
============================================================
  Files                            27       26       -1     
  Lines                          1391     1382       -9     
============================================================
- Hits                           1343     1334       -9     
  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.

MImmesberger pushed a commit to ttsim-dev/ttsim that referenced this pull request Nov 17, 2026
## Why

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, so the `py311`
environment could only resolve an ageing dependency set. dags drops 3.11
in OpenSourceEconomics/dags#91.

## What

- `requires-python = ">=3.12"`; the `py311` pixi feature, environment
and classifier are gone.
- CI: the `py311` job is gone, and the `exclude` list is replaced by a
shorter `include` list. Job names are unchanged.
- `RoundingSpec.apply_rounding` and `cast_ttsim_unit` declare their type
parameters with PEP 695 syntax.
- The generic classes (`InterfaceFunction`, `ColumnFunction`,
`ParamFunction`) keep `Generic[...]` and their `@no_type_check` on
`__call__`. I tried the PEP 695 form: beartype cannot resolve class type
parameters in stringified annotations, so the package fails at import.
`_set_single_field` keeps its `TypeVar` because its forward-referenced
bound fails under beartype on 3.12 and 3.13. The ruff ignores for UP046
and UP047 stay, with these reasons.
- `test_python_version` is removed; `requires-python` enforces the
floor.
- `pixi.lock` is regenerated. Besides losing the `py311` environments,
the changed `requires-python` re-resolved the PyPI packages, so several
move forward (for example networkx 3.7).

## Checks

Hooks pass. Tests pass on py312, py313 and py314 (1742 passed, 58
skipped) and on py314-jax (1770 passed, 30 skipped).

https://claude.ai/code/session_01K77bhqW4p5VmpnXm4hkZ77

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
MImmesberger pushed a commit to ttsim-dev/gettsim that referenced this pull request Nov 18, 2026
## Why

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, so the `py311`
environment could only resolve an ageing dependency set. dags drops 3.11
in OpenSourceEconomics/dags#91.

## What

- `requires-python = ">=3.12"`; the `py311` pixi feature, environment
and classifier are gone.
- CI: the `py311` job is gone, and the `exclude` list is replaced by a
shorter `include` list. Job names are unchanged.
- `test_python_version` is removed; `requires-python` enforces the
floor.
- GEP 9 names 3.12–3.13 as the versions that still need `from __future__
import annotations`.
- `pixi.lock` is regenerated. Besides losing the `py311` environments,
the changed `requires-python` re-resolved the PyPI packages, so several
move forward (for example networkx 3.7).

## Checks

Hooks pass. Tests pass on py312 and py314 (1341 passed, 568 skipped
each).

https://claude.ai/code/session_01K77bhqW4p5VmpnXm4hkZ77

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
MImmesberger added a commit to ttsim-dev/gettsim-personas that referenced this pull request Nov 18, 2026
## Why

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, so the `py311`
environment could only resolve an ageing dependency set. dags drops 3.11
in OpenSourceEconomics/dags#91.

## What

- `requires-python = ">=3.12"`; the `py311` pixi feature, environment
and classifier are gone.
- `AGENTS.md` lists the remaining environments.
- `pixi.lock` is regenerated. Besides losing the `py311` environments,
the changed `requires-python` re-resolved the PyPI packages, so several
move forward (for example networkx 3.7).

## Checks

Hooks pass. Tests pass on py312 and py314 (545 passed, 4 skipped each).

https://claude.ai/code/session_01K77bhqW4p5VmpnXm4hkZ77

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: MImmesberger <74215010+MImmesberger@users.noreply.github.com>
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.

1 participant