Repository navigation
Guard httpx 1.x imports, pin client extras, and widen CI - #34
Draft
proxymeshai wants to merge 1 commit into
Draft
proxymeshai wants to merge 1 commit into
proxymeshai wants to merge 1 commit into
Conversation
httpx 1.0.dev6 drops httpcore and AsyncHTTPTransport. Importing the httpx adapter now warns and raises UnsupportedHttpxVersion instead of ImportError. Optional extras pin tested client ranges, and CI runs a Python matrix plus a local CONNECT mock. A weekly workflow checks latest and pre-release clients without gating pull requests. Co-authored-by: ProxyMesh AI <proxymeshai@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AsyncHTTPTransport/HTTPTransport, and without proxy support (encode/httpx#947). The module warns and raisesUnsupportedHttpxVersionwhen used. The[httpx]extra ishttpx>=0.28,<1. No 1.0 adapter in this PR.workflow_dispatch, installs the newest stable andpip install --preclients. That workflow is not apull_requestcheck, so a pre-release failure is visible in Actions and does not block PRs.httpx 1.0 support options
httpx 1.0.dev6 replaces the httpcore stack with
Client,Connection,ConnectionPool, andNetworkBackend. There is no CONNECT API. This PR does not porthandle_request.pip install 'python-proxy-headers[httpx]'pinshttpx>=0.28,<1. Import on 1.x warns; calling the helpers raisesUnsupportedHttpxVersion.NetworkBackend.connect/connect_tlsandTransport.sendopen a direct connection. They cannot send CONNECT headers or return the proxy response. When Version 1.0 encode/httpx#947 adds a public API, implement against that instead of another private copy.httpx.Connection.NetworkBackenddoes not accept an existing socket today, and the 1.0 API is still early.Same note in
docs/httpx.rst.Repository settings
Not changed here (owner settings):
Send and read custom proxy headers on HTTPS CONNECT for requests, urllib3, httpx and aiohttpproxymesh,https,connect,tunnelChanges
httpx_proxy.pyclassifies the installed httpx and loads_httpx_httpcore.pyonly for 0.x. httpx >= 1 warns at import and the public helpers raiseUnsupportedHttpxVersion. Verified against the realhttpx==1.0.dev6wheel (noAsyncHTTPTransport, no httpcore).test_client_internals.pychecks signatures and runs urllib3 (_prepare_proxy,_tunnel,http.client._read_headers), httpx (handle_request/handle_async_request), and aiohttp (_create_proxy_connection) throughtests/mock_connect_proxy.py. Failures name the upstream symbol. Adapters were not rewritten.[urllib3],[requests],[httpx],[aiohttp],[pycurl],[cloudscraper],[autoscraper]checked against urllib3 2.8.0, requests 2.34.2, httpx 0.28.1 / httpcore 1.0.9, aiohttp 3.14.5, pycurl 7.48.0, cloudscraper 1.2.71, autoscraper 1.1.14.requires-pythonis>=3.10because those clients require it and the httpx adapter already usesstr | None. Changelog URL isCHANGELOG.mdonmain.ubuntu-24.04only. PR unit job matrix is Python 3.10, 3.12, 3.13, 3.14, installs the extras, and runstest_header_security.pyplus the local mock. The existingPROXY_URLjob stays, on Python 3.12, still using the compatible extras.Client compatibilityruns Mondays 15:00 UTC and onworkflow_dispatch, for Python 3.12 and 3.14, channelsstableandpre. Pre-release failures fail that workflow and are not pull_request checks.Test plan
python test_header_security.py(pycurl 7.48.0 included)python test_client_internals.pyon httpx 0.28.1 (urllib3, httpx sync/async, aiohttp through the mock; pycurl, cloudscraper, autoscraper imports)httpx==1.0.dev6onPYTHONPATH: import warns, helpers raiseUnsupportedHttpxVersion, httpcore tests skip, urllib3 and aiohttp still passPROXY_URLintegration (run 39897808523)