Skip to content

Commit 26d5c0a

Browse files
authored
test(e2e): verify proxy-mode NO_PROXY does not crash Python httpx (#341)
1 parent 6d82b95 commit 26d5c0a

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/pmg-e2e.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,27 @@ jobs:
222222
223223
cd .. && rm -rf pypi-proxy-test
224224
225+
- name: Test PyPI - httpx NO_PROXY Regression (#339)
226+
run: |
227+
echo "Testing that proxy-mode NO_PROXY does not crash Python httpx (#339)..."
228+
HTTPX_TESTDIR=$(mktemp -d) && cd "$HTTPX_TESTDIR"
229+
pmg uv init --no-readme
230+
pmg uv add httpx==0.28.1
231+
232+
# Run under proxy mode (default). PMG injects NO_PROXY into the child env;
233+
# the bracketed [::1] it used to inject made urllib/httpx raise
234+
# "InvalidURL: Invalid port: ':1]'" when constructing a client.
235+
pmg uv run python -c '
236+
import os, httpx
237+
np = os.environ.get("NO_PROXY") or os.environ.get("no_proxy") or ""
238+
assert "::1" in np, "proxy-mode NO_PROXY not set, test is not exercising the fix: %r" % np
239+
assert "[::1]" not in np, "NO_PROXY still contains bracketed loopback: %r" % np
240+
httpx.Client().close()
241+
print("httpx ok; NO_PROXY=" + np)
242+
'
243+
244+
cd - && rm -rf "$HTTPX_TESTDIR"
245+
225246
- name: Test PNPM - Single Package & Manifest
226247
run: |
227248
echo "Testing PNPM single package installation..."

0 commit comments

Comments
 (0)