diff --git a/bin/compile b/bin/compile index 01c1fd5483704935136cf90008175eadff0dc902..c300c77e9a8719a95a2cea7251733720308e1c1d 100755 --- a/bin/compile +++ b/bin/compile @@ -40,11 +40,8 @@ PIP_VERSION="9.0.1" export WARNINGS_LOG=$(mktemp) export RECOMMENDED_PYTHON_VERSION=$DEFAULT_PYTHON_VERSION -# Setup bpwatch -export PATH=$PATH:$ROOT_DIR/vendor/:$ROOT_DIR/vendor/bpwatch -LOGPLEX_KEY="t.b90d9d29-5388-4908-9737-b4576af1d4ce" -export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json -BUILDPACK_VERSION=v28 +# Add vendor to path. +export PATH=$PATH:$ROOT_DIR/vendor/ # Setup pip-pop (pip-diff) export PATH=$PATH:$ROOT_DIR/vendor/pip-pop @@ -59,12 +56,6 @@ unset GIT_DIR PYTHONHOME PYTHONPATH unset RECEIVE_DATA RUN_KEY BUILD_INFO DEPLOY LOG_TOKEN DYNO unset CYTOKINE_LOG_FILE GEM_PATH -# Setup buildpack instrumentation. -bpwatch init $LOGPLEX_KEY -bpwatch build python $BUILDPACK_VERSION $REQUEST_ID - -bpwatch start compile - # Syntax sugar. source $BIN_DIR/utils @@ -102,9 +93,7 @@ if [[ ! -f Procfile ]]; then fi # Experimental pre_compile hook. -bpwatch start pre_compile - source $BIN_DIR/steps/hooks/pre_compile -bpwatch stop pre_compile +source $BIN_DIR/steps/hooks/pre_compile # Sticky runtimes. if [ -f $CACHE_DIR/.heroku/python-version ]; then @@ -130,25 +119,21 @@ fi mkdir -p $CACHE_DIR # Purge "old-style" virtualenvs. -bpwatch start clear_old_venvs - [ -d $CACHE_DIR/$LEGACY_TRIGGER ] && rm -fr $CACHE_DIR/.heroku/bin $CACHE_DIR/.heroku/lib $CACHE_DIR/.heroku/include - [ -d $CACHE_DIR/$VIRTUALENV_LOC ] && rm -fr $CACHE_DIR/.heroku/venv $CACHE_DIR/.heroku/src -bpwatch stop clear_old_venvs +[ -d $CACHE_DIR/$LEGACY_TRIGGER ] && rm -fr $CACHE_DIR/.heroku/bin $CACHE_DIR/.heroku/lib $CACHE_DIR/.heroku/include +[ -d $CACHE_DIR/$VIRTUALENV_LOC ] && rm -fr $CACHE_DIR/.heroku/venv $CACHE_DIR/.heroku/src # Restore old artifacts from the cache. -bpwatch start restore_cache - mkdir -p .heroku - - cp -R $CACHE_DIR/.heroku/python .heroku/ &> /dev/null || true - cp -R $CACHE_DIR/.heroku/python-stack .heroku/ &> /dev/null || true - cp -R $CACHE_DIR/.heroku/python-version .heroku/ &> /dev/null || true - cp -R $CACHE_DIR/.heroku/vendor .heroku/ &> /dev/null || true - cp -R $CACHE_DIR/.heroku/venv .heroku/ &> /dev/null || true - if [[ -d $CACHE_DIR/.heroku/src ]]; then - cp -R $CACHE_DIR/.heroku/src .heroku/ &> /dev/null || true - fi +mkdir -p .heroku + +cp -R $CACHE_DIR/.heroku/python .heroku/ &> /dev/null || true +cp -R $CACHE_DIR/.heroku/python-stack .heroku/ &> /dev/null || true +cp -R $CACHE_DIR/.heroku/python-version .heroku/ &> /dev/null || true +cp -R $CACHE_DIR/.heroku/vendor .heroku/ &> /dev/null || true +cp -R $CACHE_DIR/.heroku/venv .heroku/ &> /dev/null || true +if [[ -d $CACHE_DIR/.heroku/src ]]; then + cp -R $CACHE_DIR/.heroku/src .heroku/ &> /dev/null || true +fi -bpwatch stop restore_cache mkdir -p $(dirname $PROFILE_PATH) mkdir -p /app/.heroku/src @@ -221,9 +206,7 @@ set-default-env PYTHONPATH /app/ cp $ROOT_DIR/vendor/python.gunicorn.sh $GUNICORN_PROFILE_PATH # Experimental post_compile hook. -bpwatch start post_compile - source $BIN_DIR/steps/hooks/post_compile -bpwatch stop post_compile +source $BIN_DIR/steps/hooks/post_compile set +e # rewrite build dir in egg links to /app so things are found at runtime @@ -236,26 +219,20 @@ find .heroku/python/lib-python/*/site-packages/ -name "*.pth" -print0 2> /dev/n set -e # Store new artifacts in cache. -bpwatch start dump_cache - - rm -rf $CACHE_DIR/.heroku/python - rm -rf $CACHE_DIR/.heroku/python-version - rm -rf $CACHE_DIR/.heroku/python-stack - rm -rf $CACHE_DIR/.heroku/vendor - rm -rf $CACHE_DIR/.heroku/venv - rm -rf $CACHE_DIR/.heroku/src - - mkdir -p $CACHE_DIR/.heroku - cp -R .heroku/python $CACHE_DIR/.heroku/ - cp -R .heroku/python-version $CACHE_DIR/.heroku/ - cp -R .heroku/python-stack $CACHE_DIR/.heroku/ &> /dev/null || true - cp -R .heroku/vendor $CACHE_DIR/.heroku/ &> /dev/null || true - cp -R .heroku/venv $CACHE_DIR/.heroku/ &> /dev/null || true - if [[ -d .heroku/src ]]; then - cp -R .heroku/src $CACHE_DIR/.heroku/ &> /dev/null || true - fi - -bpwatch stop dump_cache - -# Fin. -bpwatch stop compile + +rm -rf $CACHE_DIR/.heroku/python +rm -rf $CACHE_DIR/.heroku/python-version +rm -rf $CACHE_DIR/.heroku/python-stack +rm -rf $CACHE_DIR/.heroku/vendor +rm -rf $CACHE_DIR/.heroku/venv +rm -rf $CACHE_DIR/.heroku/src + +mkdir -p $CACHE_DIR/.heroku +cp -R .heroku/python $CACHE_DIR/.heroku/ +cp -R .heroku/python-version $CACHE_DIR/.heroku/ +cp -R .heroku/python-stack $CACHE_DIR/.heroku/ &> /dev/null || true +cp -R .heroku/vendor $CACHE_DIR/.heroku/ &> /dev/null || true +cp -R .heroku/venv $CACHE_DIR/.heroku/ &> /dev/null || true +if [[ -d .heroku/src ]]; then + cp -R .heroku/src $CACHE_DIR/.heroku/ &> /dev/null || true +fi diff --git a/bin/steps/collectstatic b/bin/steps/collectstatic index f8f63f5b9464299c164d9e1ea860d42e08dd6a07..98444cd9fbe51e8da7deaa4f60d814cdd1d36bfe 100755 --- a/bin/steps/collectstatic +++ b/bin/steps/collectstatic @@ -22,8 +22,6 @@ MANAGE_FILE=${MANAGE_FILE:-fakepath} # Ensure that Django is explicitly specified in requirements.txt pip-grep -s requirements.txt django Django && DJANGO_INSTALLED=1 -bpwatch start collectstatic # metrics collection - if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALLED" ]; then set +e @@ -63,5 +61,3 @@ if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALL echo fi - -bpwatch stop collectstatic # metrics collection diff --git a/bin/steps/cryptography b/bin/steps/cryptography index 3c526c3e4fbec1f08bedc8263bb01ae030f318eb..8a507999d05256b7dad9a95ea553b7b2ab7fc3c9 100755 --- a/bin/steps/cryptography +++ b/bin/steps/cryptography @@ -17,8 +17,6 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH" # Syntax sugar. source $BIN_DIR/utils -bpwatch start libffi_install - # If a package using cffi exists within requirements, use vendored libffi. if (pip-grep -s requirements.txt argon2-cffi bcrypt cffi cryptography django[argon2] Django[argon2] django[bcrypt] Django[bcrypt] PyNaCl pyOpenSSL PyOpenSSL requests[security] misaka &> /dev/null) then @@ -31,5 +29,3 @@ if (pip-grep -s requirements.txt argon2-cffi bcrypt cffi cryptography django[arg export LIBFFI=$(pwd)/vendor fi - -bpwatch stop libffi_install diff --git a/bin/steps/gdal b/bin/steps/gdal index 39f3bd3519e8ce5050c79552a946bcbf861bced2..7275cc4b988777458bcd2318f0da513bdb952b2d 100755 --- a/bin/steps/gdal +++ b/bin/steps/gdal @@ -17,8 +17,6 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH" # Syntax sugar. source $BIN_DIR/utils -bpwatch start gdal_install - # If GDAL exists within requirements, use vendored gdal. if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then @@ -31,5 +29,3 @@ if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then export GDAL=$(pwd)/vendor fi - -bpwatch stop gdal_install diff --git a/bin/steps/geo-libs b/bin/steps/geo-libs index f458861e8702bda851a209a6c7c6cc536d3bc32b..7c4fdcab010c0e3abfa26e182cadedba2d44a7f8 100755 --- a/bin/steps/geo-libs +++ b/bin/steps/geo-libs @@ -19,8 +19,6 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH" # Syntax sugar. source $BIN_DIR/utils -bpwatch start geo_libs_install - # If GDAL exists within requirements, use vendored gdal. if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then @@ -35,5 +33,3 @@ if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then export GDAL=$(pwd)/vendor fi - -bpwatch stop geo_libs_install diff --git a/bin/steps/mercurial b/bin/steps/mercurial index c7d7bf117a3406a99c6376d6bb9452312b24eb4a..cd4ad707b6cd0d4acbceb2df161ab6e98e457df7 100755 --- a/bin/steps/mercurial +++ b/bin/steps/mercurial @@ -1,6 +1,4 @@ # Install Mercurial if it appears to be required. if (grep -Fiq "hg+" requirements.txt) then - bpwatch start mercurial_install /app/.heroku/python/bin/pip install mercurial | cleanup | indent - bpwatch stop mercurial_install fi diff --git a/bin/steps/nltk b/bin/steps/nltk index a8d5fdb780cc506df9e5a70c78e27e060ae8163d..ec44a4845ffe72f4317df7cedd2f1c16c21f7abc 100755 --- a/bin/steps/nltk +++ b/bin/steps/nltk @@ -12,8 +12,6 @@ # Syntax sugar. source $BIN_DIR/utils -bpwatch start nltk_download - # Check that nltk was installed by pip, otherwise obviously not needed python -m nltk.downloader -h >/dev/null 2>&1 if [ $? -eq 0 ]; then @@ -29,5 +27,3 @@ if [ $? -eq 0 ]; then fi fi - -bpwatch stop nltk_download diff --git a/bin/steps/pip-install b/bin/steps/pip-install index 739e5497fe2bda0b36b9b379858e61639508e302..6cb5655ad518b8dc836308916061f89206b6757e 100755 --- a/bin/steps/pip-install +++ b/bin/steps/pip-install @@ -13,9 +13,6 @@ find .heroku/python/lib-python/*/site-packages/ -name "*.egg-link" -print0 2> /d find .heroku/python/lib-python/*/site-packages/ -name "*.pth" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#/app/#/$(pwd)/#" &> /dev/null set -e -[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install -[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first - set +e /app/.heroku/python/bin/pip install -r $BUILD_DIR/requirements.txt --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee $WARNINGS_LOG | cleanup | indent PIP_STATUS="${PIPESTATUS[0]}" @@ -32,7 +29,4 @@ fi cp requirements.txt .heroku/python/requirements-declared.txt /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt -[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install -[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first - echo diff --git a/bin/steps/pip-uninstall b/bin/steps/pip-uninstall index 3e41d1b96466b4265272146b06724ada4c7f1668..ed4a1370663c67e01dc85b89a25d9664899f24ee 100755 --- a/bin/steps/pip-uninstall +++ b/bin/steps/pip-uninstall @@ -1,6 +1,6 @@ set +e # Install dependencies with Pip. -bpwatch start pip_uninstall + if [[ -f .heroku/python/requirements-declared.txt ]]; then cp .heroku/python/requirements-declared.txt requirements-declared.txt @@ -14,5 +14,4 @@ if [[ -f .heroku/python/requirements-declared.txt ]]; then /app/.heroku/python/bin/pip uninstall -r .heroku/python/requirements-stale.txt -y --exists-action=w | cleanup | indent fi fi -bpwatch stop pip_uninstall set -e diff --git a/bin/steps/pylibmc b/bin/steps/pylibmc index 1ae691452d6b5467cec7d485fd8301cadd451d23..89625aa9bd2c14ffcfe6f10f66fb560b0d64e7e3 100755 --- a/bin/steps/pylibmc +++ b/bin/steps/pylibmc @@ -15,9 +15,6 @@ VENDORED_MEMCACHED="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor # Syntax sugar. source $BIN_DIR/utils - -bpwatch start pylibmc_install - # If pylibmc exists within requirements, use vendored libmemcached. if (pip-grep -s requirements.txt pylibmc &> /dev/null) then @@ -30,5 +27,3 @@ if (pip-grep -s requirements.txt pylibmc &> /dev/null) then export LIBMEMCACHED=$(pwd)/vendor fi - -bpwatch stop pylibmc_install diff --git a/bin/steps/python b/bin/steps/python index c47f3e268e16cf89ce45bc23cffce48bdee0783a..dc9c53b42ab836d6aaabe6b74f52908c0340d98b 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -4,25 +4,20 @@ PYTHON_VERSION=$(cat runtime.txt) # Install Python. if [ -f .heroku/python-version ]; then if [ ! $(cat .heroku/python-version) = $PYTHON_VERSION ]; then - bpwatch start uninstall_python - puts-step "Found $(cat .heroku/python-version), removing" - rm -fr .heroku/python - bpwatch stop uninstall_python + puts-step "Found $(cat .heroku/python-version), removing" + rm -fr .heroku/python else SKIP_INSTALL=1 fi fi if [ ! $STACK = $CACHED_PYTHON_STACK ]; then - bpwatch start uninstall_python - rm -fr .heroku/python .heroku/python-stack .heroku/vendor - unset SKIP_INSTALL - bpwatch stop uninstall_python + rm -fr .heroku/python .heroku/python-stack .heroku/vendor + unset SKIP_INSTALL fi if [ ! "$SKIP_INSTALL" ]; then - bpwatch start install_python puts-step "Installing $PYTHON_VERSION" # Prepare destination directory. @@ -35,8 +30,6 @@ if [ ! "$SKIP_INSTALL" ]; then exit 1 fi - bpwatch stop install_python - # Record for future reference. echo $PYTHON_VERSION > .heroku/python-version echo $STACK > .heroku/python-stack @@ -49,19 +42,12 @@ fi if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then WORKING_DIR=$(pwd) - bpwatch start prepare_environment - TMPTARDIR=$(mktemp -d) trap "rm -rf $TMPTARDIR" RETURN - bpwatch start install_pip - - puts-step "Bootstrapping pip" - python $ROOT_DIR/vendor/get-pip.py - - bpwatch stop install_pip + puts-step "Bootstrapping pip" + python $ROOT_DIR/vendor/get-pip.py - bpwatch stop prepare_environment fi set -e diff --git a/test/fixtures/pipenv/Pipfile b/test/fixtures/pipenv/Pipfile index 1a2a788233e89f7590f76f1327828174903434a1..317d2dddd5fd7f1f70bdaeb4035bd5d6850a6bff 100644 --- a/test/fixtures/pipenv/Pipfile +++ b/test/fixtures/pipenv/Pipfile @@ -1,2 +1,2 @@ [packages] -maya = "*" +"delegator.py" = "*" diff --git a/vendor/bpwatch/bpwatch b/vendor/bpwatch/bpwatch deleted file mode 100755 index 8923f72954db564615e9cb08e21dd3a0077a2d43..0000000000000000000000000000000000000000 --- a/vendor/bpwatch/bpwatch +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python - - -import os -import sys - - -DEFAULT_PATH = '{0}.zip'.format(os.path.abspath(__file__)) -BPWATCH_DISTRO_PATH = os.environ.get('BPWATCH_DISTRO_PATH', DEFAULT_PATH) - -sys.path.insert(0, BPWATCH_DISTRO_PATH) - -import bp_cli -bp_cli.main() diff --git a/vendor/bpwatch/bpwatch.zip b/vendor/bpwatch/bpwatch.zip deleted file mode 100644 index 9d34563ae481d58d9a0bb45086cb9db1c430f9da..0000000000000000000000000000000000000000 Binary files a/vendor/bpwatch/bpwatch.zip and /dev/null differ