Update to httpcore 0.10 (#1126)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* Keep HTTPError as a base class for .request() and .raise_for_status() * Updates for httpcore 0.10 * Update httpx/_exceptions.py Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com> * Use httpcore.SimpleByteStream/httpcore.IteratorByteStream * Use httpcore.PlainByteStream * Merge master * Update to httpcore 0.10.x
authored by Tom Christie · committed by GitHub · parent 0a38695 · Browse files · 19 files·+108 added−115 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
Diff stats
19 files+108 added−115 removed
- tests:+19 added−18 removed
- other:+89 added−97 removed
Provenance
- Commit
876e722- Tree
4d2678d- Author
Tom Christie <tom@tomchristie.com>- Committer
GitHub <noreply@github.com>- Parent
0a38695
19 files changed+108 added−115 removed
modified:httpx/_transports/asgi.py+4 added-23 removed
1-from typing import (2- TYPE_CHECKING,3- AsyncIterator,4- Callable,5- Dict,6- List,7- Optional,8- Tuple,9- Union,10-)1+from typing import TYPE_CHECKING, Callable, List, Mapping, Optional, Tuple, Union2 3 import httpcore4 import sniffio5 15 unmodified lines21 22 return asyncio.Event()23 24 34-async def async_byte_iterator(bytestring: bytes) -> AsyncIterator[bytes]:35- yield bytestring36-37-25 class ASGITransport(httpcore.AsyncHTTPTransport):26 """27 A custom AsyncTransport that handles sending requests directly to an ASGI app.28 The simplest way to use this functionality is to use the `app` argument.43 unmodified lines72 method: bytes,73 url: Tuple[bytes, bytes, Optional[int], bytes],74 headers: List[Tuple[bytes, bytes]] = None,75 stream: httpcore.AsyncByteStream = None,89- timeout: Dict[str, Optional[float]] = None,76+ timeout: Mapping[str, Optional[float]] = None,77 ) -> Tuple[bytes, int, bytes, List[Tuple[bytes, bytes]], httpcore.AsyncByteStream]:78 headers = [] if headers is None else headers92- stream = (93- httpcore.AsyncByteStream(async_byte_iterator(b""))94- if stream is None95- else stream96- )79+ stream = httpcore.PlainByteStream(content=b"") if stream is None else stream80 81 # ASGI scope.82 scheme, host, port, full_path = url83 path, _, query = full_path.partition(b"?")68 unmodified lines152 assert response_complete.is_set()153 assert status_code is not None154 assert response_headers is not None155 173- response_body = b"".join(body_parts)156+ stream = httpcore.PlainByteStream(content=b"".join(body_parts))157 175- stream = httpcore.AsyncByteStream(async_byte_iterator(response_body))176-158 return (b"HTTP/1.1", status_code, b"", response_headers, stream)modified:httpx/_transports/urllib3.py+2 added-2 removed
1 import socket2-from typing import Dict, Iterator, List, Optional, Tuple2+from typing import Iterator, List, Mapping, Optional, Tuple3 4 import httpcore5 6 from .._config import create_ssl_context37 unmodified lines44 method: bytes,45 url: Tuple[bytes, bytes, Optional[int], bytes],46 headers: List[Tuple[bytes, bytes]] = None,47 stream: httpcore.SyncByteStream = None,48- timeout: Dict[str, Optional[float]] = None,48+ timeout: Mapping[str, Optional[float]] = None,49 ) -> Tuple[bytes, int, bytes, List[Tuple[bytes, bytes]], httpcore.SyncByteStream]:50 headers = [] if headers is None else headers51 stream = ByteStream(b"") if stream is None else stream52 timeout = {} if timeout is None else timeout97 unmodified linesmodified:httpx/_transports/wsgi.py+3 added-7 removed
62 unmodified lines63 method: bytes,64 url: typing.Tuple[bytes, bytes, typing.Optional[int], bytes],65 headers: typing.List[typing.Tuple[bytes, bytes]] = None,66 stream: httpcore.SyncByteStream = None,67- timeout: typing.Dict[str, typing.Optional[float]] = None,67+ timeout: typing.Mapping[str, typing.Optional[float]] = None,68 ) -> typing.Tuple[69 bytes,70 int,71 bytes,72 typing.List[typing.Tuple[bytes, bytes]],73 httpcore.SyncByteStream,74 ]:75 headers = [] if headers is None else headers76- stream = (77- httpcore.SyncByteStream(chunk for chunk in [b""])78- if stream is None79- else stream80- )76+ stream = httpcore.PlainByteStream(content=b"") if stream is None else stream77 78 scheme, host, port, full_path = url79 path, _, query = full_path.partition(b"?")80 environ = {44 unmodified lines125 headers = [126 (key.encode("ascii"), value.encode("ascii"))127 for key, value in seen_response_headers128 ]133- stream = httpcore.SyncByteStream(chunk for chunk in result)129+ stream = httpcore.IteratorByteStream(iterator=result)130 131 return (b"HTTP/1.1", status_code, b"", headers, stream)modified:httpx/__init__.py+6 added
10 unmodified lines11 DecodingError,12 HTTPError,13 HTTPStatusError,14 InvalidURL,15+ LocalProtocolError,16 NetworkError,17 NotRedirectResponse,18 PoolTimeout,19 ProtocolError,20 ProxyError,21 ReadError,22 ReadTimeout,23+ RemoteProtocolError,24 RequestBodyUnavailable,25 RequestError,26 RequestNotRead,27 ResponseClosed,2 unmodified lines30 StreamError,31 TimeoutException,32 TooManyRedirects,33 TransportError,34+ UnsupportedProtocol,35 WriteError,36 WriteTimeout,37 )38 from ._models import URL, Cookies, Headers, QueryParams, Request, Response35 unmodified lines74 "DecodingError",75 "HTTPError",76 "HTTPStatusError",77 "InvalidURL",78+ "UnsupportedProtocol",79+ "LocalProtocolError",80+ "RemoteProtocolError",81 "NetworkError",82 "NotRedirectResponse",83 "PoolTimeout",84 "ProtocolError",27 unmodified linesmodified:httpx/_client.py+8 added-25 removed
17 unmodified lines18 )19 from ._content_streams import ContentStream20 from ._exceptions import (21 HTTPCORE_EXC_MAP,22- InvalidURL,22 RequestBodyUnavailable,23 TooManyRedirects,24 map_exceptions,25 )16 unmodified lines42 )43 from ._utils import (44 NetRCInfo,45 URLPattern,47- enforce_http_url,46 get_environment_proxies,47 get_logger,48 same_origin,49 warn_deprecated,291 unmodified lines341 location = response.headers["Location"]342 343 url = URL(location)344 347- # Check that we can handle the scheme348- if url.scheme and url.scheme not in ("http", "https"):349- message = f'Scheme "{url.scheme}" not supported.'350- raise InvalidURL(message, request=request)351-345 # Handle malformed 'Location' headers that are "absolute" form, have no host.346 # See: https://github.com/encode/httpx/issues/771347 if url.scheme and not url.host:348 url = url.copy_with(host=request.url.host)183 unmodified lines532 ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env)533 534 return httpcore.SyncConnectionPool(535 ssl_context=ssl_context,543- max_keepalive=limits.max_keepalive,536 max_connections=limits.max_connections,537+ max_keepalive_connections=limits.max_keepalive_connections,538 keepalive_expiry=KEEPALIVE_EXPIRY,539 http2=http2,540 )541 12 unmodified lines554 proxy_url=proxy.url.raw,555 proxy_headers=proxy.headers.raw,556 proxy_mode=proxy.mode,557 ssl_context=ssl_context,565- max_keepalive=limits.max_keepalive,558 max_connections=limits.max_connections,559+ max_keepalive_connections=limits.max_keepalive_connections,560 keepalive_expiry=KEEPALIVE_EXPIRY,561 http2=http2,562 )563 571- def _transport_for_url(self, request: Request) -> httpcore.SyncHTTPTransport:564+ def _transport_for_url(self, url: URL) -> httpcore.SyncHTTPTransport:565 """566 Returns the transport instance that should be used for a given URL.567 This will either be the standard connection pool, or a proxy.568 """576- url = request.url577- enforce_http_url(request)578-569 for pattern, transport in self._proxies.items():570 if pattern.matches(url):571 return self._transport if transport is None else transport572 36 unmodified lines609 auth: AuthTypes = None,610 allow_redirects: bool = True,611 timeout: typing.Union[TimeoutTypes, UnsetType] = UNSET,612 ) -> Response:623- if request.url.scheme not in ("http", "https"):624- message = 'URL scheme must be "http" or "https".'625- raise InvalidURL(message, request=request)626-613 timeout = self.timeout if isinstance(timeout, UnsetType) else Timeout(timeout)614 615 auth = self._build_auth(request, auth)616 82 unmodified lines699 def _send_single_request(self, request: Request, timeout: Timeout) -> Response:700 """701 Sends a single request, without handling any redirections.702 """717- transport = self._transport_for_url(request)703+ transport = self._transport_for_url(request.url)704 705 with map_exceptions(HTTPCORE_EXC_MAP, request=request):706 (707 http_version,349 unmodified lines1057 ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env)1058 1059 return httpcore.AsyncConnectionPool(1060 ssl_context=ssl_context,1075- max_keepalive=limits.max_keepalive,1061 max_connections=limits.max_connections,1062+ max_keepalive_connections=limits.max_keepalive_connections,1063 keepalive_expiry=KEEPALIVE_EXPIRY,1064 http2=http2,1065 )1066 12 unmodified lines1079 proxy_url=proxy.url.raw,1080 proxy_headers=proxy.headers.raw,1081 proxy_mode=proxy.mode,1082 ssl_context=ssl_context,1097- max_keepalive=limits.max_keepalive,1083 max_connections=limits.max_connections,1084+ max_keepalive_connections=limits.max_keepalive_connections,1085 keepalive_expiry=KEEPALIVE_EXPIRY,1086 http2=http2,1087 )1088 1103- def _transport_for_url(self, request: Request) -> httpcore.AsyncHTTPTransport:1089+ def _transport_for_url(self, url: URL) -> httpcore.AsyncHTTPTransport:1090 """1091 Returns the transport instance that should be used for a given URL.1092 This will either be the standard connection pool, or a proxy.1093 """1108- url = request.url1109- enforce_http_url(request)1110-1094 for pattern, transport in self._proxies.items():1095 if pattern.matches(url):1096 return self._transport if transport is None else transport1097 129 unmodified lines1227 ) -> Response:1228 """1229 Sends a single request, without handling any redirections.1230 """1248- transport = self._transport_for_url(request)1231+ transport = self._transport_for_url(request.url)1232 1233 with map_exceptions(HTTPCORE_EXC_MAP, request=request):1234 (1235 http_version,276 unmodified linesmodified:httpx/_config.py+23 added-12 removed
321 unmodified lines322 Configuration for limits to various client behaviors.323 324 **Parameters:**325 326- * **max_keepalive** - Allow the connection pool to maintain keep-alive connections327- below this point.326 * **max_connections** - The maximum number of concurrent connections that may be329- established.327+ established.328+ * **max_keepalive_connections** - Allow the connection pool to maintain329+ keep-alive connections below this point. Should be less than or equal330+ to `max_connections`.331 """332 333 def __init__(333- self, *, max_keepalive: int = None, max_connections: int = None,334+ self,335+ *,336+ max_connections: int = None,337+ max_keepalive_connections: int = None,338+ # Deprecated parameter naming, in favour of more explicit version:339+ max_keepalive: int = None,340 ):335- self.max_keepalive = max_keepalive341+ if max_keepalive is not None:342+ warnings.warn(343+ "'max_keepalive' is deprecated. Use 'max_keepalive_connections'.",344+ DeprecationWarning,345+ )346+ max_keepalive_connections = max_keepalive347+348 self.max_connections = max_connections349+ self.max_keepalive_connections = max_keepalive_connections350 351 def __eq__(self, other: typing.Any) -> bool:352 return (353 isinstance(other, self.__class__)341- and self.max_keepalive == other.max_keepalive354 and self.max_connections == other.max_connections355+ and self.max_keepalive_connections == other.max_keepalive_connections356 )357 358 def __repr__(self) -> str:359 class_name = self.__class__.__name__360 return (348- f"{class_name}(max_keepalive={self.max_keepalive}, "349- f"max_connections={self.max_connections})"361+ f"{class_name}(max_connections={self.max_connections}, "362+ f"max_keepalive_connections={self.max_keepalive_connections})"363 )364 365 366 class PoolLimits(Limits):354- def __init__(355- self, *, max_keepalive: int = None, max_connections: int = None,356- ) -> None:367+ def __init__(self, **kwargs: typing.Any) -> None:368 warn_deprecated(369 "httpx.PoolLimits(...) is deprecated and will raise errors in the future. "370 "Use httpx.Limits(...) instead."371 )361- super().__init__(max_keepalive=max_keepalive, max_connections=max_connections)372+ super().__init__(**kwargs)373 374 375 class Proxy:376 def __init__(39 unmodified linesmodified:httpx/_exceptions.py+41 added-8 removed
13 unmodified lines14 · ReadError15 · WriteError16 · CloseError17 - ProtocolError18+ · LocalProtocolError19+ · RemoteProtocolError20 - ProxyError21+ - UnsupportedProtocol22 + DecodingError23 + TooManyRedirects24 + RequestBodyUnavailable22- + InvalidURL25 x HTTPStatusError26 * NotRedirectResponse27 * CookieConflict28 * StreamError125 unmodified lines154 An error occurred while proxying a request.155 """156 157 158+class UnsupportedProtocol(TransportError):159+ """160+ Attempted to make a request to an unsupported protocol.161+162+ For example issuing a request to `ftp://www.example.com`.163+ """164+165+166 class ProtocolError(TransportError):167 """158- A protocol was violated by the server.168+ The protocol was violated.169 """170 171 172+class LocalProtocolError(ProtocolError):173+ """174+ A protocol was violated by the client.175+176+ For example if the user instantiated a `Request` instance explicitly,177+ failed to include the mandatory `Host:` header, and then issued it directly178+ using `client.send()`.179+ """180+181+182+class RemoteProtocolError(ProtocolError):183+ """184+ The protocol was violated by the server.185+186+ For exaample, returning malformed HTTP.187+ """188+189+190 # Other request exceptions...191 192 193 class DecodingError(RequestError):14 unmodified lines208 no longer available.209 """210 211 184-class InvalidURL(RequestError):185- """186- URL was missing a hostname, or was not one of HTTP/HTTPS.187- """188-189-212 # Client errors213 214 215 class HTTPStatusError(HTTPError):102 unmodified lines318 )319 super().__init__(message)320 321 322+# The `InvalidURL` class is no longer required. It was being used to enforce only323+# 'http'/'https' URLs being requested, but is now treated instead at the324+# transport layer using `UnsupportedProtocol()`.`325+326+# We are currently still exposing this class, but it will be removed in 1.0.327+InvalidURL = UnsupportedProtocol328+329+330 @contextlib.contextmanager331 def map_exceptions(332 mapping: typing.Mapping[typing.Type[Exception], typing.Type[Exception]],333 **kwargs: typing.Any,30 unmodified lines364 httpcore.ReadError: ReadError,365 httpcore.WriteError: WriteError,366 httpcore.CloseError: CloseError,367 httpcore.ProxyError: ProxyError,368+ httpcore.UnsupportedProtocol: UnsupportedProtocol,369 httpcore.ProtocolError: ProtocolError,370+ httpcore.LocalProtocolError: LocalProtocolError,371+ httpcore.RemoteProtocolError: RemoteProtocolError,372 }modified:httpx/_utils.py+1 added-19 removed
12 unmodified lines13 from time import perf_counter14 from types import TracebackType15 from urllib.request import getproxies16 17-from ._exceptions import InvalidURL17 from ._types import PrimitiveData18 19 if typing.TYPE_CHECKING: # pragma: no cover21- from ._models import URL, Request20+ from ._models import URL21 22 23 _HTML5_FORM_ENCODING_REPLACEMENTS = {'"': "%22", "\\": "\\\\"}24 _HTML5_FORM_ENCODING_REPLACEMENTS.update(238 unmodified lines263 264 return typing.cast(Logger, logger)265 266 268-def enforce_http_url(request: "Request") -> None:269- """270- Raise an appropriate InvalidURL for any non-HTTP URLs.271- """272- url = request.url273-274- if not url.scheme:275- message = "No scheme included in URL."276- raise InvalidURL(message, request=request)277- if not url.host:278- message = "No host included in URL."279- raise InvalidURL(message, request=request)280- if url.scheme not in ("http", "https"):281- message = 'URL scheme must be "http" or "https".'282- raise InvalidURL(message, request=request)283-284-267 def port_or_default(url: "URL") -> typing.Optional[int]:268 if url.port is not None:269 return url.port270 return {"http": 80, "https": 443}.get(url.scheme)261 unmodified linesmodified:tests/client/test_async_client.py+1 added-1 removed
30 unmodified lines31 )32 @pytest.mark.usefixtures("async_environment")33 async def test_get_invalid_url(server, url):34 async with httpx.AsyncClient() as client:35- with pytest.raises(httpx.InvalidURL):35+ with pytest.raises((httpx.UnsupportedProtocol, httpx.LocalProtocolError)):36 await client.get(url)37 38 39 @pytest.mark.usefixtures("async_environment")129 unmodified linesmodified:tests/client/test_auth.py+2 added-2 removed
38 unmodified lines39 method: bytes,40 url: typing.Tuple[bytes, bytes, int, bytes],41 headers: typing.List[typing.Tuple[bytes, bytes]],42 stream: ContentStream,43- timeout: typing.Dict[str, typing.Optional[float]] = None,43+ timeout: typing.Mapping[str, typing.Optional[float]] = None,44 ) -> typing.Tuple[45 bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream46 ]:47 authorization = get_header_value(headers, "Authorization")41 unmodified lines89 method: bytes,90 url: typing.Tuple[bytes, bytes, typing.Optional[int], bytes],91 headers: typing.List[typing.Tuple[bytes, bytes]] = None,92 stream: httpcore.AsyncByteStream = None,93- timeout: typing.Dict[str, typing.Optional[float]] = None,93+ timeout: typing.Mapping[str, typing.Optional[float]] = None,94 ) -> typing.Tuple[95 bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream96 ]:97 if self._response_count < self.send_response_after_attempt:513 unmodified linesmodified:tests/client/test_client.py+1 added-1 removed
33 unmodified lines34 ],35 )36 def test_get_invalid_url(server, url):37 with httpx.Client() as client:38- with pytest.raises(httpx.InvalidURL):38+ with pytest.raises((httpx.UnsupportedProtocol, httpx.LocalProtocolError)):39 client.get(url)40 41 42 def test_build_request(server):168 unmodified linesmodified:tests/client/test_cookies.py+1 added-1 removed
21 unmodified lines22 method: bytes,23 url: typing.Tuple[bytes, bytes, typing.Optional[int], bytes],24 headers: typing.List[typing.Tuple[bytes, bytes]] = None,25 stream: httpcore.AsyncByteStream = None,26- timeout: typing.Dict[str, typing.Optional[float]] = None,26+ timeout: typing.Mapping[str, typing.Optional[float]] = None,27 ) -> typing.Tuple[28 bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream29 ]:30 host, scheme, port, path = url149 unmodified linesmodified:tests/client/test_headers.py+1 added-1 removed
14 unmodified lines15 method: bytes,16 url: typing.Tuple[bytes, bytes, typing.Optional[int], bytes],17 headers: typing.List[typing.Tuple[bytes, bytes]] = None,18 stream: httpcore.AsyncByteStream = None,19- timeout: typing.Dict[str, typing.Optional[float]] = None,19+ timeout: typing.Mapping[str, typing.Optional[float]] = None,20 ) -> typing.Tuple[21 bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream22 ]:23 assert headers is not None160 unmodified linesmodified:tests/client/test_proxies.py+2 added-4 removed
109 unmodified lines110 ],111 )112 def test_transport_for_request(url, proxies, expected):113 client = httpx.AsyncClient(proxies=proxies)114- request = httpx.Request(method="GET", url=url)115- transport = client._transport_for_url(request)114+ transport = client._transport_for_url(httpx.URL(url))115 116 if expected is None:117 assert transport is client._transport118 else:119 unmodified lines238 for name, value in env.items():239 monkeypatch.setenv(name, value)240 241 client = client_class()243- request = httpx.Request(method="GET", url=url)244- transport = client._transport_for_url(request)242+ transport = client._transport_for_url(httpx.URL(url))243 244 if expected is None:245 assert transport == client._transport246 else:18 unmodified linesmodified:tests/client/test_queryparams.py+1 added-1 removed
12 unmodified lines13 method: bytes,14 url: typing.Tuple[bytes, bytes, typing.Optional[int], bytes],15 headers: typing.List[typing.Tuple[bytes, bytes]] = None,16 stream: httpcore.AsyncByteStream = None,17- timeout: typing.Dict[str, typing.Optional[float]] = None,17+ timeout: typing.Mapping[str, typing.Optional[float]] = None,18 ) -> typing.Tuple[19 bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream20 ]:21 body = JSONStream({"ok": "ok"})32 unmodified linesmodified:tests/client/test_redirects.py+8 added-5 removed
7 unmodified lines8 from httpx import (9 URL,10 AsyncClient,11 Client,12- InvalidURL,12 NotRedirectResponse,13 RequestBodyUnavailable,14 TooManyRedirects,15+ UnsupportedProtocol,16 codes,17 )18 from httpx._content_streams import AsyncIteratorStream, ByteStream, ContentStream19 12 unmodified lines32 method: bytes,33 url: typing.Tuple[bytes, bytes, int, bytes],34 headers: typing.List[typing.Tuple[bytes, bytes]],35 stream: ContentStream,36- timeout: typing.Dict[str, typing.Optional[float]] = None,36+ timeout: typing.Mapping[str, typing.Optional[float]] = None,37 ) -> typing.Tuple[38 bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream39 ]:40 scheme, host, port, path = url41+ if scheme not in (b"http", b"https"):42+ raise httpcore.UnsupportedProtocol(f"Scheme {scheme!r} not supported.")43+44 path, _, query = path.partition(b"?")45 if path == b"/no_redirect":46 return b"HTTP/1.1", codes.OK, b"OK", [], ByteStream(b"")47 359 unmodified lines407 method: bytes,408 url: typing.Tuple[bytes, bytes, typing.Optional[int], bytes],409 headers: typing.List[typing.Tuple[bytes, bytes]] = None,410 stream: httpcore.AsyncByteStream = None,408- timeout: typing.Dict[str, typing.Optional[float]] = None,411+ timeout: typing.Mapping[str, typing.Optional[float]] = None,412 ) -> typing.Tuple[413 bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream414 ]:415 scheme, host, port, path = url67 unmodified lines483 484 @pytest.mark.usefixtures("async_environment")485 async def test_redirect_custom_scheme():486 client = AsyncClient(transport=AsyncMockTransport())484- with pytest.raises(InvalidURL) as e:487+ with pytest.raises(UnsupportedProtocol) as e:488 await client.post("https://example.org/redirect_custom_scheme")486- assert str(e.value) == 'Scheme "market" not supported.'489+ assert str(e.value) == "Scheme b'market' not supported."modified:tests/test_config.py+1 added-1 removed
100 unmodified lines101 102 103 def test_limits_repr():104 limits = httpx.Limits(max_connections=100)105- assert repr(limits) == "Limits(max_keepalive=None, max_connections=100)"105+ assert repr(limits) == "Limits(max_connections=100, max_keepalive_connections=None)"106 107 108 def test_limits_eq():109 limits = httpx.Limits(max_connections=100)128 unmodified linesmodified:tests/test_multipart.py+1 added-1 removed
17 unmodified lines18 method: bytes,19 url: typing.Tuple[bytes, bytes, typing.Optional[int], bytes],20 headers: typing.List[typing.Tuple[bytes, bytes]] = None,21 stream: httpcore.AsyncByteStream = None,22- timeout: typing.Dict[str, typing.Optional[float]] = None,22+ timeout: typing.Mapping[str, typing.Optional[float]] = None,23 ) -> typing.Tuple[24 bytes,25 int,26 bytes,249 unmodified linesmodified:setup.py+1 added-1 removed
58 unmodified lines59 "sniffio",60 "chardet==3.*",61 "idna==2.*",62 "rfc3986>=1.3,<2",63- "httpcore==0.9.*",63+ "httpcore[http2]==0.10.*",64 ],65 classifiers=[66 "Development Status :: 4 - Beta",67 "Environment :: Web Environment",13 unmodified lines