Disable pip cache in pre-commit container
/.cache/pip is owned by root; as UID 1001 pip emits a cache-permission warning. Container is ephemeral so caching has no value — disable it with PIP_NO_CACHE_DIR=1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,7 @@ docker run --rm \
|
|||||||
-e STAGED_FILES="$STAGED" \
|
-e STAGED_FILES="$STAGED" \
|
||||||
-u 1001:1001 \
|
-u 1001:1001 \
|
||||||
-e PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
-e PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||||
|
-e PIP_NO_CACHE_DIR=1 \
|
||||||
python:3.12-slim \
|
python:3.12-slim \
|
||||||
sh -c "python -m venv /tmp/venv && /tmp/venv/bin/pip install --quiet bandit && /tmp/venv/bin/python scripts/security_check.py"
|
sh -c "python -m venv /tmp/venv && /tmp/venv/bin/pip install --quiet bandit && /tmp/venv/bin/python scripts/security_check.py"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user