-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PYTHONDONTWRITEBYTECODE #207
Comments
Played with this a little bit, and it looks like the Python build scripts create Additionally, |
FWIW |
Indeed! I did some experimentation: diff --git a/3.7/alpine3.10/Dockerfile b/3.7/alpine3.10/Dockerfile
index 05dfb5f..63c4bc2 100644
--- a/3.7/alpine3.10/Dockerfile
+++ b/3.7/alpine3.10/Dockerfile
@@ -152,14 +152,16 @@ RUN set -ex; \
wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \
echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \
\
+ export PYTHONDONTWRITEBYTECODE=1; \
python get-pip.py \
--disable-pip-version-check \
--no-cache-dir \
+ --no-compile \
"pip==$PYTHON_PIP_VERSION" \
; \
pip --version; \
\
- find /usr/local -depth \
+ echo find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \ Running |
Coming back to this with fresh eyes, I'm not convinced adding this makes our |
I think this could greatly simplify |
Yeah, that's fair -- I suppose it would make more sense to make that one of our post-build integration tests instead of part of the Edit: ... and merged in docker-library/official-images#11896 😄 |
@tianon Great news. Thank you for all the work) |
We should play with exporting
PYTHONDONTWRITEBYTECODE
instead of deleting thepyc
files after the fact!See also https://docs.python.org/3/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE and https://docs.python.org/2/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE.
The text was updated successfully, but these errors were encountered: