geventhttpclient 2.3.4__tar.gz → 2.3.6__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 (42) hide show
  1. {geventhttpclient-2.3.4/src/geventhttpclient.egg-info → geventhttpclient-2.3.6}/PKG-INFO +3 -1
  2. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/pyproject.toml +5 -3
  3. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/__init__.py +1 -1
  4. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/header.py +2 -2
  5. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/response.py +1 -1
  6. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6/src/geventhttpclient.egg-info}/PKG-INFO +3 -1
  7. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_client.py +15 -0
  8. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_headers.py +12 -0
  9. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_network_failures.py +6 -6
  10. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/LICENSE-MIT +0 -0
  11. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/MANIFEST.in +0 -0
  12. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/README.md +0 -0
  13. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/ext/Python_compat.h +0 -0
  14. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/ext/_parser.c +0 -0
  15. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/llhttp/LICENSE-MIT +0 -0
  16. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/llhttp/include/llhttp.h +0 -0
  17. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/llhttp/src/api.c +0 -0
  18. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/llhttp/src/http.c +0 -0
  19. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/llhttp/src/llhttp.c +0 -0
  20. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/setup.cfg +0 -0
  21. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/setup.py +0 -0
  22. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/api.py +0 -0
  23. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/client.py +0 -0
  24. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/connectionpool.py +0 -0
  25. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/httplib.py +0 -0
  26. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/httplib2.py +0 -0
  27. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/requests.py +0 -0
  28. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/url.py +0 -0
  29. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient/useragent.py +0 -0
  30. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient.egg-info/SOURCES.txt +0 -0
  31. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient.egg-info/dependency_links.txt +0 -0
  32. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient.egg-info/requires.txt +0 -0
  33. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/src/geventhttpclient.egg-info/top_level.txt +0 -0
  34. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_httplib.py +0 -0
  35. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_httplib2.py +0 -0
  36. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_keep_alive.py +0 -0
  37. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_no_module_ssl.py +0 -0
  38. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_parser.py +0 -0
  39. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_requests.py +0 -0
  40. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_ssl.py +0 -0
  41. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_url.py +0 -0
  42. {geventhttpclient-2.3.4 → geventhttpclient-2.3.6}/tests/test_useragent.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geventhttpclient
3
- Version: 2.3.4
3
+ Version: 2.3.6
4
4
  Summary: HTTP client library for gevent
5
5
  Author-email: Antonin Amand <antonin.amand@gmail.com>
6
6
  License-Expression: MIT
@@ -17,6 +17,8 @@ Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
20
22
  Classifier: Programming Language :: Python :: 3 :: Only
21
23
  Classifier: Topic :: Software Development :: Libraries
22
24
  Requires-Python: >=3.9
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "geventhttpclient"
8
- version = "2.3.4" # don't forget to update version __init__.py as well
8
+ version = "2.3.6" # don't forget to update version __init__.py as well
9
9
  description = "HTTP client library for gevent"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.9"
@@ -22,6 +22,8 @@ classifiers = [
22
22
  "Programming Language :: Python :: 3.10",
23
23
  "Programming Language :: Python :: 3.11",
24
24
  "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Programming Language :: Python :: 3.14",
25
27
  "Programming Language :: Python :: 3 :: Only",
26
28
  "Topic :: Software Development :: Libraries",
27
29
  ]
