Skip to content

Commit 3353ec2

Browse files
daveisferaWyattBlue
authored andcommitted
Allow venv to be used for build
1 parent bca1f10 commit 3353ec2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/activate.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ if [[ ! "$PYAV_LIBRARY" ]]; then
2323
fi
2424
export PYAV_LIBRARY
2525

26-
if [[ ! "$PYAV_PYTHON" ]]; then
26+
if [[ "$VIRTUAL_ENV" ]]; then
27+
PYAV_PYTHON="${VIRTUAL_ENV}/bin/python3"
28+
echo "Using activated venv: $VIRTUAL_ENV"
29+
elif [[ ! "$PYAV_PYTHON" ]]; then
2730
PYAV_PYTHON="${PYAV_PYTHON-python3}"
2831
echo 'No $PYAV_PYTHON set; defaulting to python3.'
2932
fi
@@ -44,6 +47,9 @@ if [[ "$GITHUB_ACTION" ]]; then
4447
# GitHub has a very self-contained environment. Lets just work in that.
4548
echo "We're on CI, so not setting up another virtualenv."
4649

50+
elif [[ "$VIRTUAL_ENV" ]]; then
51+
# Using activated venv
52+
true
4753
else
4854

4955
export PYAV_VENV_NAME="$(uname -s).$(uname -r).$("$PYAV_PYTHON" -c '

0 commit comments

Comments
 (0)