Skip to content
Myr

Updates for httpcore 0.9 interface. (#967)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Pass proxy_url * Update httpcore dependancy * Update port in Transport API to be 'Optional[int]'

authored by Tom Christie · committed by GitHub · parent d2816c9 · Browse files · 5 files+8 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+8 added−8 removed

  • other:+8 added−8 removed

5 files+8 added−8 removed

modified:httpx/_transports/asgi.py+1 added-1 removed
71 unmodified lines
7273 async def request(74 self,75 method: bytes,76 url: Tuple[bytes, bytes, int, bytes],76 url: Tuple[bytes, bytes, Optional[int], bytes],77 headers: List[Tuple[bytes, bytes]] = None,78 stream: httpcore.AsyncByteStream = None,79 timeout: Dict[str, Optional[float]] = None,80 ) -> Tuple[bytes, int, bytes, List[Tuple[bytes, bytes]], httpcore.AsyncByteStream]:
93 unmodified lines
modified:httpx/_transports/urllib3.py+3 added-3 removed
86 unmodified lines
8788 def request(89 self,90 method: bytes,91 url: Tuple[bytes, bytes, int, bytes],91 url: Tuple[bytes, bytes, Optional[int], bytes],92 headers: List[Tuple[bytes, bytes]] = None,93 stream: httpcore.SyncByteStream = None,94 timeout: Dict[str, Optional[float]] = None,95 ) -> Tuple[bytes, int, bytes, List[Tuple[bytes, bytes]], httpcore.SyncByteStream]:
15 unmodified lines
111 content_length = int(header_value.decode("ascii"))112 body = stream if chunked or content_length else None113114 scheme, host, port, path = url115 default_scheme = {80: b"http", 443: "https"}.get(port)116 if scheme == default_scheme:115 default_port = {b"http": 80, "https": 443}.get(scheme)116 if port is None or port == default_port:117 url_str = "%s://%s%s" % (118 scheme.decode("ascii"),119 host.decode("ascii"),120 path.decode("ascii"),
63 unmodified lines
modified:httpx/_transports/wsgi.py+1 added-1 removed
62 unmodified lines
6364 def request(65 self,66 method: bytes,67 url: typing.Tuple[bytes, bytes, int, bytes],67 url: typing.Tuple[bytes, bytes, typing.Optional[int], bytes],68 headers: typing.List[typing.Tuple[bytes, bytes]] = None,69 stream: httpcore.SyncByteStream = None,70 timeout: typing.Dict[str, typing.Optional[float]] = None,71 ) -> typing.Tuple[
80 unmodified lines
modified:httpx/_client.py+2 added-2 removed
526 unmodified lines
527 max_keepalive = pool_limits.soft_limit528 max_connections = pool_limits.hard_limit529530 return httpcore.SyncHTTPProxy(531 proxy_origin=proxy.url.raw[:3],531 proxy_url=proxy.url.raw,532 proxy_headers=proxy.headers.raw,533 proxy_mode=proxy.mode,534 ssl_context=ssl_context,535 max_keepalive=max_keepalive,
539 unmodified lines
1075 max_keepalive = pool_limits.soft_limit1076 max_connections = pool_limits.hard_limit10771078 return httpcore.AsyncHTTPProxy(1079 proxy_origin=proxy.url.raw[:3],1079 proxy_url=proxy.url.raw,1080 proxy_headers=proxy.headers.raw,1081 proxy_mode=proxy.mode,1082 ssl_context=ssl_context,1083 max_keepalive=max_keepalive,
451 unmodified lines
modified:setup.py+1 added-1 removed
59 unmodified lines
60 "sniffio",61 "chardet==3.*",62 "idna==2.*",63 "rfc3986>=1.3,<2",64 "httpcore>=0.8.4",64 "httpcore==0.9.*",65 ],66 classifiers=[67 "Development Status :: 4 - Beta",68 "Environment :: Web Environment",
13 unmodified lines