Support Python 3.11 as well as 3.12 - #38
Open
shaunr0b wants to merge 1 commit into
Open
Conversation
Nothing in src/ requires 3.12: every file parses under the 3.10 grammar, and the newest stdlib feature used is enum.StrEnum (3.11). The floor was tighter than the code needs, which keeps 3.11 users off the package for no reason. - pyproject: python = ">=3.11.0,<3.13.0"; ruff target-version = "py311" so linting matches the real minimum - poetry.lock: regenerated. No runtime dependency version changes; the only additions are three dev-group backports gated on python_version == "3.11" - tests.yaml: matrix over 3.11 and 3.12 so both stay verified - readme: state the supported range, and correct the 3.13 note — the blocker is the pinned numpy <2.0.0 (last release 1.26.4, no cp313 wheels), not pytorch, which has shipped cp313 wheels since 2.5 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Widens the supported Python range from
>=3.12.0,<3.13.0to>=3.11.0,<3.13.0.Why
Nothing in
src/requires 3.12. Every file in the tree parses under the 3.10 grammar, and the newest stdlib feature used anywhere isenum.StrEnum(3.11) insrc/anonymizer/view/series.py. There is no 3.12-only syntax or API in use — noitertools.batched,typing.override,TypeAliasType,Path.walk, orsys.monitoring. The floor is simply tighter than the code needs, which keeps 3.11 users off the package for no reason.Changes
pyproject.toml—python = ">=3.11.0,<3.13.0", andruff target-version = "py311"so linting matches the real minimum.poetry.lock— regenerated. No runtime dependency versions change. The only additions are three dev-group backports gated onmarkers = "python_version == \"3.11\""(importlib-metadata,zipp,backports-tarfile), so a 3.12 install resolves exactly as it did before..github/workflows/tests.yaml— matrix over 3.11 and 3.12, so both stay verified.readme.md— states the supported range, and corrects the 3.13 note (see below).Verification
Every one of the 133 locked packages was audited against 3.11: each either declares a compatible
requires-pythonand ships a usable wheel (pure-python,abi3, orcp311), or is sdist-only. Zero blockers. The decompression stack is at exact parity —numpy 1.26.4,pylibjpeg-libjpeg,pylibjpeg-openjpegandpylibjpeg-rleall ship the same number of cp311 and cp312 wheels.Full suite green on both legs (
147 passed, 6 skippedon 3.11).Pre-existing test flakiness, noted in passing
My first matrix run failed on the 3.11 leg —
test_export_4_patients_to_test_pacs,assert len(dirlist) == 4returning 2. Re-running the same commit passed, and I don't believe it's version-related: the assertion sits behind a hardcodedtime.sleep(1)after asynchronous SCP writes, so the last sends are the ones a slow runner loses.For what it's worth,
master's own CI run at f5fadcc shows the same class of failure on 3.12 —test_send_ct_Archibald_Doe_mr_Peter_Doe_then_delete_studies,assert Totals(..., instances=3) == (1, 1, 1, 4),1 failed, 146 passed, 6 skipped. Different test, same shape: an expected-count assertion coming up short. Happy to open a separate issue if that's useful.On the readme's 3.13 note
The readme currently attributes the 3.13 exclusion to pytorch. That is no longer the binding constraint — torch has shipped cp313 wheels since 2.5, and the locked 2.7.1 has them. The actual blocker is the
numpy = "<2.0.0"pin: the last release under 2.0 is 1.26.4, which has no cp313 wheels. I've updated the readme to say so, and left the numpy pin alone — lifting it is a bigger question than this PR.Not included
V19carries the samerequires-python = ">=3.12.0,<3.13.0"under itsuv/PEP 621 setup. Glad to port this there as well if you'd like it.🤖 Generated with Claude Code