]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
test/pyhttpd: move pyproject.toml and uv.lock under pyhttpd/
authorJim Jagielski <jim@apache.org>
Wed, 3 Jun 2026 22:32:17 +0000 (22:32 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 3 Jun 2026 22:32:17 +0000 (22:32 +0000)
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

test/pyhttpd/env.py
test/pyhttpd/pyproject.toml [moved from test/pyproject.toml with 100% similarity]
test/pyhttpd/uv.lock [moved from test/uv.lock with 100% similarity]
test/runtests-pyhttpd.sh

index 7ca7156005c40fc472ddd3962d1127ae6e2bcd82..a30a027fb935c105ba65f6a1534aa062c824324f 100644 (file)
@@ -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()
similarity index 100%
rename from test/uv.lock
rename to test/pyhttpd/uv.lock
index 82ecd642b2cdd1d5bf5dad39b2f2e0ae600fbb2a..74cbbdcf728a299a388f3d0a979c0c3f379fd0cb 100755 (executable)
@@ -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}"