2017-10-19 22:37:22 +02:00
|
|
|
#!/bin/bash -eu
|
|
|
|
|
|
|
|
python_versions=(
|
|
|
|
2.6
|
|
|
|
2.7
|
|
|
|
3.5
|
|
|
|
3.6
|
2017-11-21 01:22:52 +01:00
|
|
|
3.7
|
2017-10-19 22:37:22 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
requirements=()
|
|
|
|
|
|
|
|
for requirement in *.txt; do
|
|
|
|
if [ "${requirement}" != "constraints.txt" ]; then
|
2017-10-20 17:48:01 +02:00
|
|
|
requirements+=("${requirement}")
|
2017-10-19 22:37:22 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for python_version in "${python_versions[@]}"; do
|
2017-10-20 17:48:01 +02:00
|
|
|
version_requirements=()
|
|
|
|
|
|
|
|
for requirement in "${requirements[@]}"; do
|
|
|
|
case "${python_version}" in
|
|
|
|
"2.6")
|
|
|
|
case "${requirement}" in
|
|
|
|
"integration.cloud.azure.txt") continue ;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
|
|
|
|
version_requirements+=("${requirement}")
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "==> Installing pip for python ${python_version} ..."
|
|
|
|
|
2017-10-19 22:37:22 +02:00
|
|
|
set -x
|
2018-01-09 19:02:41 +01:00
|
|
|
"python${python_version}" --version
|
2017-10-19 22:37:22 +02:00
|
|
|
"python${python_version}" /tmp/get-pip.py -c constraints.txt
|
2018-01-09 19:02:41 +01:00
|
|
|
"pip${python_version}" --version --disable-pip-version-check
|
2017-10-19 22:37:22 +02:00
|
|
|
set +x
|
2017-10-20 17:48:01 +02:00
|
|
|
|
|
|
|
echo "==> Installing requirements for python ${python_version} ..."
|
|
|
|
|
|
|
|
for requirement in "${version_requirements[@]}"; do
|
|
|
|
set -x
|
|
|
|
"pip${python_version}" install --disable-pip-version-check -c constraints.txt -r "${requirement}"
|
|
|
|
set +x
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "==> Checking for requirements conflicts for ${python_version} ..."
|
|
|
|
|
2018-03-20 16:54:16 +01:00
|
|
|
after=$("pip${python_version}" list --format=legacy)
|
2017-10-20 17:48:01 +02:00
|
|
|
|
|
|
|
for requirement in "${version_requirements[@]}"; do
|
|
|
|
before="${after}"
|
|
|
|
|
|
|
|
set -x
|
|
|
|
"pip${python_version}" install --disable-pip-version-check -c constraints.txt -r "${requirement}"
|
|
|
|
set +x
|
|
|
|
|
2018-03-20 16:54:16 +01:00
|
|
|
after=$("pip${python_version}" list --format=legacy)
|
2017-10-20 17:48:01 +02:00
|
|
|
|
|
|
|
if [ "${before}" != "${after}" ]; then
|
|
|
|
echo "==> Conflicts detected in requirements for python ${python_version}: ${requirement}"
|
|
|
|
echo ">>> Before"
|
|
|
|
echo "${before}"
|
|
|
|
echo ">>> After"
|
|
|
|
echo "${after}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "==> Finished with requirements for python ${python_version}."
|
2017-10-19 22:37:22 +02:00
|
|
|
done
|