From: Jim Jagielski Date: Wed, 3 Jun 2026 22:32:17 +0000 (+0000) Subject: test/pyhttpd: move pyproject.toml and uv.lock under pyhttpd/ X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0d13d7a7d26bffab93ab0ec02167dd91b2a57f44;p=thirdparty%2Fapache%2Fhttpd.git test/pyhttpd: move pyproject.toml and uv.lock under pyhttpd/ The pyproject.toml and uv.lock belong to the pyhttpd test suite, so move them from test/ into test/pyhttpd/ where the package itself lives. Update runtests-pyhttpd.sh to use 'uv sync --project pyhttpd/' and reference the venv at pyhttpd/.venv/. Fix pyhttpd/env.py to look for the venv at the same level (pyhttpd/.venv/) instead of the parent dir. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934951 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/pyhttpd/env.py b/test/pyhttpd/env.py index 7ca7156005..a30a027fb9 100644 --- a/test/pyhttpd/env.py +++ b/test/pyhttpd/env.py @@ -685,7 +685,7 @@ class HttpdTestEnv: p for p in os.environ.get('PATH', '').split(os.pathsep) if '/shims' not in p ] - venv_bin = os.path.join(os.path.dirname(self._our_dir), '.venv', 'bin') + venv_bin = os.path.join(self._our_dir, '.venv', 'bin') if os.path.isdir(venv_bin) and venv_bin not in parts: parts.insert(0, venv_bin) env = os.environ.copy() diff --git a/test/pyproject.toml b/test/pyhttpd/pyproject.toml similarity index 100% rename from test/pyproject.toml rename to test/pyhttpd/pyproject.toml diff --git a/test/uv.lock b/test/pyhttpd/uv.lock similarity index 100% rename from test/uv.lock rename to test/pyhttpd/uv.lock diff --git a/test/runtests-pyhttpd.sh b/test/runtests-pyhttpd.sh index 82ecd642b2..74cbbdcf72 100755 --- a/test/runtests-pyhttpd.sh +++ b/test/runtests-pyhttpd.sh @@ -2,7 +2,7 @@ # # runtests-pyhttpd.sh -- run the pyhttpd modules/ test suite. # -# Manages a local .venv under test/ so that pytest and the CGI helper scripts +# Manages a local .venv under test/pyhttpd/ so that pytest and the CGI helper scripts # (which httpd forks) both use the same Python with all required packages # (cryptography, python-multipart, websockets, etc.) available. # @@ -19,16 +19,16 @@ set -eu here="$(cd "$(dirname "$0")" && pwd)" cd "$here" -PYTEST="$here/.venv/bin/pytest" +PYTEST="$here/pyhttpd/.venv/bin/pytest" if [ ! -x "$PYTEST" ]; then if command -v uv >/dev/null 2>&1; then echo "runtests-pyhttpd.sh: .venv not found; running 'uv sync' to create it..." >&2 - uv sync + uv sync --project "$here/pyhttpd" elif command -v python3 >/dev/null 2>&1; then echo "runtests-pyhttpd.sh: .venv not found; creating with python3 + pip..." >&2 - python3 -m venv .venv - # Keep this list in sync with pyproject.toml [project].dependencies - .venv/bin/pip install --quiet \ + python3 -m venv "$here/pyhttpd/.venv" + # Keep this list in sync with pyhttpd/pyproject.toml [project].dependencies + "$here/pyhttpd/.venv/bin/pip" install --quiet \ "pytest>=7.0" cryptography filelock "python-multipart" pyopenssl packaging websockets else echo "runtests-pyhttpd.sh: ERROR: $PYTEST not found and neither 'uv' nor 'python3' is on PATH." >&2 @@ -39,7 +39,7 @@ fi # Prepend the venv's bin dir so that CGI scripts forked by httpd also resolve # python3 to the venv's interpreter (which has all packages installed), and so # that any shim wrappers earlier on PATH are shadowed. -export PATH="$here/.venv/bin:$PATH" +export PATH="$here/pyhttpd/.venv/bin:$PATH" targets="${PYHTTPD_TARGETS:-modules}"