deps: Organize tools/update-locked-requirements a bit further.

A couple of remarks still reflected the Python 2 world; and the
"Remove the editable flag" comment was confusingly above a line
that it looks like it could be talking about, but isn't.
This commit is contained in:
Greg Price 2017-09-14 15:45:08 -07:00 committed by Tim Abbott
parent e98d7a6ee8
commit 806220cafa
1 changed files with 6 additions and 7 deletions

View File

@ -1,23 +1,22 @@
#!/usr/bin/env bash
set -e
# Check if zulip-.*venv in particular has been installed
# It is sufficient to check just for /srv/zulip-py3-venv because it must be
# present in both cases of py2 and py3
# Make sure the Zulip dev virtualenv exists, and operate within it.
if [ ! -d /srv/zulip-py3-venv ]; then
./tools/setup/setup_venvs.py
fi
source /srv/zulip-py3-venv/bin/activate
source /srv/zulip-py3-venv/bin/activate # Activate python3 virtualenv
pip-compile --output-file requirements/prod_lock.txt requirements/prod.txt
# Add the editable flag to mypy for the purpose of building the lockfile for
# dev.txt
sed -i 's/git/-e git/' requirements/mypy.txt
pip-compile --output-file requirements/dev_lock.txt requirements/dev.txt
# Remove the editable flag in the lock file for safer build
sed -i 's/-e git/git/' requirements/mypy.txt
sed -i 's/-e //' requirements/prod_lock.txt
sed -i 's/-e //' requirements/dev_lock.txt
# Remove the editable flag in the lock file for safer build
sed -i 's/-e //' requirements/prod_lock.txt requirements/dev_lock.txt
# pip-tools bug; future, futures are obsolete in python3
sed -i '/futures==/d' requirements/prod_lock.txt
sed -i '/future==/d' requirements/prod_lock.txt