test clear cache and cache requirements.txt

This commit is contained in:
Casey Faist
2020-03-19 16:20:30 -04:00
parent cc6a03aa54
commit f7c422e07d
2 changed files with 16 additions and 1 deletions
+6
View File
@@ -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
View File
@@ -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"