Skip to content

Reproducible deps: declare cosmo_numba + numba, commit uv.lock, install image from lock#266

Merged
cailmdaley merged 6 commits into
developfrom
uv-lock-cosmo-numba
Jul 11, 2026
Merged

Reproducible deps: declare cosmo_numba + numba, commit uv.lock, install image from lock#266
cailmdaley merged 6 commits into
developfrom
uv-lock-cosmo-numba

Conversation

@cailmdaley

Copy link
Copy Markdown
Collaborator

Closes #265.

Makes sp_validation's environment reproducible so an image build can never re-resolve numpy past numba's ceiling — the drift that upgraded numpy to 2.5 and broke numba/ngmix.

What changed

Dependencies (pyproject.toml)

  • Declare cosmo-numba (aguinot/cosmo-numba@main; not on PyPI). main carries numpy-2 FFT support via its rocket-fft dependency and declares its own deps from requirements.txt, so numba's numpy window reaches the resolver.
  • Pin numba directly too. It's the one load-bearing constraint of this environment (numba 0.66 → numpy<2.5); pinning it here makes it visible and resilient to cosmo-numba's dependency metadata (which has silently emptied out between refs). We pin numba, never numpy directly.
  • Declare the other imported-but-undeclared deps the import audit surfaced: matplotlib, pandas, pyyaml (core, src/); fitsio (glass extra); a new workflow extra (snakemake + mpi4py) for the workflow/scripts/ runners.
  • requires-python and ruff target → 3.12 (the container's Python; cosmo-numba's floor).

Lockfile

  • Commit uv.lock (un-ignored) as the SSOT, scoped to Linux via [tool.uv]. numpy resolves to 2.4.6, inside numba's window; cs_util to 0.2.2 (has cs_util.size).

Dockerfile

  • Install from the lock: uv sync --frozen --inexact into the base image's /app/.venv (--inexact keeps the inherited ShapePipe stack). Drops the ad-hoc snakemake layer and the cs_util --upgrade workaround — the lock now governs cs_util, decoupling us from the base image's cs_util version.

Validation

Pushing this branch triggers the image build (import numba, cosmo_numba smoke + fast unit suite). Green build = the numpy/numba window holds in the rebuilt image, which is the condition that lets the image-sims .smk drop its two-image sif_pipeline workaround.

Notes / open items

  • cv_runner (imported in workflow/scripts/cv_*.py) and unions_wl (one footprint script) are left undeclared — no resolvable source found. Flagged in a pyproject NOTE.
  • The numba insurance pin is deliberate but droppable if you'd rather lean entirely on cosmo-numba@main carrying it.
  • A shapepipe-side cs_util lock refresh is now optional (this PR no longer depends on the base image's cs_util), not a blocker.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vtw1qcgTrQ6YuMvxwYzNup

cailmdaley and others added 6 commits July 11, 2026 11:58
…Rs reviewed

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpaRHk3QwN13myduQ3hJyf
…-file layout, per-part blinding at birth)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpaRHk3QwN13myduQ3hJyf
…mage from lock

Make sp_validation's environment reproducible so an image build can never
re-resolve numpy past numba's ceiling — the drift that silently upgraded numpy
to 2.5 and broke numba/ngmix.

- Declare cosmo-numba (aguinot/cosmo-numba@main; not on PyPI) — the numba
  B-mode kernels b_modes.py imports. main carries numpy-2 FFT support via its
  rocket-fft dep and declares its own deps, so numba's numpy window reaches the
  resolver. Also pin numba directly: the one load-bearing constraint, made
  visible and resilient to cosmo-numba's dep metadata (which has emptied out
  between refs).
- Declare the other imported-but-undeclared deps the audit found: matplotlib,
  pandas, pyyaml (core, src/); fitsio (glass extra); a new `workflow` extra for
  snakemake + mpi4py. cv_runner and unions_wl left undeclared (no resolvable
  source) with a NOTE.
- requires-python and ruff target -> 3.12 (the container's Python; cosmo-numba's
  floor).
- Commit uv.lock (un-ignored) as the SSOT; scope it to Linux via [tool.uv].
  numpy resolves to 2.4.6, inside numba 0.66's <2.5 window.
- Dockerfile installs from the lock: `uv sync --frozen --inexact` into the base
  image's /app/.venv (--inexact keeps the ShapePipe stack). Drops the ad-hoc
  snakemake layer and the cs_util `--upgrade` workaround — the lock pins
  cs_util 0.2.2 (with cs_util.size), decoupling us from the base image's cs_util.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vtw1qcgTrQ6YuMvxwYzNup
…mba gotcha finding

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vtw1qcgTrQ6YuMvxwYzNup
…gins

uv sync installs a newer pytest than the base ShapePipe image's
pytest-pydocstyle/pytest-pycodestyle (>=2.4) expect; their pytest_collect_file
hooks use the removed `path` arg and crash collection. sp_validation lints with
ruff, so disable both via addopts (`-p no:`).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vtw1qcgTrQ6YuMvxwYzNup
# Conflicts:
#	.felt/sp-validation-restructuring.md
@cailmdaley cailmdaley merged commit 688e3a0 into develop Jul 11, 2026
3 checks passed
@cailmdaley cailmdaley deleted the uv-lock-cosmo-numba branch July 11, 2026 12:19
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.

Reproducible deps: declare cosmo_numba + numba, commit uv.lock, install image from lock

1 participant