File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -199,14 +199,15 @@ RUN ln -sf /usr/bin/python3 /usr/bin/python && \
199199 dist/inference_sdk*.whl \
200200 "setuptools<=75.5.0"
201201
202- # Remove test directories, development tools, and unnecessary packages to reduce image size (~500MB savings)
202+ # Remove test directories, development tools, and unnecessary packages to reduce image size
203203# This happens AFTER all package installations to ensure everything gets cleaned
204+ # Note: Keep numpy/torch test dirs (public APIs depend on them), remove from other packages
204205RUN cd /usr/local/lib/python3.10/dist-packages && \
205- find . -type d -name tests -exec rm -rf {} + 2>/dev/null || true && \
206206 find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \
207207 rm -rf debugpy* jupyterlab* jupyter_* notebook* ipython* ipykernel* || true && \
208- rm -rf torch/bin torch/include torch/test || true && \
208+ rm -rf torch/bin torch/include || true && \
209209 rm -rf onnx/backend/test onnx/test || true && \
210+ rm -rf scipy/*/tests pandas/tests || true && \
210211 rm -rf */examples */benchmarks */docs || true && \
211212 rm -rf skimage/data || true && \
212213 find . -name "*.pyi" -delete 2>/dev/null || true
You can’t perform that action at this time.
0 commit comments