The image was 2.45GB, of which the venv is 1.73GB. The build was already multi-stage and already installed CPU-only torch, so the remaining weight was not build tooling - it was payload inside the installed packages that the running service can never execute. Removed in the build stage, before the runtime stage copies /opt/venv, so the bytes never enter the final image: - bundled test suites (~237MB; torch/test is 83MB, pandas/tests 40MB) - torch/include (62MB), C++ headers for compiling against libtorch - torch/bin (50MB), gtest binaries and protoc; torch_shm_manager is kept pytest and httpx2 move to requirements-dev.txt: the image copies app/, cli/, scripts/, data/ and serve.py, never tests/, so the test stack was unusable there regardless. sympy was checked and deliberately kept - 'import sentence_transformers' does pull it in through torch.fx, so removing it would break embeddings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 lines
658 B
Plaintext
15 lines
658 B
Plaintext
# Test-only dependencies, kept out of requirements.txt so the Docker image does
|
|
# not ship them - the container has no tests/ directory to run anyway (the
|
|
# Dockerfile copies app/, cli/, scripts/, data/ and serve.py, nothing else).
|
|
#
|
|
# For development, install both files:
|
|
# pip install -r requirements.txt -r requirements-dev.txt
|
|
|
|
pytest>=8.3.3
|
|
|
|
# Starlette's TestClient deprecates the httpx 0.x backend and emits a
|
|
# StarletteDeprecationWarning without this. pytest.ini turns warnings into
|
|
# errors, so it is a hard requirement of the suite, not a nicety. Test-only:
|
|
# the application itself uses the `httpx` pinned in requirements.txt.
|
|
httpx2>=2.10.0
|