@@ -76,7 +78,7 @@ markers = [
76
78
  [tool.tox]
77
79
  legacy_tox_ini = """
78
80
  [tox]
79
- envlist = py{39,310,311,312}
81
+ envlist = py{39,310,311,312,313,314}
80
82
 
81
83
  [testenv]
82
84
  deps =
@@ -102,7 +104,7 @@ fix = false
102
104
  line-length = 100
103
105
  target-version = "py311"
104
106
  lint.extend-select = ["UP"]
105
- lint.ignore = ["F821", "UP038", "E402"]
107
+ lint.ignore = ["F821", "E402"]
106
108
 
107
109
  [tool.ruff.lint.isort]
108
110
  known-first-party = ["geventhttpclient", "tests"]
@@ -1,6 +1,6 @@
1
1
  # package
2
2
 
3
- __version__ = "2.3.4" # don't forget to update version in pyproject.toml as well
3
+ __version__ = "2.3.6" # don't forget to update version in pyproject.toml as well
4
4
 
5
5
  from geventhttpclient.api import delete, get, head, options, patch, post, put, request
6
6
  from geventhttpclient.client import HTTPClient
@@ -152,7 +152,7 @@ class Headers(dict):
152
152
  for field in other:
153
153
  self.add(field, other[field])
154
154
  elif hasattr(other, "keys"):
155
- for field in other.fields():
155
+ for field in other.keys():
156
156
  self.add(field, other[field])
157
157
  else:
158
158
  for field, value in other:
@@ -167,7 +167,7 @@ class Headers(dict):
167
167
  while preserving case-sensitive header fields.
168
168
  """
169
169
  if len(args) > 1:
170
- raise TypeError(f"extend() takes at most 1 positional argument ({len(args)} given)")
170
+ raise TypeError(f"update() takes at most 1 positional argument ({len(args)} given)")
171
171
  other = args[0] if len(args) >= 1 else ()
172
172
 
173
173
  if isinstance(other, type(self)):
@@ -246,7 +246,7 @@ class HTTPSocketResponse(HTTPResponse):
246
246
  def __iter__(self):
247
247
  return self
248
248
 
249
- def next(self):
249
+ def __next__(self):
250
250
  bytes = self.read(self.block_size)
251
251
  if not len(bytes):
252
252
  raise StopIteration()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geventhttpclient
3
- Version: 2.3.4
3
+ Version: 2.3.6
4
4
  Summary: HTTP client library for gevent
5
5
  Author-email: Antonin Amand <antonin.amand@gmail.com>
6
6
  License-Expression: MIT
@@ -17,6 +17,8 @@ Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
20
22
  Classifier: Programming Language :: Python :: 3 :: Only
21
23
  Classifier: Topic :: Software Development :: Libraries
22
24
  Requires-Python: >=3.9
@@ -138,6 +138,21 @@ def test_readline():
138
138
  assert [x["index"] for x in lines] == [x for x in range(0, 100)]
139
139
 
140
140
 
141
+ def chunks_iter(sock, addr):
142
+ sock.recv(1024)
143
+ sock.sendall(b"HTTP/1.1 200 Ok\r\nContent-Length: 10\r\nConnection: close\r\n\r\n0123456789")
144
+
145
+
146
+ def test_response_chunks_iter():
147
+ with server(chunks_iter):
148
+ client = HTTPClient(*LISTENER, block_size=4)
149
+ response = client.get("/")
150
+ chunks = [next(response)]
151
+ for chunk in response:
152
+ chunks.append(chunk)
153
+ assert b"".join(chunks) == b"0123456789"
154
+
155
+
141
156
  def readline_multibyte_sep(sock, addr):
142
157
  sock.recv(1024)
143
158
  iterator = StreamTestIterator("\r\n", 100)
@@ -1,6 +1,7 @@
1
1
  import random
2
2
  import string
3
3
  from datetime import datetime
4
+ from email.message import Message
4
5
  from http.cookiejar import CookieJar
5
6
  from urllib.request import Request
6
7
 
@@ -225,3 +226,14 @@ def test_compat_dict():
225
226
  assert d["D"] == "asdf"
226
227
  assert d["E"] == "d, f"
227
228
  assert d["Cookie"] == "d, e, f"
229
+
230
+
231
+ def test_extend_with_keys():
232
+ msg = Message()
233
+ msg["Foo"] = "bar"
234
+ msg["Baz"] = "qux"
235
+
236
+ h = Headers()
237
+ h.extend(msg)
238
+ assert h["Foo"] == "bar"
239
+ assert h["Baz"] == "qux"
@@ -94,7 +94,7 @@ def test_content_too_small():
94
94
  response.read()
95
95
 
96
96
 
97
- def close_during_chuncked_readline(sock, addr):
97
+ def close_during_chunked_readline(sock, addr):
98
98
  sock.recv(4096)
99
99
  sock.sendall(b"HTTP/1.1 200 Ok\r\nTransfer-Encoding: chunked\r\n\r\n")
100
100
 
@@ -110,8 +110,8 @@ def close_during_chuncked_readline(sock, addr):
110
110
  sock.close()
111
111
 
112
112
 
113
- def test_close_during_chuncked_readline():
114
- with server(close_during_chuncked_readline):
113
+ def test_close_during_chunked_readline():
114
+ with server(close_during_chunked_readline):
115
115
  client = HTTPClient(*LISTENER)
116
116
  response = client.get("/")
117
117
  assert response["transfer-encoding"] == "chunked"
@@ -124,7 +124,7 @@ def test_close_during_chuncked_readline():
124
124
  assert len(chunks) == 3
125
125
 
126
126
 
127
- def timeout_during_chuncked_readline(sock, addr):
127
+ def timeout_during_chunked_readline(sock, addr):
128
128
  sock.recv(4096)
129
129
  sock.sendall(b"HTTP/1.1 200 Ok\r\nTransfer-Encoding: chunked\r\n\r\n")
130
130
 
@@ -140,8 +140,8 @@ def timeout_during_chuncked_readline(sock, addr):
140
140
  sock.close()
141
141
 
142
142
 
143
- def test_timeout_during_chuncked_readline():
144
- with server(timeout_during_chuncked_readline):
143
+ def test_timeout_during_chunked_readline():
144
+ with server(timeout_during_chunked_readline):
145
145
  client = HTTPClient(*LISTENER, network_timeout=0.1)
146
146
  response = client.get("/")
147
147
  assert response["transfer-encoding"] == "chunked"