httpx2 2.8.0__tar.gz → 2.9.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. {httpx2-2.8.0 → httpx2-2.9.1}/CHANGELOG.md +33 -0
  2. {httpx2-2.8.0 → httpx2-2.9.1}/PKG-INFO +3 -8
  3. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/__init__.py +2 -0
  4. httpx2-2.9.1/httpx2/_alias.py +71 -0
  5. {httpx2-2.8.0 → httpx2-2.9.1}/.gitignore +0 -0
  6. {httpx2-2.8.0 → httpx2-2.9.1}/LICENSE.md +0 -0
  7. {httpx2-2.8.0 → httpx2-2.9.1}/README.md +0 -0
  8. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/__version__.py +0 -0
  9. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_api.py +0 -0
  10. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_auth.py +0 -0
  11. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_client.py +0 -0
  12. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_config.py +0 -0
  13. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_content.py +0 -0
  14. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_decoders.py +0 -0
  15. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_exceptions.py +0 -0
  16. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_main.py +0 -0
  17. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_models.py +0 -0
  18. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_multipart.py +0 -0
  19. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_sse.py +0 -0
  20. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_status_codes.py +0 -0
  21. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_transports/__init__.py +0 -0
  22. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_transports/asgi.py +0 -0
  23. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_transports/base.py +0 -0
  24. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_transports/default.py +0 -0
  25. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_transports/mock.py +0 -0
  26. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_transports/wsgi.py +0 -0
  27. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_types.py +0 -0
  28. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_urlparse.py +0 -0
  29. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_urls.py +0 -0
  30. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/_utils.py +0 -0
  31. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/py.typed +0 -0
  32. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/websockets/__init__.py +0 -0
  33. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/websockets/_api.py +0 -0
  34. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/websockets/_exceptions.py +0 -0
  35. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/websockets/_ping.py +0 -0
  36. {httpx2-2.8.0 → httpx2-2.9.1}/httpx2/websockets/_transport.py +0 -0
  37. {httpx2-2.8.0 → httpx2-2.9.1}/pyproject.toml +0 -0
@@ -4,6 +4,39 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
 
