#!/usr/bin/env bash set -e # 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 compile_requirements () { source="$1" output="$2" python_version="$3" pip-compile --quiet --allow-unsafe --no-header --output-file "$output" "$source" if [ "$python_version" != "py2" ]; then # Remove an unnecessary future requirement declared by commonmark, # python-jose, and python-twitter. # https://github.com/readthedocs/commonmark.py/pull/188 # https://github.com/mpdavis/python-jose/pull/134 # https://github.com/bear/python-twitter/pull/614 sed -i 's/^future==/# &/' "$output" fi cat - "$output" <]" exit ;; esac shift done fi compile_requirements requirements/prod.in "$OUTPUT_BASE_DIR/prod.txt" compile_requirements requirements/dev.in "$OUTPUT_BASE_DIR/dev.txt" compile_requirements requirements/mypy.in "$OUTPUT_BASE_DIR/mypy.txt" compile_requirements requirements/docs.in "$OUTPUT_BASE_DIR/docs.txt" compile_requirements requirements/thumbor.in "$OUTPUT_BASE_DIR/thumbor.txt" py2