mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
fc6698e597
Updates pip from 20.0.2 to 20.1.1 for Python 2.7 and Python 3.5+: https://pip.pypa.io/en/stable/news/#id40 The version used for Python 3.4 remains unchanged at 19.1.1, since it's the last version of pip that supports it. Pip has been updated to 20.1.1 rather than the recently released 20.2, since the latter has a few regressions and even though these will be fixed shortly in 20.2.1, we should let the changes soak for longer before picking them up. The `PIP_NO_PYTHON_VERSION_WARNING` environment variable has been set (equivalent to passing `--no-python-version-warning`) to prevent the Python 2.7 EOL warnings added in pip 20.1 from spamming the build log: https://github.com/pypa/pip/blob/20.1.1/src/pip/_internal/cli/base_command.py#L139-L154 This was set via environment variable rather than CLI flag, since: * otherwise we'd have to pass it to every pip invocation * older pip (such as the 19.1.1 used by Python 3.4) doesn't support this option and would error out due to an unknown CLI flag being passed, unless we added conditional flags throughout. The new pip wheel was uploaded to S3 using: ``` $ pip download --no-cache pip==20.1.1 Collecting pip==20.1.1 Downloading pip-20.1.1-py2.py3-none-any.whl (1.5 MB) Saved ./pip-20.1.1-py2.py3-none-any.whl Successfully downloaded pip $ aws s3 sync . s3://lang-python/common/ --exclude "*" --include "*.whl" --acl public-read --dryrun (dryrun) upload: ./pip-20.1.1-py2.py3-none-any.whl to s3://lang-python/common/pip-20.1.1-py2.py3-none-any.whl $ aws s3 sync . s3://lang-python/common/ --exclude "*" --include "*.whl" --acl public-read upload: ./pip-20.1.1-py2.py3-none-any.whl to s3://lang-python/common/pip-20.1.1-py2.py3-none-any.whl ``` Fixes #1005. @W-7659489@
227 lines
5.5 KiB
Bash
Executable File
227 lines
5.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Default Python Versions
|
|
# shellcheck source=bin/default_pythons
|
|
source "bin/default_pythons"
|
|
|
|
testPythonDefault() {
|
|
updateVersion "pythonDefault" $DEFAULT_PYTHON_VERSION
|
|
compile "pythonDefault"
|
|
assertCaptured $DEFAULT_PYTHON_VERSION
|
|
assertNotCaptured "security update"
|
|
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
}
|
|
|
|
testPython2() {
|
|
updateVersion "python2" $LATEST_27
|
|
echo $LATEST_27 > "runtime.txt"
|
|
compile "python2"
|
|
assertCaptured $LATEST_27
|
|
if [[ $(date "+%Y") > "2019" ]]; then
|
|
assertCaptured "python-2-7-eol-faq";
|
|
else
|
|
assertNotCaptured "python-2-7-eol-faq";
|
|
fi
|
|
assertNotCaptured "security update"
|
|
assertCaptured "Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
}
|
|
|
|
testPython2_warn() {
|
|
compile "python2_warn"
|
|
assertCaptured "python-2.7.15"
|
|
if [[ $(date "+%Y") > "2019" ]]; then
|
|
assertCaptured "python-2-7-eol-faq";
|
|
else
|
|
assertNotCaptured "python-2-7-eol-faq";
|
|
fi
|
|
assertCaptured "Only the latest version"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
}
|
|
|
|
testPython2_fail() {
|
|
compile "python2_fail"
|
|
assertCaptured "Aborting"
|
|
assertCapturedError
|
|
}
|
|
|
|
testPython3_4() {
|
|
compile "python3_4"
|
|
assertCaptured $LATEST_34
|
|
assertNotCaptured "security update"
|
|
assertCaptured "Installing pip 19.1.1, setuptools 43.0.0 and wheel 0.33.6"
|
|
# if cedar 14 and legacy binaries, fail. if cedar 14 and staging, succeed.
|
|
if [[ ! -n $USE_STAGING_BINARIES ]] && [[ $STACK == "cedar-14" ]]; then
|
|
assertCapturedError
|
|
# if heroku 18 and legacy binaries, succeed. if heroku 18 and staging, fail.
|
|
elif [[ -n $USE_STAGING_BINARIES ]] && [[ $STACK == "heroku-18" ]]; then
|
|
assertCapturedError
|
|
else
|
|
# all else succeed
|
|
assertCapturedSuccess
|
|
fi
|
|
}
|
|
|
|
testPython3_4_warn() {
|
|
compile "python3_4_warn"
|
|
assertCaptured "python-3.4.9"
|
|
assertCaptured "security update!"
|
|
# if heroku 18 and legacy binaries, succeed. if heroku 18 and staging, fail.
|
|
if [[ -n $USE_STAGING_BINARIES ]] && [[ $STACK == "heroku-18" ]]; then
|
|
assertCapturedError
|
|
else
|
|
# all else succeed
|
|
assertCapturedSuccess
|
|
fi
|
|
}
|
|
|
|
testPython3_4_fail() {
|
|
compile "python3_4_fail"
|
|
assertCaptured "Aborting"
|
|
assertCapturedError
|
|
}
|
|
|
|
testPython3_5() {
|
|
compile "python3_5"
|
|
assertCaptured $LATEST_35
|
|
assertNotCaptured "security update"
|
|
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
}
|
|
|
|
testPython3_5_warn() {
|
|
compile "python3_5_warn"
|
|
assertCaptured "python-3.5.6"
|
|
assertCaptured "security update!"
|
|
assertCapturedSuccess
|
|
}
|
|
|
|
testPython3_5_fail() {
|
|
compile "python3_5_fail"
|
|
assertCaptured "Aborting"
|
|
assertCapturedError
|
|
}
|
|
|
|
testPython3_6() {
|
|
updateVersion "python3_6" $LATEST_36
|
|
compile "python3_6"
|
|
assertCaptured $LATEST_36
|
|
assertNotCaptured "security update"
|
|
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
}
|
|
|
|
testPython3_6_warn() {
|
|
compile "python3_6_warn"
|
|
assertCaptured "python-3.6.7"
|
|
assertCaptured "security update!"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
}
|
|
|
|
testPython3_6_fail() {
|
|
compile "python3_6_fail"
|
|
assertCaptured "Aborting"
|
|
assertCapturedError
|
|
}
|
|
|
|
testPython3_7() {
|
|
updateVersion "python3_7" $LATEST_37
|
|
compile "python3_7"
|
|
if [[ $STACK = "cedar-14" ]]; then
|
|
assertCapturedError
|
|
else
|
|
assertNotCaptured "security update"
|
|
assertCaptured $LATEST_37
|
|
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
fi
|
|
}
|
|
|
|
testPython3_7_warn() {
|
|
compile "python3_7_warn"
|
|
if [[ $STACK = "cedar-14" ]]; then
|
|
assertCapturedError
|
|
else
|
|
assertCaptured "python-3.7.1"
|
|
assertCaptured "security update!"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
fi
|
|
}
|
|
|
|
testPython3_7_fail() {
|
|
compile "python3_7_fail"
|
|
assertCaptured "Aborting"
|
|
assertCapturedError
|
|
}
|
|
|
|
testPython3_7_warn() {
|
|
compile "python3_8_warn"
|
|
if [[ $STACK = "cedar-14" ]]; then
|
|
assertCapturedError
|
|
else
|
|
assertCaptured "python-3.8.0"
|
|
assertCaptured "security update!"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
fi
|
|
}
|
|
|
|
testPython3_8() {
|
|
updateVersion "python3_8" $LATEST_38
|
|
compile "python3_8"
|
|
if [[ $STACK = "cedar-14" ]]; then
|
|
assertCapturedError
|
|
else
|
|
assertNotCaptured "security update"
|
|
assertCaptured $LATEST_38
|
|
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
|
|
assertCaptured "Installing SQLite3"
|
|
assertCapturedSuccess
|
|
fi
|
|
}
|
|
|
|
testPython3_8_fail() {
|
|
compile "python3_8_fail"
|
|
assertCaptured "Aborting"
|
|
assertCapturedError
|
|
}
|
|
|
|
testPypy3_6() {
|
|
compile "pypy3_6"
|
|
if [[ $STACK = "cedar-14" ]]; then
|
|
assertCapturedError
|
|
else
|
|
assertCaptured "Installing pypy"
|
|
assertCaptured "$PYPY_36"
|
|
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
|
|
assertCapturedSuccess
|
|
fi
|
|
}
|
|
|
|
testPypy2_7() {
|
|
compile "pypy2_7"
|
|
if [[ $STACK = "cedar-14" ]]; then
|
|
assertCapturedError
|
|
else
|
|
assertCaptured "Installing pypy"
|
|
assertCaptured "$PYPY_27"
|
|
assertCaptured "Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2"
|
|
assertCapturedSuccess
|
|
fi
|
|
}
|
|
|
|
pushd $(dirname 0) >/dev/null
|
|
popd >/dev/null
|
|
|
|
source $(pwd)/test/utils
|
|
source $(pwd)/test/shunit2
|