7
+ ## 2.9.1 (July 24th, 2026)
8
+
9
+ ### Fixed
10
+
11
+ * Alias `httpcore` imports to `httpcore2` in `alias_httpx()`. ([#1082](https://github.com/pydantic/httpx2/pull/1082))
12
+
13
+ ## 2.9.0 (July 23rd, 2026)
14
+
15
+ ### Added
16
+
17
+ * Add `alias_httpx()`, letting applications make `import httpx` resolve to `httpx2` process-wide. ([#1077](https://github.com/pydantic/httpx2/pull/1077))
18
+
19
+ ## 2.8.0 (July 23rd, 2026)
20
+
21
+ No changes since `2.7.0`. Version bumped to stay in lockstep with `httpcore2`.
22
+
23
+ ## 2.7.0 (July 14th, 2026)
24
+
25
+ ### Changed
26
+
27
+ * Update the vendored `httpx-ws` to upstream v0.9.0. ([#1067](https://github.com/pydantic/httpx2/pull/1067))
28
+
29
+ ## 2.6.0 (July 14th, 2026)
30
+
31
+ ### Added
32
+
33
+ * Add native WebSocket support by vendoring `httpx-ws`, installable with `httpx2[ws]`. ([#1042](https://github.com/pydantic/httpx2/pull/1042))
34
+ * Add support for the `QUERY` HTTP method via `httpx2.query()` and `client.query()`. ([#1055](https://github.com/pydantic/httpx2/pull/1055))
35
+
36
+ ### Changed
37
+
38
+ * Allow `click` 8.4+ in the `cli` extra, dropping the upper bound. ([#1040](https://github.com/pydantic/httpx2/pull/1040))
39
+
7
40
  ## 2.5.0 (June 25th, 2026)
8
41
 
9
42
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: httpx2
3
- Version: 2.8.0
3
+ Version: 2.9.1
4
4
  Summary: The next generation HTTP client.
5
5
  Project-URL: Changelog, https://github.com/pydantic/httpx2/blob/main/src/httpx2/CHANGELOG.md
6
6
  Project-URL: Homepage, https://github.com/pydantic/httpx2
@@ -26,7 +26,7 @@ Classifier: Programming Language :: Python :: 3.14
26
26
  Classifier: Topic :: Internet :: WWW/HTTP
27
27
  Requires-Python: >=3.10
28
28
  Requires-Dist: anyio>=4.10
29
- Requires-Dist: httpcore2==2.8.0
29
+ Requires-Dist: httpcore2==2.9.1
30
30
  Requires-Dist: idna>=3.18
31
31
  Requires-Dist: truststore>=0.10
32
32
  Requires-Dist: typing-extensions>=4.5.0; python_version < '3.13'
@@ -188,14 +188,9 @@ inspiration around the lower-level networking details.
188
188
 
189
189
  ## Release Information
190
190
 
191
- ### Added
192
-
193
- * Add native server-sent events support via `client.sse()`. ([#1046](https://github.com/pydantic/httpx2/pull/1046))
194
- * Support `|` and `|=` operators for `Headers`. ([#1047](https://github.com/pydantic/httpx2/pull/1047))
195
-
196
191
  ### Fixed
197
192
 
198
- * Allow IPv6 CIDR notation in `no_proxy`. ([#967](https://github.com/pydantic/httpx2/pull/967))
193
+ * Alias `httpcore` imports to `httpcore2` in `alias_httpx()`. ([#1082](https://github.com/pydantic/httpx2/pull/1082))
199
194
 
200
195
 
201
196
  ---
@@ -1,4 +1,5 @@
1
1
  from .__version__ import __description__, __title__, __version__
2
+ from ._alias import *
2
3
  from ._api import *
3
4
  from ._auth import *
4
5
  from ._client import *
@@ -16,6 +17,7 @@ __all__ = [
16
17
  "__description__",
17
18
  "__title__",
18
19
  "__version__",
20
+ "alias_httpx",
19
21
  "ASGITransport",
20
22
  "AsyncBaseTransport",
21
23
  "AsyncByteStream",
@@ -0,0 +1,71 @@
1
+ from __future__ import annotations
2
+
3
+ import importlib
4
+ import importlib.abc
5
+ import importlib.machinery
6
+ import importlib.util
7
+ import sys
8
+ from collections.abc import Sequence
9
+ from types import ModuleType
10
+
11
+ __all__ = ["alias_httpx"]
12
+
13
+
14
+ class _AliasLoader(importlib.abc.Loader):
15
+ _original_spec: importlib.machinery.ModuleSpec | None
16
+
17
+ def __init__(self, real_name: str) -> None:
18
+ self._real_name = real_name
19
+
20
+ def create_module(self, spec: importlib.machinery.ModuleSpec) -> ModuleType:
21
+ module = importlib.import_module(self._real_name)
22
+ self._original_spec = module.__spec__
23
+ return module
24
+
25
+ def exec_module(self, module: ModuleType) -> None:
26
+ module.__spec__ = self._original_spec
27
+
28
+
29
+ class _AliasFinder(importlib.abc.MetaPathFinder):
30
+ def __init__(self, alias: str, real: str) -> None:
31
+ self._alias = alias
32
+ self._real = real
33
+
34
+ def find_spec(
35
+ self,
36
+ fullname: str,
37
+ path: Sequence[str] | None = None,
38
+ target: ModuleType | None = None,
39
+ ) -> importlib.machinery.ModuleSpec | None:
40
+ if fullname != self._alias and not fullname.startswith(self._alias + "."):
41
+ return None
42
+ real_name = self._real + fullname.removeprefix(self._alias)
43
+ if real_name not in sys.modules and importlib.util.find_spec(real_name) is None:
44
+ return None
45
+ return importlib.machinery.ModuleSpec(fullname, _AliasLoader(real_name))
46
+
47
+
48
+ def _alias(alias: str, module: ModuleType) -> None:
49
+ existing = sys.modules.get(alias)
50
+ if existing is not None and existing is not module:
51
+ raise RuntimeError(f"{alias} was already imported; call `alias_httpx()` before any `import {alias}`.")
52
+
53
+ if not any(isinstance(finder, _AliasFinder) and finder._alias == alias for finder in sys.meta_path):
54
+ sys.meta_path.insert(0, _AliasFinder(alias, module.__name__))
55
+ sys.modules[alias] = module
56
+
57
+
58
+ def alias_httpx() -> None:
59
+ """
60
+ Make `import httpx` resolve to `httpx2`, and `import httpcore` to `httpcore2`, process-wide.
61
+
62
+ Intended for applications migrating from `httpx`, so that dependencies still
63
+ importing `httpx` or `httpcore` share the `httpx2` classes. Libraries should never call this.
64
+
65
+ Must be called before anything imports `httpx` or `httpcore`. Calling it again is a no-op.
66
+ """
67
+ import httpcore2
68
+ import httpx2
69
+
70
+ _alias("httpx", httpx2)
71
+ _alias("httpcore", httpcore2)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes