chore: pin pip installs by hash in CI and image (fixes #35)
Fixes #35.
Pins all pip installs behind --require-hashes so CI and the image install exactly the reviewed packages: hash-locked requirements for CI tools, tests and the image, generated with pip-compile --generate-hashes, and installs run with --require-hashes.
Verified in a fresh Python 3.13 venv: pip install --require-hashes -r requirements/test.txt exits 0 (52 packages incl. torch 2.15.0+cpu, transformers 5.17.0, setuptools 84.2.1) and pip check is clean. setuptools is pinned explicitly because pip-compile otherwise drops it as unsafe while torch 2.15 requires setuptools>=77.0.3.
Note: the image was already pinned by digest; only the pip lines needed locking. The Makefile dev target and docs/DEVELOPMENT.md remain unpinned (out of scope).
Summary by cubic
Pins every pip install in CI and the Docker image to hash-locked requirement files so builds install exactly the reviewed packages (issue #35).
- Installs run with
--require-hashesagainst new filesrequirements/ci-tools.txt,requirements/test.txt, andrequirements/image.txt, generated withpip-compile --generate-hashes;requirements/README.mddocuments regeneration on Linux x86-64, where the CPU torch wheel exists. - Package builds now run with
python -m build --no-isolation, so the setuptools backend comes from the lockedci-tools.txtinstead of an unpinned isolated build (setuptools is pinned to 84.2.1, which pip-compile otherwise drops as unsafe while torch 2.15 requires setuptools>=77.0.3). test.inpins torch to 2.15.0+cpu so regeneration cannot drift to a CUDA build, and the image re-hash commands pin Linux x86_64 and verify the sdist.- The editable installs of the package itself stay outside the lock (they fetch nothing); the Makefile dev target and
docs/DEVELOPMENT.mdremain unpinned (out of scope). release.ymlruns the image build whenrequirements/image.txtchanges, and the image pin test reads the transformers/tokenizers versions from the locked file in install order, catching a later downgrade.- Verified in a fresh Python 3.13 venv: 52 packages install cleanly,
pip checkpasses, andpython -m build --no-isolationbuilds the sdist and wheel.
Summary by CodeRabbit
- Chores
- CI, release packaging, and Docker image builds now install dependencies from hash-verified lock files, with versions pinned for repeatable builds.
- Package builds no longer install dependencies in an isolated build environment.
- Test and image dependency sets are explicitly locked, including CPU-based PyTorch testing.
- Documentation
- Added guidance on dependency lock files, installation, and updating pinned dependencies, including supported Python and platform assumptions.