Skip to content

Commit

Permalink
Try using virtualenv for venv creation if possible
Browse files Browse the repository at this point in the history
In e035637 I flipped this to use `python -m venv` but some
environments (staging) don't have that, so let's restore the old
behavior of using `virtualenv`, but fall back to `python -m venv`
if the former fails.
  • Loading branch information
legoktm committed Aug 15, 2024
1 parent 7e54b33 commit 728ac40
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion devops/scripts/boot-strap-venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ function virtualenv_bootstrap() {
then
p=$(command -v "python${PYTHON_VERSION}" 2> /dev/null || command -v python3)
echo "Creating ${p} virtualenv in ${VENV}"
"${p}" -m venv "${VENV}"
# be flexible in venv creation, e.g. staging has virtualenv while
# deb-tests (GHA runner) has python3-venv
if command -v virtualenv > /dev/null; then
virtualenv -p "${p}" "${VENV}"
else
"${p}" -m venv "${VENV}"
fi
fi

PIP_CONSTRAINT=${DEV_CONSTRAINT} "${VENV}/bin/pip" install -q -r "securedrop/requirements/python3/develop-requirements.txt"
Expand Down

0 comments on commit 728ac40

Please sign in to comment.