Skip to content

Replace --no-cache-dir with PIP_NO_CACHE_DIR=1#212

Merged
radarhere merged 1 commit intopython-pillow:mainfrom
hugovk:PIP_NO_CACHE_DIR
Sep 9, 2024
Merged

Replace --no-cache-dir with PIP_NO_CACHE_DIR=1#212
radarhere merged 1 commit intopython-pillow:mainfrom
hugovk:PIP_NO_CACHE_DIR

Conversation

@hugovk
Copy link
Copy Markdown
Member

@hugovk hugovk commented Aug 9, 2024

Makes the pip install commands a bit shorter and easier to read.

Also add PIP_DISABLE_PIP_VERSION_CHECK=1, prevents warnings like this that sometimes shows up:

WARNING: You are using pip version 22.0.4; however, version 24.2 is available.
You should consider upgrading via the '/usr/local/bin/python3.9 -m pip install --upgrade pip' command.

Also use ARG instead of ENV:

  • ARG - only available during the build
  • ENV - also available inside the image

https://vsupalov.com/docker-arg-env-variable-guide/#arg-and-env
https://docs.docker.com/build/building/variables/

@radarhere
Copy link
Copy Markdown
Member

The 'wheel-build' job failures here would be fixed by python-pillow/Pillow#8293

@radarhere
Copy link
Copy Markdown
Member

Rather than ignoring the warning, is there a reason we don't upgrade pip first?

@hugovk
Copy link
Copy Markdown
Member Author

hugovk commented Aug 10, 2024

Hmm, we could do, although we're currently getting the warning here:

RUN bash -c "python3.9 -m pip install virtualenv \
&& python3.9 -m virtualenv --system-site-packages /vpy3 \
&& /vpy3/bin/pip install --no-cache-dir --upgrade pip \
&& /vpy3/bin/pip install --no-cache-dir cffi olefile pytest pytest-cov pytest-timeout \
&& /vpy3/bin/pip install --no-cache-dir numpy --only-binary=:all: || true \
&& chown -R pillow:pillow /vpy3"

We only use system pip to install virtualenv, then we do upgrade pip inside the virtualenv before installing other stuff.

@radarhere radarhere merged commit 0d6502d into python-pillow:main Sep 9, 2024
@hugovk hugovk deleted the PIP_NO_CACHE_DIR branch September 9, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants