From adbcd0e0e7fcb174ce60772c7d6104b8b9d329ca Mon Sep 17 00:00:00 2001 From: Kar Petrosyan <92274156+karosis88@users.noreply.github.com> Date: Mon, 11 Sep 2023 02:29:22 -0400 Subject: [PATCH] Change extensions type (#2803) * Change extensions type * Update changelog * install httpcore from the git * Revert "install httpcore from the git" This reverts commit 1813c6aff178cce3b63d7458ec9a8337542de9dd. * bump httpcore version * fix requirements --------- Co-authored-by: Tom Christie --- CHANGELOG.md | 1 + httpx/_types.py | 5 +++-- pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4f49c45d1..6fc53394a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added +* Change the type of `Extensions` from `Mapping[Str, Any]` to `MutableMapping[Str, Any]`. (#2803) * Add `socket_options` argument to `httpx.HTTPTransport` and `httpx.AsyncHTTPTransport` classes. (#2716) * The `Response.raise_for_status()` method now returns the response instance. For example: `data = httpx.get('...').raise_for_status().json()`. (#2776) diff --git a/httpx/_types.py b/httpx/_types.py index 6b610e1408..83cf35a32a 100644 --- a/httpx/_types.py +++ b/httpx/_types.py @@ -16,6 +16,7 @@ Iterator, List, Mapping, + MutableMapping, NamedTuple, Optional, Sequence, @@ -87,7 +88,7 @@ RequestContent = Union[str, bytes, Iterable[bytes], AsyncIterable[bytes]] ResponseContent = Union[str, bytes, Iterable[bytes], AsyncIterable[bytes]] -ResponseExtensions = Mapping[str, Any] +ResponseExtensions = MutableMapping[str, Any] RequestData = Mapping[str, Any] @@ -104,7 +105,7 @@ ] RequestFiles = Union[Mapping[str, FileTypes], Sequence[Tuple[str, FileTypes]]] -RequestExtensions = Mapping[str, Any] +RequestExtensions = MutableMapping[str, Any] class SyncByteStream: diff --git a/pyproject.toml b/pyproject.toml index acd41baf3a..753e671ebc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ ] dependencies = [ "certifi", - "httpcore>=0.17.2,<0.18.0", + "httpcore>=0.18.0,<0.19.0", "idna", "sniffio", ]