mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 15:00:19 +00:00
test clear cache and cache requirements.txt
This commit is contained in:
@@ -47,6 +47,8 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
|
||||
if [ ! -f "$BUILD_DIR/.heroku/python/bin/pip" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
/app/.heroku/python/bin/pip install -r "$BUILD_DIR/requirements.txt" --exists-action=w --src=/app/.heroku/src --disable-pip-version-check | tee "$WARNINGS_LOG" | cleanup | indent
|
||||
PIP_STATUS="${PIPESTATUS[0]}"
|
||||
set -e
|
||||
@@ -60,6 +62,10 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
|
||||
|
||||
# Cache pip packages ourselves
|
||||
## TODO: Update to cache pip's built-in cache
|
||||
|
||||
# Update cached version of requirements.txt
|
||||
cp -R $BUILD_DIR/requirements.txt "$CACHE_DIR/.heroku/requirements.txt"
|
||||
|
||||
cp requirements.txt .heroku/python/requirements-declared.txt
|
||||
/app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt
|
||||
|
||||
|
||||
+10
-1
@@ -96,6 +96,15 @@ if [ -f .heroku/python-version ]; then
|
||||
fi
|
||||
|
||||
|
||||
|
||||
echo "$(diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt")"
|
||||
|
||||
# Remove python dependencies
|
||||
if [[ ! -f "$CACHE_DIR/.heroku/requirements.txt" ]] || [[ diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt" ]]; then
|
||||
puts-step "Clearing cached dependencies"
|
||||
rm -rf .heroku/python
|
||||
fi
|
||||
|
||||
if [ ! "$SKIP_INSTALL" ]; then
|
||||
puts-step "Installing $PYTHON_VERSION"
|
||||
|
||||
@@ -129,7 +138,7 @@ if ! curl -s "${GETPIP_URL}" -o "$GETPIP_PY" &> /dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If Pip isn't up to date:
|
||||
# If a new Python has been installed or Pip isn't up to date:
|
||||
if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_UPDATE* ]]; then
|
||||
|
||||
puts-step "Installing pip"
|
||||
|
||||
Reference in New Issue
Block a user