update-locked-requirements: Add py2 option to compile requirements.

In this commit we add a new option which could be used to specify
python version. When 'py2' is specified, future/futures are not
removed from the requirements lock file generated.
This commit is contained in:
Aditya Bansal
2017-11-11 22:24:19 +05:30
committed by Tim Abbott
parent 79576797b0
commit 66060c703c

View File

@@ -10,6 +10,7 @@ source /srv/zulip-py3-venv/bin/activate
compile_requirements () {
source="$1"
output="$2"
python_version="$3"
pip-compile --output-file "$output" "$source"
@@ -19,9 +20,11 @@ compile_requirements () {
# in the output of pip-compile it's no longer needed.
sed -i 's/-e //' "$output"
# pip-tools bug; future, futures are obsolete in python3
sed -i '/futures==/d' "$output"
sed -i '/future==/d' "$output"
if [ "$python_version" != "py2" ]; then
# pip-tools bug; future, futures are obsolete in python3
sed -i '/futures==/d' "$output"
sed -i '/future==/d' "$output"
fi
(
cat <<EOF