scripts/install
raw| 1 | #!/bin/sh -e |
| 2 | |
| 3 | # Use the Python executable provided from the `-p` option, or a default. |
| 4 | [ "$1" = "-p" ] && PYTHON=$2 || PYTHON="python3" |
| 5 | |
| 6 | REQUIREMENTS="requirements.txt" |
| 7 | VENV="venv" |
| 8 | |
| 9 | set -x |
| 10 | |
| 11 | if [ -z "$GITHUB_ACTIONS" ]; then |
| 12 | "$PYTHON" -m venv "$VENV" |
| 13 | PIP="$VENV/bin/pip" |
| 14 | else |
| 15 | PIP="pip" |
| 16 | fi |
| 17 | |
| 18 | "$PIP" install -U pip |
| 19 | "$PIP" install -r "$REQUIREMENTS" |