Repository navigation
Drop Python 3.11 support and promote clodius to a core dependency - #119
Merged
Merged
Conversation
The tiles extra existed only to keep 3.11 installable: clodius (matrix tile serving, issue #82) requires Python >= 3.12, so it carried a python_version marker and stayed optional rather than force the floor up. That meant every image built from the standard Dockerfiles -- including what actually deploys to dev/prod -- carried no tile backend at all, so the tile routes always answered 501 regardless of database content. Raise requires-python to >=3.12 and move clodius into dependencies unconditionally. Every image already builds on python:3.12-slim-bookworm, so this changes nothing about the runtime base -- it only drops the promise that a 3.11 interpreter can install cfdb, and both the API and worker images now carry the tile backend by default. Retires Dockerfile.api-tiles and the api-tiles/worker-tiles Makefile scaffolding that existed solely to work around clodius being optional locally, exactly as anticipated when that scaffolding was written -- `make api` and `make wool` cover it now. Drops the 3.11 leg from the CI test matrix, and removes the pytest.importorskip("clodius")/("numpy") guards added to keep the (now nonexistent) 3.11 CI leg passing; the sys.modules-patching tests that simulate a genuinely backendless build are untouched, since that degradation path remains real architecture, not a version-support artifact.
conradbzura
marked this pull request as ready for review
September 29, 2026 16:35
conradbzura
added a commit
that referenced
this pull request
Sep 29, 2026
pyproject.toml's [tool.uv.sources] pins clodius to a commit on the abdenlab/clodius fork -- the public PyPI package is a different codebase entirely, with no tiles_v2 subpackage. That pin is a uv-only concept: bare `pip install .`, which both Dockerfiles used, has no idea it exists and silently resolves `clodius` from PyPI instead. This went undetected through both the build and the trivy scan -- `pip install .` succeeds either way, since the wrong package installs cleanly and only fails at import (`ModuleNotFoundError: No module named 'clodius.core'`) -- and shipped in the PR #119 merge that promoted clodius to a core dependency. The deployed dev image reported `clodius tile backend` unavailable on every tile route despite the build logs showing clodius installed successfully, because it was installing and then failing to import the wrong package the whole time. Switch both Dockerfiles to `uv pip install --system`, which resolves [tool.uv.sources] the same way `uv sync` does, and add `git` to both images' apt install (uv needs it to fetch the pinned commit). Verified by actually running the built images and importing clodius as the app runtime would -- the gap the previous verification missed, since `uv sync`/`uv run` locally and a bare `docker build` both hid this: the former because it correctly reads [tool.uv.sources], the latter because it only checks that pip install succeeds, not which package it installed. `cfdb.tilesets.backend.is_available()` now returns True inside both freshly built images. Re-ran the exact CI trivy invocation against the worker image with git added: 0 HIGH/CRITICAL, exit code 0.
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.
Summary
Raise
requires-pythonto>=3.12and promoteclodius(the matrix tile backend, issue #82) from an optionaltilesextra to an ordinary core dependency.The extra existed only to keep Python 3.11 installable: clodius requires >= 3.12, so it carried a
python_version >= '3.12'marker and stayed optional rather than force the floor up. The consequence was that every image built from the standardDockerfile.api/Dockerfile.wool— including what actually deploys to dev and prod — carried no tile backend at all, so/tileset_infoand/tilesanswered501regardless of database content. This surfaced concretely while testing PR #118's tileset endpoints against the dev deployment: the routes were live, but tile serving itself was unavailable because dev's image never carried clodius in the first place.Every image already builds on
python:3.12-slim-bookworm, so this changes nothing about the runtime base — it only drops the promise that a 3.11 interpreter can install cfdb at all, and both the API and worker images now carry the tile backend by default.Verified: full test suite passes (1479 passed, 3 skipped on unrelated missing-tool conditions, 1 xfailed), and both
Dockerfile.apiandDockerfile.woolbuild successfully from a clean git worktree withclodiusinstalled unconditionally. Re-ran the exact trivy invocation CI uses (severity: HIGH,CRITICAL,ignore-unfixed: true) against the rebuilt worker image, which now carries clodius's full dependency tree (numpy, h5py, cooler, pandas, scipy, pyarrow, etc.) — 0 findings, exit code 0.Proposed changes
Dependency and version floor
pyproject.toml:requires-python = ">=3.12",clodiusmoved intodependenciesunconditionally, thepython_version >= '3.12'marker dropped, the3.11classifier removed..github/workflows/test.yml: drop the3.11leg from the CI matrix (now["3.12", "3.13"]).Retire the now-redundant local-dev scaffolding
Dockerfile.api-tilesand theapi-tiles/worker-tilesMakefile targets existed solely to layer clodius onto a local image and share a cache volume with a worker, becausemake api's image carried no clodius. Both are deleted —make apiandmake woolnow carry the tile backend directly, exactly as anticipated when that scaffolding was written ("Retire both once tiles becomes an ordinary dependency ... make api then covers this on its own"). The README's "Serving tiles locally" section is updated to point at the ordinaryuv runlocal worker pool flow instead.Remove version-gated test guards
The
pytest.importorskip("clodius")/pytest.importorskip("numpy")guards added to keep the (now nonexistent) 3.11 CI leg passing are removed acrosstests/fixtures/coolers.py,tests/test_tiles.py,tests/test_tilesets/test_backend.py,tests/test_tilesets/test_service.py,tests/test_tilesets_router.py, andtests/test_api/test_lifespan_tilesets.py— they would never skip anything again. Thesys.modules-patching tests that simulate a genuinely backendless build (test_should_raise_when_clodius_is_absent,test_lifespan_should_leave_the_service_unset_without_clodius, etc.) are untouched: that degradation path remains real defensive architecture — a broken or partial install — not a version-support artifact, so its coverage stays.Documentation and error-message accuracy
Updates every place that described clodius as optional or gated on Python 3.11 — the Quickstart install note, the "Matrix tile serving" Limitations bullet (removed outright, since it's no longer a limitation), the
/tilesstatus-code table, and the docstrings/error messages incfdb.tilesets.backend,cfdb.tilesets.errors, andcfdb.api.mainthat referenced "the tiles extra" or a "sibling checkout" as the reason a build might lack clodius. They now correctly describe a missing backend as a broken or incomplete install rather than an unconfigured optional feature.Test cases
TestLoadBackendsys.modulespatched so both clodius modules the gate imports from raiseImportError, simulating a broken or incomplete install of the now-coreclodiusdependencyload_backendis calledTileBackendUnavailable, chained from the underlyingImportErrorTestIsTileErroris_tile_erroris calledTilesetErrorhierarchyuv run pytest)devextra synced with notiles-specific stepgffread,bedToBigBed), 1 xfailed, 0 failedDockerfile.api,Dockerfile.wool)docker build --platform linux/amd64runs for both filesclodius/numpy/cooler/h5pyinstalled via the plainpip install .stepcfdb-wool)trivy image --severity HIGH,CRITICAL --ignore-unfixed, matching CI's exact invocation