#!/usr/bin/env bash set -e # Make sure the Zulip dev virtualenv exists, and operate within it. if [ ! -d /srv/zulip-py3-venv ] || [ ! -d /srv/zulip-thumbor-venv ]; then ./tools/setup/setup_venvs.py fi compile_requirements () { source="$1" output="$2" python_version="$3" echo "Compiling $output" if [ "$python_version" == "py2" ]; then /srv/zulip-thumbor-venv/bin/pip-compile --quiet --allow-unsafe --generate-hashes --no-header --output-file "$output" "$source" else /srv/zulip-py3-venv/bin/pip-compile --quiet --allow-unsafe --generate-hashes --no-header --output-file "$output" "$source" fi cat - "$output" <]" exit ;; esac shift done fi compile_requirements requirements/dev.in "$OUTPUT_BASE_DIR/dev.txt" for name in pip prod mypy docs; do cp "$OUTPUT_BASE_DIR/dev.txt" "$OUTPUT_BASE_DIR/$name.txt" compile_requirements "requirements/$name.in" "$OUTPUT_BASE_DIR/$name.txt" done compile_requirements requirements/thumbor-dev.in "$OUTPUT_BASE_DIR/thumbor-dev.txt" py2 for name in pip2 thumbor; do cp "$OUTPUT_BASE_DIR/thumbor-dev.txt" "$OUTPUT_BASE_DIR/$name.txt" compile_requirements "requirements/$name.in" "$OUTPUT_BASE_DIR/$name.txt" py2 done