Skip to content

Commit

Permalink
Change imports from httpx._client to httpx._config
Browse files Browse the repository at this point in the history
  • Loading branch information
karpetrosyan committed Mar 3, 2024
1 parent 042f2d1 commit dd80860
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ full = [
"jinja2",
"python-multipart>=0.0.7",
"pyyaml",
"httpx>=0.22.0",
]

[project.urls]
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ mkautodoc==0.2.0
# Packaging
build==1.1.1
twine==5.0.0

# httpx test
httpx @ git+https://github.com/encode/httpx@use-unasync
38 changes: 19 additions & 19 deletions starlette/testclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,9 @@ def _portal_factory(self) -> typing.Generator[anyio.abc.BlockingPortal, None, No

def _choose_redirect_arg(
self, follow_redirects: bool | None, allow_redirects: bool | None
) -> bool | httpx._client.UseClientDefault:
redirect: bool | httpx._client.UseClientDefault = (
httpx._client.USE_CLIENT_DEFAULT
) -> bool | httpx._config.UseClientDefault:
redirect: bool | httpx._config.UseClientDefault = (
httpx._config.USE_CLIENT_DEFAULT
)
if allow_redirects is not None:
message = (
Expand Down Expand Up @@ -504,11 +504,11 @@ def request( # type: ignore[override]
headers: httpx._types.HeaderTypes | None = None,
cookies: httpx._types.CookieTypes | None = None,
auth: httpx._types.AuthTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
follow_redirects: bool | None = None,
allow_redirects: bool | None = None,
timeout: httpx._types.TimeoutTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
url = self._merge_url(url)
Expand Down Expand Up @@ -537,11 +537,11 @@ def get( # type: ignore[override]
headers: httpx._types.HeaderTypes | None = None,
cookies: httpx._types.CookieTypes | None = None,
auth: httpx._types.AuthTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
follow_redirects: bool | None = None,
allow_redirects: bool | None = None,
timeout: httpx._types.TimeoutTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
redirect = self._choose_redirect_arg(follow_redirects, allow_redirects)
Expand All @@ -564,11 +564,11 @@ def options( # type: ignore[override]
headers: httpx._types.HeaderTypes | None = None,
cookies: httpx._types.CookieTypes | None = None,
auth: httpx._types.AuthTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
follow_redirects: bool | None = None,
allow_redirects: bool | None = None,
timeout: httpx._types.TimeoutTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
redirect = self._choose_redirect_arg(follow_redirects, allow_redirects)
Expand All @@ -591,11 +591,11 @@ def head( # type: ignore[override]
headers: httpx._types.HeaderTypes | None = None,
cookies: httpx._types.CookieTypes | None = None,
auth: httpx._types.AuthTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
follow_redirects: bool | None = None,
allow_redirects: bool | None = None,
timeout: httpx._types.TimeoutTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
redirect = self._choose_redirect_arg(follow_redirects, allow_redirects)
Expand All @@ -622,11 +622,11 @@ def post( # type: ignore[override]
headers: httpx._types.HeaderTypes | None = None,
cookies: httpx._types.CookieTypes | None = None,
auth: httpx._types.AuthTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
follow_redirects: bool | None = None,
allow_redirects: bool | None = None,
timeout: httpx._types.TimeoutTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
redirect = self._choose_redirect_arg(follow_redirects, allow_redirects)
Expand Down Expand Up @@ -657,11 +657,11 @@ def put( # type: ignore[override]
headers: httpx._types.HeaderTypes | None = None,
cookies: httpx._types.CookieTypes | None = None,
auth: httpx._types.AuthTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
follow_redirects: bool | None = None,
allow_redirects: bool | None = None,
timeout: httpx._types.TimeoutTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
redirect = self._choose_redirect_arg(follow_redirects, allow_redirects)
Expand Down Expand Up @@ -692,11 +692,11 @@ def patch( # type: ignore[override]
headers: httpx._types.HeaderTypes | None = None,
cookies: httpx._types.CookieTypes | None = None,
auth: httpx._types.AuthTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
follow_redirects: bool | None = None,
allow_redirects: bool | None = None,
timeout: httpx._types.TimeoutTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
redirect = self._choose_redirect_arg(follow_redirects, allow_redirects)
Expand All @@ -723,11 +723,11 @@ def delete( # type: ignore[override]
headers: httpx._types.HeaderTypes | None = None,
cookies: httpx._types.CookieTypes | None = None,
auth: httpx._types.AuthTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
follow_redirects: bool | None = None,
allow_redirects: bool | None = None,
timeout: httpx._types.TimeoutTypes
| httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
| httpx._config.UseClientDefault = httpx._config.USE_CLIENT_DEFAULT,
extensions: dict[str, typing.Any] | None = None,
) -> httpx.Response:
redirect = self._choose_redirect_arg(follow_redirects, allow_redirects)
Expand Down

0 comments on commit dd80860

Please sign in to comment.