build!: drop Python 3.11 and upgrade the spatialdata cluster - #120
Merged
Conversation
spatialdata 0.8.0 and anndata 0.13 both require Python >= 3.12, so the
cluster cannot move while 3.11 is supported. Dropping 3.11 unblocks all of
it and makes the pandas 3 string-dtype coercion dead code.
Pins, all exercised together:
python >=3.12, <3.14
dask >=2026.3.0, <2026.8 (2026.7.1)
spatialdata >=0.8.0, <0.9 (0.8.0)
ome-zarr >=0.16.0, <0.19 (0.18.0)
anndata >=0.13.2, <0.14 (0.13.2)
zarr unchanged (3.1.3)
The anndata floor is 0.13.2 rather than 0.13.0 deliberately. 0.13.0 imports
typing_extensions.sentinel but declares no floor for typing-extensions, so a
resolver prefers it, pairs it with 4.14.1 and yields an environment that
installs cleanly then fails at import. 0.13.2 declares the floor correctly.
Removes _coerce_table_strings_to_object and its call in _save_output: anndata
0.13 serializes pandas' str dtype natively. The three tests asserting the
coercion's behaviour go with it; the write-path tests under infer_string stay,
now covering anndata's handling, and the xfail removal trigger becomes a plain
assertion so a regression in anndata is still caught.
Also updates the CI matrices, classifiers, mypy python_version, and the docs
and README that still advertised 3.11 (several also predated 3.13 support).
Unit 641 passed / 11 skipped. Integration 4 failed / 14 passed, the same four
that fail on main for unrelated reasons (a 'linear' resampling method the code
rejects, and a COO region mismatch). mkdocs --strict clean.
BREAKING CHANGE: Python 3.11 is no longer supported. The minimum is now 3.12,
required by spatialdata 0.8.0 and anndata 0.13.
Complexity Monitoring ReportThreshold: 15 Excellent! No complexity violations found. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #117. Shrinks #114.
Why
spatialdata 0.8.0 and anndata 0.13 both require Python >= 3.12. That single
constraint was blocking the entire dependency cluster, and with it the removal
of the pandas 3 string-dtype coercion. Dropping 3.11 unblocks all of it at
once.
Pins
>=3.11, <3.14>=3.12, <3.14>=2025.12.0, <2026.2>=2026.3.0, <2026.8>=0.7.3, <0.8>=0.8.0, <0.9>=0.14.0, <0.16>=0.16.0, <0.19>=0.11.0, <0.13>=0.13.2, <0.14>=3.0.0, <3.2zarrdid not need to move, which was not obvious going in.The anndata floor is
0.13.2, not0.13.0, deliberately. anndata 0.13.0imports
typing_extensions.sentinel(needs typing-extensions >= 4.16) butdeclares no floor for it. A resolver therefore prefers 0.13.0 -- looser
metadata is easier to satisfy -- pairs it with typing-extensions 4.14.1, and
produces an environment that installs cleanly and then dies at import:
A floor of
>=0.13would have shipped that. 0.13.2 declares it correctly.This is exactly the failure mode the clean-venv CI job exists to catch.
What the coercion removal rests on
_coerce_table_strings_to_objectexisted because anndata could not serializepandas'
strdtype. anndata 0.13.0 fixed that (anndata #2221, via #2133).Verified directly before removing it -- writing an obs frame with a string
index, a string column and a string-backed categorical:
write_zarrinfer_stringIORegistryErrorIORegistryErrorinfer_stringTests
641 = 643 - 3 deleted coercion tests + 1 converted xfail. The four integration
failures are identical to main and unrelated to this change: three tests pass a
'linear'resampling method the code now rejects, one is a COO regionmismatch. They were failing before this PR and still are.
Test changes:
future.infer_string=Truefor all threepaths. They now cover anndata's handling rather than Thyra's workaround, and
nothing else in the suite runs with string inference on.
xfailremoval trigger into a plain assertion, so a regressionin anndata's string support is still caught at the smallest scope.
mkdocs --strictclean. black / isort / flake8 / mypy / bandit / pydocstyleclean via pre-commit.
Also updated
CI matrices in
tests.yml,release.ymlandcomplexity-monitoring.yml;classifiers;
[tool.mypy] python_version; and the docs and README badges thatadvertised 3.11 -- several of which said "3.11 or 3.12" and were stale already,
since 3.13 has been supported for a while.
The dependency-cluster comments are re-pointed too: the pandas comment cited a
coercion that no longer exists, the ome-zarr comment explained a ceiling that
has moved, and the cluster preamble used a worked example that is now the
combination we ship.
Known, not introduced here
A repo-wide
poetry run mypy thyrareports 30 errors across 9 files. None arein code this PR touches, and none are gated: mypy is not in CI at all, and the
pre-commit hook runs with
--ignore-missing-imports --no-strict-optionalin anisolated env that cannot see spatialdata or anndata. Some of the
union-attrsignals likely widened because anndata 0.13 types
Xmore richly. Worth afollow-up, out of scope here.
Follow-up for #114
This moves the spatialdata ceiling to 0.8.0. When scverse/spatialdata#1055
eventually lands, #114 is reduced to a floor bump rather than the whole cluster
migration it describes today.