From: Jim Jagielski Date: Wed, 3 Jun 2026 19:05:31 +0000 (+0000) Subject: test/pytest_suite: auto-create .venv via python3+pip when uv is unavailable X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=3116f556b910b9a7842d2f8d31ffa00ca140a8e4;p=thirdparty%2Fapache%2Fhttpd.git test/pytest_suite: auto-create .venv via python3+pip when uv is unavailable runtests.sh already bootstrapped the virtualenv with `uv sync` when uv was present, but exited with an error when it was not. Fall back to `python3 -m venv .venv && .venv/bin/pip install -e .` so the suite is self-bootstrapping on systems that have only a stock Python 3 install. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934945 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/pytest_suite/runtests.sh b/test/pytest_suite/runtests.sh index b4831ff48f..a22501012a 100755 --- a/test/pytest_suite/runtests.sh +++ b/test/pytest_suite/runtests.sh @@ -35,11 +35,12 @@ if [ ! -x "$PYTEST" ]; then if command -v uv >/dev/null 2>&1; then echo "runtests.sh: .venv not found; running 'uv sync' to create it..." >&2 uv sync + elif command -v python3 >/dev/null 2>&1; then + echo "runtests.sh: .venv not found; creating it with python3 + pip..." >&2 + python3 -m venv .venv + .venv/bin/pip install --quiet -e . else - echo "runtests.sh: ERROR: $PYTEST not found and 'uv' is not installed." >&2 - echo " Create the environment with one of:" >&2 - echo " uv sync" >&2 - echo " python3 -m venv .venv && .venv/bin/pip install pytest httpx" >&2 + echo "runtests.sh: ERROR: $PYTEST not found and neither 'uv' nor 'python3' is installed." >&2 exit 1 fi fi