10000 [tests] Use -n to not use a venv · Nindouja/python-gitlab@5210956 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5210956

Browse files
author
Gauvain Pocentek
committed
[tests] Use -n to not use a venv
1 parent 022a0f6 commit 5210956

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

tools/build_test_env.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ error() { log "ERROR: $@" >&2; }
2525
fatal() { error "$@"; exit 1; }
2626
try() { "$@" || fatal "'$@' failed"; }
2727

28+
NOVENV=
2829
PY_VER=2
2930
API_VER=3
30-
while getopts :p:a: opt "$@"; do
31+
while getopts :np:a: opt "$@"; do
3132
case $opt in
33+
n) NOVENV=1;;
3234
p) PY_VER=$OPTARG;;
3335
a) API_VER=$OPTARG;;
3436
:) fatal "Option -${OPTARG} requires a value";;
@@ -143,15 +145,17 @@ EOF
143145
log "Config file content ($CONFIG):"
144146
log <$CONFIG
145147

146-
log "Creating Python virtualenv..."
147-
try "$VENV_CMD" "$VENV"
148-
. "$VENV"/bin/activate || fatal "failed to activate Python virtual environment"
148+
if [ -z "$NOVENV" ]; then
149+
log "Creating Python virtualenv..."
150+
try "$VENV_CMD" "$VENV"
151+
. "$VENV"/bin/activate || fatal "failed to activate Python virtual environment"
149152

150-
log "Installing dependencies into virtualenv..."
151-
try pip install -rrequirements.txt
153+
log "Installing dependencies into virtualenv..."
154+
try pip install -rrequirements.txt
152155

153-
log "Installing into virtualenv..."
154-
try pip install -e .
156+
log "Installing into virtualenv..."
157+
try pip install -e .
158+
fi
155159

156160
log "Pausing to give GitLab some time to finish starting up..."
157161
sleep 30

0 commit comments

Comments
 (0)
0