httpx2 2.1.0__tar.gz → 2.2.0__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 (30) hide show
  1. {httpx2-2.1.0 → httpx2-2.2.0}/CHANGELOG.md +10 -0
  2. {httpx2-2.1.0 → httpx2-2.2.0}/PKG-INFO +6 -8
  3. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/__init__.py +17 -16
  4. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_decoders.py +5 -0
  5. {httpx2-2.1.0 → httpx2-2.2.0}/pyproject.toml +1 -1
  6. {httpx2-2.1.0 → httpx2-2.2.0}/.gitignore +0 -0
  7. {httpx2-2.1.0 → httpx2-2.2.0}/LICENSE.md +0 -0
  8. {httpx2-2.1.0 → httpx2-2.2.0}/README.md +0 -0
  9. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/__version__.py +0 -0
  10. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_api.py +0 -0
  11. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_auth.py +0 -0
  12. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_client.py +0 -0
  13. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_config.py +0 -0
  14. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_content.py +0 -0
  15. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_exceptions.py +0 -0
  16. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_main.py +0 -0
  17. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_models.py +0 -0
  18. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_multipart.py +0 -0
  19. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_status_codes.py +0 -0
  20. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_transports/__init__.py +0 -0
  21. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_transports/asgi.py +0 -0
  22. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_transports/base.py +0 -0
  23. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_transports/default.py +0 -0
  24. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_transports/mock.py +0 -0
  25. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_transports/wsgi.py +0 -0
  26. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_types.py +0 -0
  27. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_urlparse.py +0 -0
  28. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_urls.py +0 -0
  29. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/_utils.py +0 -0
  30. {httpx2-2.1.0 → httpx2-2.2.0}/httpx2/py.typed +0 -0
@@ -4,6 +4,16 @@ 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.2.0 (May 16th, 2026)
8
+
9
+ ### Fixed
10
+
11
+ * Handle multi-frame zstd streams split across chunks. ([#946](https://github.com/pydantic/httpx2/pull/946))
12
+
13
+ ### Changed
14
+
15
+ * Lazily import the `_main` CLI module to speed up `import httpx2`. ([#947](https://github.com/pydantic/httpx2/pull/947))
16
+
7
17
  ## 2.1.0 (May 15th, 2026)
8
18
 
9
19
  ### Removed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: httpx2
3
- Version: 2.1.0
3
+ Version: 2.2.0
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: Topic :: Internet :: WWW/HTTP
26
26
  Requires-Python: >=3.10
27
27
  Requires-Dist: anyio
28
28
  Requires-Dist: certifi
29
- Requires-Dist: httpcore2==2.1.0
29
+ Requires-Dist: httpcore2==2.2.0
30
30
  Requires-Dist: idna
31
31
  Provides-Extra: brotli
32
32
  Requires-Dist: brotli; (platform_python_implementation == 'CPython') and extra == 'brotli'
@@ -186,15 +186,13 @@ inspiration around the lower-level networking details.
186
186
 
187
187
  ## Release Information
188
188
 
189
- ### Removed
189
+ ### Fixed
190
190
 
191
- * Drop support for Python 3.9. ([#208](https://github.com/pydantic/httpx2/pull/208))
191
+ * Handle multi-frame zstd streams split across chunks. ([#946](https://github.com/pydantic/httpx2/pull/946))
192
192
 
193
- ### Added
193
+ ### Changed
194
194
 
195
- * Add support for Python 3.14. ([#208](https://github.com/pydantic/httpx2/pull/208))
196
- * Use stdlib `compression.zstd` for Zstd decompression on Python 3.14+; fall back to the `zstandard` package on older versions. ([#932](https://github.com/pydantic/httpx2/pull/932))
197
- * Bundle `LICENSE.md` in the sdist. ([#938](https://github.com/pydantic/httpx2/pull/938))
195
+ * Lazily import the `_main` CLI module to speed up `import httpx2`. ([#947](https://github.com/pydantic/httpx2/pull/947))
198
196
 
199
197
 
200
198
  ---
@@ -11,21 +11,6 @@ from ._transports import *
11
11
  from ._types import *
12
12
  from ._urls import *
13
13
 
14
- try:
15
- from ._main import main
16
- except ImportError: # pragma: no cover
17
-
18
- def main() -> None: # type: ignore
19
- import sys
20
-
21
- print(
22
- "The httpx command line client could not run because the required "
23
- "dependencies were not installed.\nMake sure you've installed "
24
- "everything with: pip install 'httpx[cli]'"
25
- )
26
- sys.exit(1)
27
-
28
-
29
14
  __all__ = [
30
15
  "__description__",
31
16
  "__title__",
@@ -60,7 +45,6 @@ __all__ = [
60
45
  "InvalidURL",
61
46
  "Limits",
62
47
  "LocalProtocolError",
63
- "main",
64
48
  "MockTransport",
65
49
  "NetRCAuth",
66
50
  "NetworkError",
@@ -104,3 +88,20 @@ __locals = locals()
104
88
  for __name in __all__:
105
89
  if not __name.startswith("__"):
106
90
  setattr(__locals[__name], "__module__", "httpx2") # noqa
91
+
92
+
93
+ def __getattr__(name: str) -> object: # pragma: no cover
94
+ if name == "main":
95
+ import warnings
96
+
97
+ warnings.warn(
98
+ "`httpx2.main` is deprecated and will be removed in a future release. "
99
+ "Use the `httpx2` CLI entry point instead.",
100
+ DeprecationWarning,
101
+ stacklevel=2,
102
+ )
103
+ from ._main import main
104
+
105
+ return main
106
+
107
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -199,9 +199,14 @@ class ZStandardDecoder(ContentDecoder):
199
199
  self.seen_data = False
200
200
 
201
201
  def decode(self, data: bytes) -> bytes:
202
+ if not data:
203
+ return b""
202
204
  self.seen_data = True
203
205
  output = io.BytesIO()
204
206
  try:
207
+ if self.decompressor.eof:
208
+ data = self.decompressor.unused_data + data
209
+ self.decompressor = ZstdDecompressor()
205
210
  output.write(self.decompressor.decompress(data))
206
211
  while self.decompressor.eof and self.decompressor.unused_data:
207
212
  unused_data = self.decompressor.unused_data
@@ -70,7 +70,7 @@ zstd = [
70
70
  ]
71
71
 
72
72
  [project.scripts]
73
- httpx2 = "httpx2:main"
73
+ httpx2 = "httpx2._main:main"
74
74
 
75
75
  [project.urls]
76
76
  Changelog = "https://github.com/pydantic/httpx2/blob/main/src/httpx2/CHANGELOG.md"
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