-
Notifications
You must be signed in to change notification settings - Fork 19
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
Pip no cache dir #216
Pip no cache dir #216
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,9 +1,9 @@ | ||||||
--- a/assemble 2020-10-31 11:55:38.000000000 +0100 | ||||||
+++ b/assemble 2020-11-25 22:32:16.739312082 +0100 | ||||||
@@ -18,38 +18,8 @@ | ||||||
fi | ||||||
--- a/assemble 2021-09-12 14:46:51.130401513 -0400 | ||||||
+++ b/assemble 2021-09-12 14:49:27.881361622 -0400 | ||||||
@@ -14,38 +14,8 @@ | ||||||
python3.9 -m venv $1 | ||||||
} | ||||||
|
||||||
-# Install pipenv or micropipenv to the separate virtualenv to isolate it | ||||||
-# from system Python packages and packages in the main | ||||||
-# virtualenv. Executable is simlinked into ~/.local/bin | ||||||
|
@@ -27,7 +27,7 @@ | |||||
-} | ||||||
- | ||||||
set -e | ||||||
|
||||||
-# First of all, check that we don't have disallowed combination of ENVs | ||||||
-if [[ ! -z "$ENABLE_PIPENV" && ! -z "$ENABLE_MICROPIPENV" ]]; then | ||||||
- echo "ERROR: Pipenv and micropipenv cannot be enabled at the same time!" | ||||||
|
@@ -39,10 +39,10 @@ | |||||
shopt -s dotglob | ||||||
echo "---> Installing application source ..." | ||||||
mv /tmp/src/* "$HOME" | ||||||
@@ -57,16 +27,6 @@ | ||||||
@@ -53,50 +23,19 @@ | ||||||
# set permissions for any installed artifacts | ||||||
fix-permissions /opt/app-root -P | ||||||
|
||||||
-# We have to first upgrade pip to at least 19.3 because: | ||||||
-# * pip < 9 does not support different packages' versions for Python 2/3 | ||||||
-# * pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 wheels | ||||||
|
@@ -55,11 +55,14 @@ | |||||
- | ||||||
if [[ ! -z "$UPGRADE_PIP_TO_LATEST" ]]; then | ||||||
echo "---> Upgrading pip to latest version ..." | ||||||
if ! pip install -U pip setuptools wheel; then | ||||||
@@ -75,28 +35,7 @@ | ||||||
- if ! pip install -U pip setuptools wheel; then | ||||||
+ if ! pip install --no-cache-dir -U pip setuptools wheel; then | ||||||
echo "WARNING: Installation of the latest pip,setuptools and wheel failed, trying again from official PyPI with pip --isolated install" | ||||||
- pip install --isolated -U pip setuptools wheel | ||||||
+ pip install --no-cache-dir --isolated -U pip setuptools wheel | ||||||
fi | ||||||
fi | ||||||
|
||||||
-if [[ ! -z "$ENABLE_PIPENV" ]]; then | ||||||
- if [[ ! -z "$PIN_PIPENV_VERSION" ]]; then | ||||||
- # Add == as a prefix to pipenv version, if defined | ||||||
|
@@ -83,6 +86,11 @@ | |||||
- pip install -r requirements.txt | ||||||
-fi | ||||||
+thamos install | ||||||
|
||||||
if [[ -f setup.py && -z "$DISABLE_SETUP_PY_PROCESSING" ]]; then | ||||||
echo "---> Installing application ..." | ||||||
- pip install . | ||||||
+ pip install --no-cache-dir . | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could eventually also include
Suggested change
By the way, pip also supports passing options as environment variables: https://pip.pypa.io/en/stable/topics/configuration/#environment-variables We could set all the options globally and all the pip calls would inherit this configuration in the container image. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hum, good question... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Out of bullets 🔫 👍🏻 |
||||||
fi | ||||||
|
||||||
if should_collectstatic; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thamos uses pip under the hood, it can pass any options to pip as necessary:
https://github.com/thoth-station/thamos/#installing-requirements
When using environment variables (see bellow), the options would be automatically propagated.