Make uv resolve gpcca-fast without compiling PETSc#86
Merged
Conversation
petsc4py/slepc4py compute their metadata dynamically at build time, so any bare `uv sync`/`uv run`/`uv lock` compiled PETSc from source just to resolve the dependency universe — and that source build fails on machines without a system BLAS on the linker path (e.g. isolated CI/uv build envs), where PETSc configure errors with "Could not find a functional BLAS". Add [[tool.uv.dependency-metadata]] entries mirroring the deps petsc4py/ slepc4py inject at build time, so uv resolves them from static metadata without ever building (resolves in ~5s). PETSc/SLEPc now compile only when the gpcca-fast group is actually installed. Also correct the (copied-from-CellRank) source-build recipe in the group comment: the documented options provide no BLAS and fail here; document the pre-built conda-forge/pixi path as the recommended install and a shared-BLAS source build as the fallback. uv.lock stays gitignored (library convention; hatch does not use it) — the static metadata is what unblocks resolution, so no lockfile is required. Local checks remain petsc-free via `hatch test` (features dev+test), which never pulls this dependency group. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
=======================================
Coverage 86.37% 86.37%
=======================================
Files 13 13
Lines 1387 1387
=======================================
Hits 1198 1198
Misses 189 189 🚀 New features to boost your workflow:
|
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.
Problem
Any bare
uvcommand in this repo (uv sync,uv run,uv lock) tried to compile PETSc from source and failed. Root cause:uv.lock, so uv locks the entire dependency universe — including the opt-ingpcca-fastgroup (cellrank[petsc],slepc).petsc4py/slepc4pyship no wheels and compute their metadata dynamically at build time, so uv had to build PETSc just to resolve — even with--no-default-groups(that only affects install, not locking).configurethen fails withCould not find a functional BLAS. (Verified from the actualconfigure.log.)Net effect: focused runs documented in
AGENTS.mdlikeuv run pytest tests/modelwere broken out of the box.Fix
Add
[[tool.uv.dependency-metadata]]entries that mirror the depspetsc4py/slepc4pyinject at build time (petsc4py → petsc,slepc4py → petsc4py + slepc; the two library packages have no Python deps). uv now resolves and locks these from static metadata without ever building — resolves in ~5s. PETSc/SLEPc compile only when thegpcca-fastgroup is actually installed.Also corrected the group's source-build comment, which was copied from CellRank's docs and only works where a system BLAS already exists; it now documents the pre-built conda-forge/pixi path as the recommended install, with a shared-BLAS source build as the fallback.
Verification
uv lock→Resolved 302 packages in 4.80s, no build.uv sync --extra test→ installs in ~11s,petsc4pycorrectly absent from.venv.uv run pytest tests/test_utils.py→ 19 passed.hatch test tests/test_utils.py(unchanged path) → 19 passed.Notes
uv.lockstays gitignored (library convention; hatch manages the test matrix and doesn't consume it). The static metadata is what unblocks resolution, so no lockfile is required.dependency-metadataentries in sync with thegpcca-fastgroup.gpcca-fastruntime backend still builds from source only where a real BLAS is available; conda-forge binaries are the robust route (documented). Unchanged by this PR.🤖 Generated with Claude Code