certbot/tools/pip_install.sh
Brad Warren 962879c35c Remove dependency on git from pip_install.sh. (#4770)
* Remove dependency on git from pip_install.sh.

Using git allowed this file to continue to work even if it was moved to another
directory. This slight increase in robustness wasn't worth it though as it
broke our development Dockerfile (see #4703), the certbot website's Dockerfile
(see certbot/website#226), and our test farm tests (see
certbot/tests/letstest/scripts/test_apache2.sh for an example that calls
tools/venv.sh without installing git). Rather than continuing to find and patch
these things, let's just allow this script to fail if it's moved rather than
propagating the git dependency all over the place.

* Add readlink.py.

This is the equivalent of `readlink -f` on many Linux systems. This is useful
as there are often differences in readlink on different platforms.

* Use readlink.py in pip_install.sh.

This allows us to work around differences in readlink on macOS.
2017-06-05 17:51:45 -07:00

14 lines
595 B
Bash
Executable file

#!/bin/sh -e
# pip installs packages using Certbot's requirements file as constraints
# get the root of the Certbot repo
my_path=$("$(dirname $0)/readlink.py" $0)
repo_root=$(dirname $(dirname $my_path))
requirements="$repo_root/letsencrypt-auto-source/pieces/dependency-requirements.txt"
constraints=$(mktemp)
trap "rm -f $constraints" EXIT
# extract pinned requirements without hashes
sed -n -e 's/^\([^[:space:]]*==[^[:space:]]*\).*$/\1/p' $requirements > $constraints
# install the requested packages using the pinned requirements as constraints
pip install --constraint $constraints "$@"