diff --git a/CHANGELOG.md b/CHANGELOG.md index fe720f12bcf3c870156516261247344535a6d407..108a0eabbd91650676615e94fed68baf9291c879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,11 @@ # Python Buildpack Changelog -# 140 (2018-10-X) +# 140 (2018-10-09) -Add an `OVERRIDDEN_PIPENV_VERSION` option to override the version of Pipenv -used in the buildpack -Upgrade the `DEFAULT_PIPENV_VERSION` to `2018.7.1` +Add support for detecting SLUGIFY_USES_TEXT_UNIDECODE, which is required to +install Apache Airflow version 1.10 or higher. - -# 139 (2018-10-8) +# 139 (2018-10-08) Improvements to Python install messaging diff --git a/bin/steps/pip-install b/bin/steps/pip-install index 1589d87fbc8d30e63be9b723138e16abde123046..5de8e3db529ac27516124014ec32daf2bb6dc924 100755 --- a/bin/steps/pip-install +++ b/bin/steps/pip-install @@ -8,10 +8,24 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then # Install dependencies with Pip. puts-step "Installing requirements with pip" - # Set PIP_EXTRA_INDEX_URL + # Set Pip env vars + # This reads certain environment variables set on the Heroku app config + # and makes them accessible to the pip install process. + # + # PIP_EXTRA_INDEX_URL allows for an alternate pypi URL to be used. if [[ -r $ENV_DIR/PIP_EXTRA_INDEX_URL ]]; then PIP_EXTRA_INDEX_URL="$(cat "$ENV_DIR/PIP_EXTRA_INDEX_URL")" export PIP_EXTRA_INDEX_URL + mcount "buildvar.PIP_EXTRA_INDEX_URL" + fi + + set +e + + # Set SLUGIFY_USES_TEXT_UNIDECODE, required for Airflow versions >=1.10 + if [[ -r $ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE ]]; then + SLUGIFY_USES_TEXT_UNIDECODE="$(cat "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE")" + export SLUGIFY_USES_TEXT_UNIDECODE + mcount "buildvar.SLUGIFY_USES_TEXT_UNIDECODE" fi set +e diff --git a/bin/steps/pipenv b/bin/steps/pipenv index 608b9ecd7a4b20e88b226fcfdc7db88297b7e198..5e88c77134fb73fa2fbc5b94d9c153b26cc325ab 100755 --- a/bin/steps/pipenv +++ b/bin/steps/pipenv @@ -30,10 +30,22 @@ if [ ! "$SKIP_PIPENV_INSTALL" ]; then # Skip pip install, later. export SKIP_PIP_INSTALL=1 - # Set PIP_EXTRA_INDEX_URL + # Set Pip env vars + # This reads certain environment variables set on the Heroku app config + # and makes them accessible to the pip install process. + # + # PIP_EXTRA_INDEX_URL allows for an alternate pypi URL to be used. if [[ -r $ENV_DIR/PIP_EXTRA_INDEX_URL ]]; then PIP_EXTRA_INDEX_URL="$(cat "$ENV_DIR/PIP_EXTRA_INDEX_URL")" export PIP_EXTRA_INDEX_URL + mcount "buildvar.PIP_EXTRA_INDEX_URL" + fi + + # Set SLUGIFY_USES_TEXT_UNIDECODE, required for Airflow versions >=1.10 + if [[ -r $ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE ]]; then + SLUGIFY_USES_TEXT_UNIDECODE="$(cat "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE")" + export SLUGIFY_USES_TEXT_UNIDECODE + mcount "buildvar.SLUGIFY_USES_TEXT_UNIDECODE" fi export DEFAULT_PIPENV_VERSION="2018.7.1" diff --git a/test/fixtures/airflow/requirements.txt b/test/fixtures/airflow/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..f59ffb9527d3615df1b362ab1f065daf98fe1edf --- /dev/null +++ b/test/fixtures/airflow/requirements.txt @@ -0,0 +1 @@ +apache-airflow==1.10 diff --git a/test/run b/test/run index 5277176bc3f37820537cb54b00fad75a4fbccf5d..f6368161bae2719f3f75e8fa4d18febfe1fef5bd 100755 --- a/test/run +++ b/test/run @@ -1,5 +1,12 @@ #!/usr/bin/env bash +testAirflow() { + export SLUGIFY_USES_TEXT_UNIDECODE="yes" + compile "airflow" + assertCaptured "apache-airflow==1.10" + assertCapturedSuccess +} + testPipenv() { compile "pipenv" assertCapturedSuccess