certbot/tools/pip_install.sh
Brad Warren a1aea021e7 Pin dependencies in oldest tests (#5316)
* Add tools/merge_requirements.py

* Revert "Fix oldest tests by pinning Google DNS deps (#5000)"

This reverts commit f68fba2be2.

* Add tools/oldest_constraints.txt

* Remove oldest constraints from tox.ini

* Rename dev constraints file

* Update tools/pip_install.sh

* Update install_and_test.sh

* Fix pip_install.sh

* Don't cat when you can cp

* Add ng-httpsclient to dev constraints for oldest tests

* Bump tested setuptools version

* Update dev_constraints comment

* Better document oldest dependencies

* test against oldest versions we say we require

* Update dev constraints

* Properly handle empty lines

* Update constraints gen in pip_install

* Remove duplicated zope.component

* Reduce pyasn1-modules dependency

* Remove blank line

* pin back google-api-python-client

* pin back uritemplate

* pin josepy for oldest tests

* Undo changes to install_and_test.sh

* Update install_and_test.sh description

* use split instead of partition
2017-12-18 12:31:36 -08:00

26 lines
1.1 KiB
Bash
Executable file

#!/bin/bash -e
# pip installs packages using pinned package versions. If CERTBOT_OLDEST is set
# to 1, a combination of tools/oldest_constraints.txt and
# tools/dev_constraints.txt is used, otherwise, a combination of certbot-auto's
# requirements file and tools/dev_constraints.txt is used. The other file
# always takes precedence over tools/dev_constraints.txt.
# get the root of the Certbot repo
tools_dir=$(dirname $("$(dirname $0)/readlink.py" $0))
dev_constraints="$tools_dir/dev_constraints.txt"
merge_reqs="$tools_dir/merge_requirements.py"
test_constraints=$(mktemp)
trap "rm -f $test_constraints" EXIT
if [ "$CERTBOT_OLDEST" = 1 ]; then
cp "$tools_dir/oldest_constraints.txt" "$test_constraints"
else
repo_root=$(dirname "$tools_dir")
certbot_requirements="$repo_root/letsencrypt-auto-source/pieces/dependency-requirements.txt"
sed -n -e 's/^\([^[:space:]]*==[^[:space:]]*\).*$/\1/p' "$certbot_requirements" > "$test_constraints"
fi
set -x
# install the requested packages using the pinned requirements as constraints
pip install -q --constraint <("$merge_reqs" "$dev_constraints" "$test_constraints") "$@"