From fd64dea04ea4fcec039ffc6ff3263ee0e70593cd Mon Sep 17 00:00:00 2001 From: Anusha Mukka Date: Wed, 29 Jul 2026 20:47:57 -0700 Subject: [PATCH] Revert bundled httpx stubs (fixes #4366) Summary: The bundled httpx stubs added in D110685002 caused a diagnostics regression between Pyrefly 1.1.1 and 1.2.0-dev.3 (GitHub https://github.com/facebook/pyrefly/issues/4366): code using `httpx.MockTransport` that type-checked cleanly in 1.1.1 started reporting missing-attribute errors (22 new diagnostics in one corpus repo). Original intent of D110685002: mirror the existing bundled stubs (boto3, pandas, etc.) so that httpx users get out-of-the-box type checking even without the library installed locally / discoverable by the module resolver. The slip-up: unlike those libraries, httpx ships `py.typed` with full inline annotations -- it is its own authoritative type source. The hand-written bundled stubs were therefore both unnecessary and, worse, incomplete: they omitted `_transports/mock.pyi` and never re-exported `MockTransport` from `__init__.pyi`. Because a bundled stub shadows the upstream inline types, this turned a fully-typed public API into false-positive diagnostics. (The stubs were also added without a corresponding entry in `stubs_metadata.json`.) The fix: remove the entire `httpx-stubs/` tree (all 19 vendored files), reverting D110685002. Import resolution then falls back to httpx's own authoritative inline types, which are complete and include `MockTransport`. Why remove rather than patch `MockTransport`: adding the one missing symbol would only close today's gap. Maintaining a hand-written stub for an already-fully-typed library commits us to tracking parity with every future httpx release -- ongoing drift and maintenance cost for no benefit over the upstream types. Removal is the correct, durable fix. Differential Revision: D114158493 --- .../third_party/stubs/httpx-stubs/LICENSE | 27 - .../stubs/httpx-stubs/__init__.pyi | 159 ------ .../stubs/httpx-stubs/__version__.pyi | 3 - .../third_party/stubs/httpx-stubs/_api.pyi | 170 ------- .../third_party/stubs/httpx-stubs/_auth.pyi | 22 - .../third_party/stubs/httpx-stubs/_client.pyi | 462 ------------------ .../third_party/stubs/httpx-stubs/_config.pyi | 59 --- .../stubs/httpx-stubs/_content.pyi | 8 - .../stubs/httpx-stubs/_exceptions.pyi | 51 -- .../third_party/stubs/httpx-stubs/_models.pyi | 174 ------- .../stubs/httpx-stubs/_status_codes.pyi | 84 ---- .../httpx-stubs/_transports/__init__.pyi | 0 .../stubs/httpx-stubs/_transports/asgi.pyi | 14 - .../stubs/httpx-stubs/_transports/base.pyi | 26 - .../stubs/httpx-stubs/_transports/default.pyi | 40 -- .../stubs/httpx-stubs/_transports/wsgi.pyi | 15 - .../third_party/stubs/httpx-stubs/_types.pyi | 84 ---- .../third_party/stubs/httpx-stubs/_urls.pyi | 66 --- .../third_party/stubs/httpx-stubs/py.typed | 0 19 files changed, 1464 deletions(-) delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/LICENSE delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/__init__.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/__version__.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_api.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_auth.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_client.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_config.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_content.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_exceptions.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_models.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_status_codes.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/__init__.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/asgi.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/base.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/default.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/wsgi.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_types.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_urls.pyi delete mode 100644 crates/pyrefly_bundled/third_party/stubs/httpx-stubs/py.typed diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/LICENSE b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/LICENSE deleted file mode 100644 index 8963b9f219..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright © 2019, [Encode OSS Ltd](https://www.encode.io/). -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/__init__.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/__init__.pyi deleted file mode 100644 index 34e2a50c76..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/__init__.pyi +++ /dev/null @@ -1,159 +0,0 @@ -from .__version__ import ( - __description__ as __description__, - __title__ as __title__, - __version__ as __version__, -) -from ._api import ( - delete as delete, - get as get, - head as head, - options as options, - patch as patch, - post as post, - put as put, - request as request, - stream as stream, -) -from ._auth import ( - Auth as Auth, - BasicAuth as BasicAuth, - DigestAuth as DigestAuth, - NetRCAuth as NetRCAuth, -) -from ._client import ( - USE_CLIENT_DEFAULT as USE_CLIENT_DEFAULT, - AsyncClient as AsyncClient, - Client as Client, -) -from ._config import ( - create_ssl_context as create_ssl_context, - Limits as Limits, - Proxy as Proxy, - Timeout as Timeout, -) -from ._content import ByteStream as ByteStream -from ._exceptions import ( - CloseError as CloseError, - ConnectError as ConnectError, - ConnectTimeout as ConnectTimeout, - CookieConflict as CookieConflict, - DecodingError as DecodingError, - HTTPError as HTTPError, - HTTPStatusError as HTTPStatusError, - InvalidURL as InvalidURL, - LocalProtocolError as LocalProtocolError, - NetworkError as NetworkError, - PoolTimeout as PoolTimeout, - ProtocolError as ProtocolError, - ProxyError as ProxyError, - ReadError as ReadError, - ReadTimeout as ReadTimeout, - RemoteProtocolError as RemoteProtocolError, - RequestError as RequestError, - RequestNotRead as RequestNotRead, - ResponseNotRead as ResponseNotRead, - StreamClosed as StreamClosed, - StreamConsumed as StreamConsumed, - StreamError as StreamError, - TimeoutException as TimeoutException, - TooManyRedirects as TooManyRedirects, - TransportError as TransportError, - UnsupportedProtocol as UnsupportedProtocol, - WriteError as WriteError, - WriteTimeout as WriteTimeout, -) -from ._models import ( - Cookies as Cookies, - Headers as Headers, - Request as Request, - Response as Response, -) -from ._status_codes import codes as codes -from ._transports.asgi import ASGITransport as ASGITransport -from ._transports.base import ( - AsyncBaseTransport as AsyncBaseTransport, - BaseTransport as BaseTransport, -) -from ._transports.default import ( - AsyncHTTPTransport as AsyncHTTPTransport, - HTTPTransport as HTTPTransport, -) -from ._transports.wsgi import WSGITransport as WSGITransport -from ._types import ( - AsyncByteStream as AsyncByteStream, - SyncByteStream as SyncByteStream, -) -from ._urls import ( - QueryParams as QueryParams, - URL as URL, -) - -__all__ = [ - "__description__", - "__title__", - "__version__", - "ASGITransport", - "AsyncBaseTransport", - "AsyncByteStream", - "AsyncClient", - "AsyncHTTPTransport", - "Auth", - "BaseTransport", - "BasicAuth", - "ByteStream", - "Client", - "CloseError", - "codes", - "ConnectError", - "ConnectTimeout", - "CookieConflict", - "Cookies", - "create_ssl_context", - "DecodingError", - "delete", - "DigestAuth", - "get", - "head", - "Headers", - "HTTPError", - "HTTPStatusError", - "HTTPTransport", - "InvalidURL", - "Limits", - "LocalProtocolError", - "NetRCAuth", - "NetworkError", - "options", - "patch", - "PoolTimeout", - "post", - "ProtocolError", - "Proxy", - "ProxyError", - "put", - "QueryParams", - "ReadError", - "ReadTimeout", - "RemoteProtocolError", - "request", - "Request", - "RequestError", - "RequestNotRead", - "Response", - "ResponseNotRead", - "stream", - "StreamClosed", - "StreamConsumed", - "StreamError", - "SyncByteStream", - "Timeout", - "TimeoutException", - "TooManyRedirects", - "TransportError", - "UnsupportedProtocol", - "URL", - "USE_CLIENT_DEFAULT", - "WriteError", - "WriteTimeout", - "WSGITransport", -] diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/__version__.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/__version__.pyi deleted file mode 100644 index 5137fe5e4e..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/__version__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -__title__: str -__description__: str -__version__: str diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_api.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_api.pyi deleted file mode 100644 index ec0ba22e53..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_api.pyi +++ /dev/null @@ -1,170 +0,0 @@ -from contextlib import contextmanager -from typing import Any, Iterator, Mapping, Optional - -from ._models import Response -from ._types import ( - AuthTypes, - CertTypes, - CookieTypes, - HeaderTypes, - ProxyTypes, - QueryParamTypes, - RequestContent, - RequestExtensions, - RequestFiles, - TimeoutTypes, - URLTypes, - VerifyTypes, -) - -def request( - method: str, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Optional[AuthTypes] = ..., - proxy: Optional[ProxyTypes] = ..., - timeout: TimeoutTypes = ..., - follow_redirects: bool = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - trust_env: bool = ..., - extensions: Optional[RequestExtensions] = ..., -) -> Response: ... -@contextmanager -def stream( - method: str, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Optional[AuthTypes] = ..., - proxy: Optional[ProxyTypes] = ..., - timeout: TimeoutTypes = ..., - follow_redirects: bool = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - trust_env: bool = ..., - extensions: Optional[RequestExtensions] = ..., -) -> Iterator[Response]: ... -def get( - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Optional[AuthTypes] = ..., - proxy: Optional[ProxyTypes] = ..., - follow_redirects: bool = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - timeout: TimeoutTypes = ..., - trust_env: bool = ..., -) -> Response: ... -def options( - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Optional[AuthTypes] = ..., - proxy: Optional[ProxyTypes] = ..., - follow_redirects: bool = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - timeout: TimeoutTypes = ..., - trust_env: bool = ..., -) -> Response: ... -def head( - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Optional[AuthTypes] = ..., - proxy: Optional[ProxyTypes] = ..., - follow_redirects: bool = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - timeout: TimeoutTypes = ..., - trust_env: bool = ..., -) -> Response: ... -def post( - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Optional[AuthTypes] = ..., - proxy: Optional[ProxyTypes] = ..., - follow_redirects: bool = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - timeout: TimeoutTypes = ..., - trust_env: bool = ..., -) -> Response: ... -def put( - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Optional[AuthTypes] = ..., - proxy: Optional[ProxyTypes] = ..., - follow_redirects: bool = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - timeout: TimeoutTypes = ..., - trust_env: bool = ..., -) -> Response: ... -def patch( - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Optional[AuthTypes] = ..., - proxy: Optional[ProxyTypes] = ..., - follow_redirects: bool = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - timeout: TimeoutTypes = ..., - trust_env: bool = ..., -) -> Response: ... -def delete( - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Optional[AuthTypes] = ..., - proxy: Optional[ProxyTypes] = ..., - follow_redirects: bool = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - timeout: TimeoutTypes = ..., - trust_env: bool = ..., -) -> Response: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_auth.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_auth.pyi deleted file mode 100644 index f0e63e91a3..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_auth.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from typing import AsyncGenerator, Callable, Generator, Optional, Union - -from ._models import Request, Response - -class Auth: - requires_request_body: bool - requires_response_body: bool - def auth_flow(self, request: Request) -> Generator[Request, Response, None]: ... - def sync_auth_flow(self, request: Request) -> Generator[Request, Response, None]: ... - async def async_auth_flow(self, request: Request) -> AsyncGenerator[Request, Response]: ... - -class FunctionAuth(Auth): - def __init__(self, func: Callable[[Request], Request]) -> None: ... - -class BasicAuth(Auth): - def __init__(self, username: Union[str, bytes], password: Union[str, bytes]) -> None: ... - -class DigestAuth(Auth): - def __init__(self, username: Union[str, bytes], password: Union[str, bytes]) -> None: ... - -class NetRCAuth(Auth): - def __init__(self, file: Optional[str] = ...) -> None: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_client.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_client.pyi deleted file mode 100644 index 56730e3529..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_client.pyi +++ /dev/null @@ -1,462 +0,0 @@ -import enum -from contextlib import contextmanager -from types import TracebackType -from typing import ( - Any, - Callable, - Iterator, - List, - Mapping, - Optional, - Type, - Union, -) - -from ._auth import Auth -from ._config import Limits, Timeout -from ._models import Cookies, Headers, Request, Response -from ._transports.base import AsyncBaseTransport, BaseTransport -from ._types import ( - AuthTypes, - CertTypes, - CookieTypes, - HeaderTypes, - ProxyTypes, - QueryParamTypes, - RequestContent, - RequestExtensions, - RequestFiles, - TimeoutTypes, - URLTypes, - VerifyTypes, -) -from ._urls import URL, QueryParams - -class UseClientDefault: ... - -USE_CLIENT_DEFAULT: UseClientDefault - -class ClientState(enum.Enum): - UNOPENED = 1 - OPENED = 2 - CLOSED = 3 - -class BaseClient: - def __init__( - self, - *, - auth: Optional[AuthTypes] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - timeout: TimeoutTypes = ..., - follow_redirects: bool = ..., - max_redirects: int = ..., - event_hooks: Optional[Mapping[str, List[Callable[..., Any]]]] = ..., - base_url: URLTypes = ..., - trust_env: bool = ..., - default_encoding: Union[str, Callable[[bytes], str]] = ..., - ) -> None: ... - @property - def is_closed(self) -> bool: ... - @property - def trust_env(self) -> bool: ... - @property - def timeout(self) -> Timeout: ... - @timeout.setter - def timeout(self, timeout: TimeoutTypes) -> None: ... - @property - def event_hooks(self) -> dict[str, List[Callable[..., Any]]]: ... - @event_hooks.setter - def event_hooks(self, event_hooks: Mapping[str, List[Callable[..., Any]]]) -> None: ... - @property - def auth(self) -> Optional[Auth]: ... - @auth.setter - def auth(self, auth: AuthTypes) -> None: ... - @property - def base_url(self) -> URL: ... - @base_url.setter - def base_url(self, url: URLTypes) -> None: ... - @property - def headers(self) -> Headers: ... - @headers.setter - def headers(self, headers: HeaderTypes) -> None: ... - @property - def cookies(self) -> Cookies: ... - @cookies.setter - def cookies(self, cookies: CookieTypes) -> None: ... - @property - def params(self) -> QueryParams: ... - @params.setter - def params(self, params: QueryParamTypes) -> None: ... - @property - def follow_redirects(self) -> bool: ... - @follow_redirects.setter - def follow_redirects(self, value: bool) -> None: ... - def build_request( - self, - method: str, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Request: ... - -class Client(BaseClient): - def __init__( - self, - *, - auth: Optional[AuthTypes] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - http1: bool = ..., - http2: bool = ..., - proxy: Optional[ProxyTypes] = ..., - mounts: Optional[Mapping[str, Optional[BaseTransport]]] = ..., - timeout: TimeoutTypes = ..., - follow_redirects: bool = ..., - limits: Limits = ..., - max_redirects: int = ..., - event_hooks: Optional[Mapping[str, List[Callable[..., Any]]]] = ..., - base_url: URLTypes = ..., - transport: Optional[BaseTransport] = ..., - trust_env: bool = ..., - default_encoding: Union[str, Callable[[bytes], str]] = ..., - ) -> None: ... - def __enter__(self) -> "Client": ... - def __exit__( - self, - exc_type: Optional[Type[BaseException]] = ..., - exc_value: Optional[BaseException] = ..., - traceback: Optional[TracebackType] = ..., - ) -> None: ... - def close(self) -> None: ... - def send( - self, - request: Request, - *, - stream: bool = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - ) -> Response: ... - def request( - self, - method: str, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - @contextmanager - def stream( - self, - method: str, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Iterator[Response]: ... - def get( - self, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - def options( - self, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - def head( - self, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - def post( - self, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - def put( - self, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - def patch( - self, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - def delete( - self, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - -class AsyncClient(BaseClient): - def __init__( - self, - *, - auth: Optional[AuthTypes] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - http1: bool = ..., - http2: bool = ..., - proxy: Optional[ProxyTypes] = ..., - mounts: Optional[Mapping[str, Optional[AsyncBaseTransport]]] = ..., - timeout: TimeoutTypes = ..., - follow_redirects: bool = ..., - limits: Limits = ..., - max_redirects: int = ..., - event_hooks: Optional[Mapping[str, List[Callable[..., Any]]]] = ..., - base_url: URLTypes = ..., - transport: Optional[AsyncBaseTransport] = ..., - trust_env: bool = ..., - default_encoding: Union[str, Callable[[bytes], str]] = ..., - ) -> None: ... - async def __aenter__(self) -> "AsyncClient": ... - async def __aexit__( - self, - exc_type: Optional[Type[BaseException]] = ..., - exc_value: Optional[BaseException] = ..., - traceback: Optional[TracebackType] = ..., - ) -> None: ... - async def aclose(self) -> None: ... - async def send( - self, - request: Request, - *, - stream: bool = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - ) -> Response: ... - async def request( - self, - method: str, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - def stream( - self, - method: str, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> "_AsyncStreamContextManager": ... - async def get( - self, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - async def options( - self, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - async def head( - self, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - async def post( - self, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - async def put( - self, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - async def patch( - self, - url: URLTypes, - *, - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - async def delete( - self, - url: URLTypes, - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - auth: Union[AuthTypes, UseClientDefault, None] = ..., - follow_redirects: Union[bool, UseClientDefault] = ..., - timeout: Union[TimeoutTypes, UseClientDefault] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> Response: ... - -class _AsyncStreamContextManager: - async def __aenter__(self) -> Response: ... - async def __aexit__( - self, - exc_type: Optional[Type[BaseException]] = ..., - exc_value: Optional[BaseException] = ..., - traceback: Optional[TracebackType] = ..., - ) -> None: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_config.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_config.pyi deleted file mode 100644 index e3c10851d0..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_config.pyi +++ /dev/null @@ -1,59 +0,0 @@ -import ssl -from typing import Any, Optional - -from ._types import CertTypes, URLTypes, VerifyTypes - -DEFAULT_TIMEOUT_CONFIG: "Timeout" -DEFAULT_LIMITS: "Limits" -DEFAULT_MAX_REDIRECTS: int - -def create_ssl_context( - cert: Optional[CertTypes] = ..., - verify: VerifyTypes = ..., - trust_env: bool = ..., - http2: bool = ..., -) -> ssl.SSLContext: ... - -class Timeout: - connect: Optional[float] - read: Optional[float] - write: Optional[float] - pool: Optional[float] - def __init__( - self, - timeout: Any = ..., - *, - connect: Optional[float] = ..., - read: Optional[float] = ..., - write: Optional[float] = ..., - pool: Optional[float] = ..., - ) -> None: ... - def as_dict(self) -> dict[str, Optional[float]]: ... - def __eq__(self, other: Any) -> bool: ... - -class Limits: - max_connections: Optional[int] - max_keepalive_connections: Optional[int] - keepalive_expiry: Optional[float] - def __init__( - self, - *, - max_connections: Optional[int] = ..., - max_keepalive_connections: Optional[int] = ..., - keepalive_expiry: Optional[float] = ..., - ) -> None: ... - def __eq__(self, other: Any) -> bool: ... - -class Proxy: - url: Any - headers: Any - ssl_context: Optional[ssl.SSLContext] - auth: Optional[tuple[str, str]] - def __init__( - self, - url: URLTypes, - *, - ssl_context: Optional[ssl.SSLContext] = ..., - auth: Optional[tuple[str, str]] = ..., - headers: Any = ..., - ) -> None: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_content.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_content.pyi deleted file mode 100644 index db5d95a666..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_content.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import AsyncIterator, Iterator - -from ._types import AsyncByteStream, SyncByteStream - -class ByteStream(AsyncByteStream, SyncByteStream): - def __init__(self, stream: bytes) -> None: ... - def __iter__(self) -> Iterator[bytes]: ... - def __aiter__(self) -> AsyncIterator[bytes]: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_exceptions.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_exceptions.pyi deleted file mode 100644 index 12ae599452..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_exceptions.pyi +++ /dev/null @@ -1,51 +0,0 @@ -from typing import Optional - -from ._models import Request, Response - -class HTTPError(Exception): - def __init__(self, message: str) -> None: ... - -class RequestError(HTTPError): - def __init__(self, message: str, *, request: Optional[Request] = ...) -> None: ... - @property - def request(self) -> Request: ... - @request.setter - def request(self, request: Request) -> None: ... - -class TransportError(RequestError): ... -class TimeoutException(TransportError): ... -class ConnectTimeout(TimeoutException): ... -class ReadTimeout(TimeoutException): ... -class WriteTimeout(TimeoutException): ... -class PoolTimeout(TimeoutException): ... -class NetworkError(TransportError): ... -class ConnectError(NetworkError): ... -class ReadError(NetworkError): ... -class WriteError(NetworkError): ... -class CloseError(NetworkError): ... -class ProxyError(TransportError): ... -class UnsupportedProtocol(TransportError): ... -class ProtocolError(TransportError): ... -class LocalProtocolError(ProtocolError): ... -class RemoteProtocolError(ProtocolError): ... -class DecodingError(RequestError): ... -class TooManyRedirects(RequestError): ... - -class HTTPStatusError(HTTPError): - request: Request - response: Response - def __init__(self, message: str, *, request: Request, response: Response) -> None: ... - -class InvalidURL(Exception): - def __init__(self, message: str) -> None: ... - -class CookieConflict(Exception): - def __init__(self, message: str) -> None: ... - -class StreamError(RuntimeError): - def __init__(self, message: str) -> None: ... - -class StreamConsumed(StreamError): ... -class StreamClosed(StreamError): ... -class ResponseNotRead(StreamError): ... -class RequestNotRead(StreamError): ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_models.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_models.pyi deleted file mode 100644 index 766bc927f3..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_models.pyi +++ /dev/null @@ -1,174 +0,0 @@ -import datetime -from http.cookiejar import CookieJar -from typing import ( - Any, - AsyncIterator, - Callable, - Iterator, - List, - Mapping, - Optional, - Tuple, - Union, -) - -from ._types import ( - CookieTypes, - HeaderTypes, - QueryParamTypes, - RequestContent, - RequestExtensions, - RequestFiles, - ResponseContent, - ResponseExtensions, -) -from ._urls import URL - -class Headers(Mapping[str, str]): - def __init__( - self, - headers: Optional[HeaderTypes] = ..., - encoding: Optional[str] = ..., - ) -> None: ... - @property - def encoding(self) -> str: ... - @encoding.setter - def encoding(self, value: str) -> None: ... - @property - def raw(self) -> List[Tuple[bytes, bytes]]: ... - def keys(self) -> List[str]: ... - def values(self) -> List[str]: ... - def items(self) -> List[Tuple[str, str]]: ... - def multi_items(self) -> List[Tuple[str, str]]: ... - def get(self, key: str, default: Any = ...) -> Any: ... - def get_list(self, key: str, split_commas: bool = ...) -> List[str]: ... - def update(self, headers: Optional[HeaderTypes] = ...) -> None: ... - def copy(self) -> "Headers": ... - def __getitem__(self, key: str) -> str: ... - def __setitem__(self, key: str, value: str) -> None: ... - def __delitem__(self, key: str) -> None: ... - def __contains__(self, key: Any) -> bool: ... - def __iter__(self) -> Iterator[str]: ... - def __len__(self) -> int: ... - def __eq__(self, other: Any) -> bool: ... - -class Request: - method: str - url: URL - headers: Headers - extensions: RequestExtensions - stream: Any - def __init__( - self, - method: Union[str, bytes], - url: Union[URL, str], - *, - params: Optional[QueryParamTypes] = ..., - headers: Optional[HeaderTypes] = ..., - cookies: Optional[CookieTypes] = ..., - content: Optional[RequestContent] = ..., - data: Optional[Mapping[str, Any]] = ..., - files: Optional[RequestFiles] = ..., - json: Optional[Any] = ..., - stream: Optional[Any] = ..., - extensions: Optional[RequestExtensions] = ..., - ) -> None: ... - @property - def content(self) -> bytes: ... - def read(self) -> bytes: ... - async def aread(self) -> bytes: ... - -class Response: - status_code: int - headers: Headers - extensions: ResponseExtensions - history: List["Response"] - is_closed: bool - is_stream_consumed: bool - request: Request - stream: Any - default_encoding: Union[str, Callable[[bytes], str]] - def __init__( - self, - status_code: int, - *, - headers: Optional[HeaderTypes] = ..., - content: Optional[ResponseContent] = ..., - text: Optional[str] = ..., - html: Optional[str] = ..., - json: Any = ..., - stream: Optional[Any] = ..., - request: Optional[Request] = ..., - extensions: Optional[ResponseExtensions] = ..., - history: Optional[List["Response"]] = ..., - default_encoding: Union[str, Callable[[bytes], str]] = ..., - ) -> None: ... - @property - def elapsed(self) -> datetime.timedelta: ... - @elapsed.setter - def elapsed(self, elapsed: datetime.timedelta) -> None: ... - @property - def reason_phrase(self) -> str: ... - @property - def url(self) -> URL: ... - @property - def content(self) -> bytes: ... - @property - def text(self) -> str: ... - @property - def encoding(self) -> Optional[str]: ... - @encoding.setter - def encoding(self, value: str) -> None: ... - @property - def charset_encoding(self) -> Optional[str]: ... - @property - def is_informational(self) -> bool: ... - @property - def is_success(self) -> bool: ... - @property - def is_redirect(self) -> bool: ... - @property - def is_client_error(self) -> bool: ... - @property - def is_server_error(self) -> bool: ... - @property - def is_error(self) -> bool: ... - @property - def has_redirect_location(self) -> bool: ... - @property - def cookies(self) -> "Cookies": ... - @property - def links(self) -> dict[Optional[str], dict[str, str]]: ... - @property - def num_bytes_downloaded(self) -> int: ... - def json(self, **kwargs: Any) -> Any: ... - def raise_for_status(self) -> "Response": ... - def read(self) -> bytes: ... - def iter_bytes(self, chunk_size: Optional[int] = ...) -> Iterator[bytes]: ... - def iter_text(self, chunk_size: Optional[int] = ...) -> Iterator[str]: ... - def iter_lines(self) -> Iterator[str]: ... - def iter_raw(self, chunk_size: Optional[int] = ...) -> Iterator[bytes]: ... - def close(self) -> None: ... - async def aread(self) -> bytes: ... - def aiter_bytes(self, chunk_size: Optional[int] = ...) -> AsyncIterator[bytes]: ... - def aiter_text(self, chunk_size: Optional[int] = ...) -> AsyncIterator[str]: ... - def aiter_lines(self) -> AsyncIterator[str]: ... - def aiter_raw(self, chunk_size: Optional[int] = ...) -> AsyncIterator[bytes]: ... - async def aclose(self) -> None: ... - -class Cookies(Mapping[str, str]): - jar: CookieJar - def __init__(self, cookies: Optional[CookieTypes] = ...) -> None: ... - def extract_cookies(self, response: Response) -> None: ... - def set_cookie_header(self, request: Request) -> None: ... - def set(self, name: str, value: str, domain: str = ..., path: str = ...) -> None: ... - def get(self, name: str, default: Any = ..., domain: Optional[str] = ..., path: Optional[str] = ...) -> Any: ... - def delete(self, name: str, domain: Optional[str] = ..., path: Optional[str] = ...) -> None: ... - def clear(self, domain: Optional[str] = ..., path: Optional[str] = ...) -> None: ... - def update(self, cookies: Optional[CookieTypes] = ...) -> None: ... - def __getitem__(self, name: str) -> str: ... - def __setitem__(self, name: str, value: str) -> None: ... - def __delitem__(self, name: str) -> None: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[str]: ... - def __contains__(self, name: Any) -> bool: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_status_codes.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_status_codes.pyi deleted file mode 100644 index 9d26d2d5eb..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_status_codes.pyi +++ /dev/null @@ -1,84 +0,0 @@ -from enum import IntEnum - -class codes(IntEnum): - CONTINUE = 100 - SWITCHING_PROTOCOLS = 101 - PROCESSING = 102 - EARLY_HINTS = 103 - - OK = 200 - CREATED = 201 - ACCEPTED = 202 - NON_AUTHORITATIVE_INFORMATION = 203 - NO_CONTENT = 204 - RESET_CONTENT = 205 - PARTIAL_CONTENT = 206 - MULTI_STATUS = 207 - ALREADY_REPORTED = 208 - IM_USED = 226 - - MULTIPLE_CHOICES = 300 - MOVED_PERMANENTLY = 301 - FOUND = 302 - SEE_OTHER = 303 - NOT_MODIFIED = 304 - USE_PROXY = 305 - TEMPORARY_REDIRECT = 307 - PERMANENT_REDIRECT = 308 - - BAD_REQUEST = 400 - UNAUTHORIZED = 401 - PAYMENT_REQUIRED = 402 - FORBIDDEN = 403 - NOT_FOUND = 404 - METHOD_NOT_ALLOWED = 405 - NOT_ACCEPTABLE = 406 - PROXY_AUTHENTICATION_REQUIRED = 407 - REQUEST_TIMEOUT = 408 - CONFLICT = 409 - GONE = 410 - LENGTH_REQUIRED = 411 - PRECONDITION_FAILED = 412 - REQUEST_ENTITY_TOO_LARGE = 413 - REQUEST_URI_TOO_LONG = 414 - UNSUPPORTED_MEDIA_TYPE = 415 - REQUESTED_RANGE_NOT_SATISFIABLE = 416 - EXPECTATION_FAILED = 417 - IM_A_TEAPOT = 418 - MISDIRECTED_REQUEST = 421 - UNPROCESSABLE_ENTITY = 422 - LOCKED = 423 - FAILED_DEPENDENCY = 424 - TOO_EARLY = 425 - UPGRADE_REQUIRED = 426 - PRECONDITION_REQUIRED = 428 - TOO_MANY_REQUESTS = 429 - REQUEST_HEADER_FIELDS_TOO_LARGE = 431 - UNAVAILABLE_FOR_LEGAL_REASONS = 451 - - INTERNAL_SERVER_ERROR = 500 - NOT_IMPLEMENTED = 501 - BAD_GATEWAY = 502 - SERVICE_UNAVAILABLE = 503 - GATEWAY_TIMEOUT = 504 - HTTP_VERSION_NOT_SUPPORTED = 505 - VARIANT_ALSO_NEGOTIATES = 506 - INSUFFICIENT_STORAGE = 507 - LOOP_DETECTED = 508 - NOT_EXTENDED = 510 - NETWORK_AUTHENTICATION_REQUIRED = 511 - - @classmethod - def is_informational(cls, value: int) -> bool: ... - @classmethod - def is_success(cls, value: int) -> bool: ... - @classmethod - def is_redirect(cls, value: int) -> bool: ... - @classmethod - def is_client_error(cls, value: int) -> bool: ... - @classmethod - def is_server_error(cls, value: int) -> bool: ... - @classmethod - def is_error(cls, value: int) -> bool: ... - @classmethod - def get_reason_phrase(cls, value: int) -> str: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/__init__.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/asgi.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/asgi.pyi deleted file mode 100644 index 5d9d9a173b..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/asgi.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from typing import Any - -from .._models import Request, Response -from .base import AsyncBaseTransport - -class ASGITransport(AsyncBaseTransport): - def __init__( - self, - app: Any, - raise_app_exceptions: bool = ..., - root_path: str = ..., - client: tuple[str, int] = ..., - ) -> None: ... - async def handle_async_request(self, request: Request) -> Response: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/base.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/base.pyi deleted file mode 100644 index 7ab74a3480..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/base.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from types import TracebackType -from typing import Optional, Type - -from .._models import Request, Response - -class BaseTransport: - def __enter__(self) -> "BaseTransport": ... - def __exit__( - self, - exc_type: Optional[Type[BaseException]] = ..., - exc_value: Optional[BaseException] = ..., - traceback: Optional[TracebackType] = ..., - ) -> None: ... - def handle_request(self, request: Request) -> Response: ... - def close(self) -> None: ... - -class AsyncBaseTransport: - async def __aenter__(self) -> "AsyncBaseTransport": ... - async def __aexit__( - self, - exc_type: Optional[Type[BaseException]] = ..., - exc_value: Optional[BaseException] = ..., - traceback: Optional[TracebackType] = ..., - ) -> None: ... - async def handle_async_request(self, request: Request) -> Response: ... - async def aclose(self) -> None: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/default.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/default.pyi deleted file mode 100644 index 6f140d1708..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/default.pyi +++ /dev/null @@ -1,40 +0,0 @@ -from typing import Any, Optional - -from .._config import Limits -from .._models import Request, Response -from .._types import CertTypes, ProxyTypes, VerifyTypes -from .base import AsyncBaseTransport, BaseTransport - -class HTTPTransport(BaseTransport): - def __init__( - self, - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - http1: bool = ..., - http2: bool = ..., - limits: Limits = ..., - trust_env: bool = ..., - proxy: Optional[ProxyTypes] = ..., - uds: Optional[str] = ..., - local_address: Optional[str] = ..., - retries: int = ..., - socket_options: Optional[Any] = ..., - ) -> None: ... - def handle_request(self, request: Request) -> Response: ... - -class AsyncHTTPTransport(AsyncBaseTransport): - def __init__( - self, - verify: VerifyTypes = ..., - cert: Optional[CertTypes] = ..., - http1: bool = ..., - http2: bool = ..., - limits: Limits = ..., - trust_env: bool = ..., - proxy: Optional[ProxyTypes] = ..., - uds: Optional[str] = ..., - local_address: Optional[str] = ..., - retries: int = ..., - socket_options: Optional[Any] = ..., - ) -> None: ... - async def handle_async_request(self, request: Request) -> Response: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/wsgi.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/wsgi.pyi deleted file mode 100644 index bb5ce5d9ce..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_transports/wsgi.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from typing import Any, Optional - -from .._models import Request, Response -from .base import BaseTransport - -class WSGITransport(BaseTransport): - def __init__( - self, - app: Any, - raise_app_exceptions: bool = ..., - script_name: str = ..., - remote_addr: str = ..., - wsgi_errors: Optional[Any] = ..., - ) -> None: ... - def handle_request(self, request: Request) -> Response: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_types.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_types.pyi deleted file mode 100644 index 4ea542caaa..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_types.pyi +++ /dev/null @@ -1,84 +0,0 @@ -import ssl -from typing import ( - IO, - Any, - AsyncIterable, - AsyncIterator, - Callable, - Iterable, - Iterator, - List, - Mapping, - Optional, - Sequence, - Tuple, - Union, -) - -from ._auth import Auth -from ._config import Proxy, Timeout -from ._models import Cookies, Headers, Request, Response -from ._urls import URL, QueryParams - -PrimitiveData = Optional[Union[str, int, float, bool]] - -URLTypes = Union[URL, str] - -QueryParamTypes = Union[ - QueryParams, - Mapping[str, Union[PrimitiveData, Sequence[PrimitiveData]]], - List[Tuple[str, PrimitiveData]], - Tuple[Tuple[str, PrimitiveData], ...], - str, - bytes, -] - -HeaderTypes = Union[ - Headers, - Mapping[str, str], - Mapping[bytes, bytes], - Sequence[Tuple[str, str]], - Sequence[Tuple[bytes, bytes]], -] - -CookieTypes = Union[Cookies, Mapping[str, str], List[Tuple[str, str]]] - -CertTypes = Union[str, Tuple[str, str], Tuple[str, str, str]] -VerifyTypes = Union[str, bool, ssl.SSLContext] -TimeoutTypes = Union[ - Optional[float], - Tuple[Optional[float], Optional[float], Optional[float], Optional[float]], - Timeout, -] -ProxyTypes = Union[URLTypes, Proxy] - -AuthTypes = Union[ - Tuple[Union[str, bytes], Union[str, bytes]], - Callable[[Request], Request], - Auth, -] - -RequestContent = Union[str, bytes, Iterable[bytes], AsyncIterable[bytes]] -ResponseContent = Union[str, bytes, Iterable[bytes], AsyncIterable[bytes]] - -RequestData = Mapping[str, Any] - -FileContent = Union[IO[bytes], bytes, str] -FileTypes = Union[ - FileContent, - Tuple[Optional[str], FileContent], - Tuple[Optional[str], FileContent, Optional[str]], - Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], -] -RequestFiles = Union[Mapping[str, FileTypes], Sequence[Tuple[str, FileTypes]]] - -RequestExtensions = Mapping[str, Any] -ResponseExtensions = Mapping[str, Any] - -class SyncByteStream: - def __iter__(self) -> Iterator[bytes]: ... - def close(self) -> None: ... - -class AsyncByteStream: - def __aiter__(self) -> AsyncIterator[bytes]: ... - async def aclose(self) -> None: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_urls.pyi b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_urls.pyi deleted file mode 100644 index a37d767688..0000000000 --- a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/_urls.pyi +++ /dev/null @@ -1,66 +0,0 @@ -from typing import Any, List, Mapping, Optional, Tuple, Union - -from ._types import QueryParamTypes - -class URL: - def __init__(self, url: Union["URL", str] = ..., **kwargs: Any) -> None: ... - @property - def scheme(self) -> str: ... - @property - def raw_scheme(self) -> bytes: ... - @property - def userinfo(self) -> bytes: ... - @property - def username(self) -> str: ... - @property - def password(self) -> str: ... - @property - def host(self) -> str: ... - @property - def raw_host(self) -> bytes: ... - @property - def port(self) -> Optional[int]: ... - @property - def netloc(self) -> bytes: ... - @property - def path(self) -> str: ... - @property - def query(self) -> bytes: ... - @property - def params(self) -> "QueryParams": ... - @property - def raw_path(self) -> bytes: ... - @property - def fragment(self) -> str: ... - @property - def is_absolute_url(self) -> bool: ... - @property - def is_relative_url(self) -> bool: ... - def copy_with(self, **kwargs: Any) -> "URL": ... - def copy_set_param(self, key: str, value: Any = ...) -> "URL": ... - def copy_add_param(self, key: str, value: Any = ...) -> "URL": ... - def copy_remove_param(self, key: str) -> "URL": ... - def copy_merge_params(self, params: QueryParamTypes) -> "URL": ... - def join(self, url: Union["URL", str]) -> "URL": ... - def __hash__(self) -> int: ... - def __eq__(self, other: Any) -> bool: ... - def __str__(self) -> str: ... - -class QueryParams(Mapping[str, str]): - def __init__(self, *args: Optional[QueryParamTypes], **kwargs: Any) -> None: ... - def keys(self) -> Any: ... - def values(self) -> Any: ... - def items(self) -> Any: ... - def multi_items(self) -> List[Tuple[str, str]]: ... - def get(self, key: Any, default: Any = ...) -> Any: ... - def get_list(self, key: str) -> List[str]: ... - def set(self, key: str, value: Any = ...) -> "QueryParams": ... - def add(self, key: str, value: Any = ...) -> "QueryParams": ... - def remove(self, key: str) -> "QueryParams": ... - def merge(self, params: Optional[QueryParamTypes] = ...) -> "QueryParams": ... - def __getitem__(self, key: str) -> str: ... - def __contains__(self, key: Any) -> bool: ... - def __iter__(self) -> Any: ... - def __len__(self) -> int: ... - def __eq__(self, other: Any) -> bool: ... - def __str__(self) -> str: ... diff --git a/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/py.typed b/crates/pyrefly_bundled/third_party/stubs/httpx-stubs/py.typed deleted file mode 100644 index e69de29bb2..0000000000