alt-stack-http-client-httpx 1.6.2__tar.gz → 1.7.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.
- {alt_stack_http_client_httpx-1.6.2/src/alt_stack_http_client_httpx.egg-info → alt_stack_http_client_httpx-1.7.1}/PKG-INFO +10 -4
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/README.md +9 -3
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/pyproject.toml +1 -1
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/src/alt_stack_http_client_httpx/__init__.py +2 -0
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1/src/alt_stack_http_client_httpx.egg-info}/PKG-INFO +10 -4
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/tests/test_client.py +40 -0
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/LICENSE +0 -0
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/setup.cfg +0 -0
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/src/alt_stack_http_client_httpx/py.typed +0 -0
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/src/alt_stack_http_client_httpx.egg-info/SOURCES.txt +0 -0
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/src/alt_stack_http_client_httpx.egg-info/dependency_links.txt +0 -0
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/src/alt_stack_http_client_httpx.egg-info/requires.txt +0 -0
- {alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/src/alt_stack_http_client_httpx.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alt-stack-http-client-httpx
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.1
|
|
4
4
|
Summary: Asyncio HTTP client for alt-stack generated Pydantic SDKs, backed by httpx
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/anthonyaltieri/alt-stack
|
|
@@ -60,12 +60,18 @@ Importing `HttpxApiClient` from the generated module gives one typed method per
|
|
|
60
60
|
|
|
61
61
|
`BaseApiClient` sends through the `Transport` protocol, a single `async def send(request: HttpRequest) -> HttpResponse`. Implement it over any asyncio HTTP library and pass it to the generated `ApiClient(base_url, transport=..., request_map=Request, response_map=Response)`.
|
|
62
62
|
|
|
63
|
+
Scalar query floats with an integral value use integer spelling (`10.0` becomes
|
|
64
|
+
`limit=10`); fractional values keep their decimal spelling (`2.5`). Strings,
|
|
65
|
+
booleans, repeated list values, omitted `None` values, and JSON bodies retain their
|
|
66
|
+
existing encoding.
|
|
67
|
+
|
|
63
68
|
## Development
|
|
64
69
|
|
|
65
70
|
```bash
|
|
66
|
-
uv
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
uv sync --project packages/python-http-client-httpx --extra dev
|
|
72
|
+
packages/python-http-client-httpx/.venv/bin/pytest packages/python-http-client-httpx/tests -q
|
|
73
|
+
packages/python-http-client-httpx/.venv/bin/ruff check packages/python-http-client-httpx
|
|
74
|
+
packages/python-http-client-httpx/.venv/bin/ty check packages/python-http-client-httpx
|
|
69
75
|
```
|
|
70
76
|
|
|
71
77
|
## Documentation
|
|
@@ -36,12 +36,18 @@ Importing `HttpxApiClient` from the generated module gives one typed method per
|
|
|
36
36
|
|
|
37
37
|
`BaseApiClient` sends through the `Transport` protocol, a single `async def send(request: HttpRequest) -> HttpResponse`. Implement it over any asyncio HTTP library and pass it to the generated `ApiClient(base_url, transport=..., request_map=Request, response_map=Response)`.
|
|
38
38
|
|
|
39
|
+
Scalar query floats with an integral value use integer spelling (`10.0` becomes
|
|
40
|
+
`limit=10`); fractional values keep their decimal spelling (`2.5`). Strings,
|
|
41
|
+
booleans, repeated list values, omitted `None` values, and JSON bodies retain their
|
|
42
|
+
existing encoding.
|
|
43
|
+
|
|
39
44
|
## Development
|
|
40
45
|
|
|
41
46
|
```bash
|
|
42
|
-
uv
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
uv sync --project packages/python-http-client-httpx --extra dev
|
|
48
|
+
packages/python-http-client-httpx/.venv/bin/pytest packages/python-http-client-httpx/tests -q
|
|
49
|
+
packages/python-http-client-httpx/.venv/bin/ruff check packages/python-http-client-httpx
|
|
50
|
+
packages/python-http-client-httpx/.venv/bin/ty check packages/python-http-client-httpx
|
|
45
51
|
```
|
|
46
52
|
|
|
47
53
|
## Documentation
|
|
@@ -621,6 +621,8 @@ def _build_query_string(query: Mapping[str, Any]) -> str:
|
|
|
621
621
|
if isinstance(value, (list, tuple)):
|
|
622
622
|
pairs.extend((key, _to_wire_string(item)) for item in value if item is not None)
|
|
623
623
|
else:
|
|
624
|
+
if isinstance(value, float) and value.is_integer():
|
|
625
|
+
value = int(value)
|
|
624
626
|
pairs.append((key, _to_wire_string(value)))
|
|
625
627
|
encoded = urlencode(pairs)
|
|
626
628
|
return f"?{encoded}" if encoded else ""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alt-stack-http-client-httpx
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.1
|
|
4
4
|
Summary: Asyncio HTTP client for alt-stack generated Pydantic SDKs, backed by httpx
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/anthonyaltieri/alt-stack
|
|
@@ -60,12 +60,18 @@ Importing `HttpxApiClient` from the generated module gives one typed method per
|
|
|
60
60
|
|
|
61
61
|
`BaseApiClient` sends through the `Transport` protocol, a single `async def send(request: HttpRequest) -> HttpResponse`. Implement it over any asyncio HTTP library and pass it to the generated `ApiClient(base_url, transport=..., request_map=Request, response_map=Response)`.
|
|
62
62
|
|
|
63
|
+
Scalar query floats with an integral value use integer spelling (`10.0` becomes
|
|
64
|
+
`limit=10`); fractional values keep their decimal spelling (`2.5`). Strings,
|
|
65
|
+
booleans, repeated list values, omitted `None` values, and JSON bodies retain their
|
|
66
|
+
existing encoding.
|
|
67
|
+
|
|
63
68
|
## Development
|
|
64
69
|
|
|
65
70
|
```bash
|
|
66
|
-
uv
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
uv sync --project packages/python-http-client-httpx --extra dev
|
|
72
|
+
packages/python-http-client-httpx/.venv/bin/pytest packages/python-http-client-httpx/tests -q
|
|
73
|
+
packages/python-http-client-httpx/.venv/bin/ruff check packages/python-http-client-httpx
|
|
74
|
+
packages/python-http-client-httpx/.venv/bin/ty check packages/python-http-client-httpx
|
|
69
75
|
```
|
|
70
76
|
|
|
71
77
|
## Documentation
|
{alt_stack_http_client_httpx-1.6.2 → alt_stack_http_client_httpx-1.7.1}/tests/test_client.py
RENAMED
|
@@ -188,6 +188,46 @@ def test_path_params_are_url_encoded() -> None:
|
|
|
188
188
|
assert transport.requests[0].url == "https://api.example.test/files/a%2Fb%20c"
|
|
189
189
|
|
|
190
190
|
|
|
191
|
+
def test_integral_query_floats_preserve_other_values_and_json_bodies() -> None:
|
|
192
|
+
class NumberQuery(BaseModel):
|
|
193
|
+
limit: float
|
|
194
|
+
offset: float
|
|
195
|
+
active: bool
|
|
196
|
+
label: str
|
|
197
|
+
values: list[float | bool | str | None]
|
|
198
|
+
omitted: float | None = None
|
|
199
|
+
|
|
200
|
+
transport = FakeTransport(_ok(204, None))
|
|
201
|
+
client = BaseApiClient(
|
|
202
|
+
"https://api.example.test",
|
|
203
|
+
transport=transport,
|
|
204
|
+
request_map={ITEMS_PATH: {"POST": {"query": NumberQuery}}},
|
|
205
|
+
response_map={},
|
|
206
|
+
)
|
|
207
|
+
run(
|
|
208
|
+
client.request(
|
|
209
|
+
"POST",
|
|
210
|
+
ITEMS_PATH,
|
|
211
|
+
query={
|
|
212
|
+
"limit": 10.0,
|
|
213
|
+
"offset": 2.5,
|
|
214
|
+
"active": True,
|
|
215
|
+
"label": "10.0",
|
|
216
|
+
"values": [10.0, 2.5, True, "10.0", None],
|
|
217
|
+
"omitted": None,
|
|
218
|
+
},
|
|
219
|
+
body={"limit": 10.0},
|
|
220
|
+
)
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
sent = transport.requests[0]
|
|
224
|
+
assert sent.url == (
|
|
225
|
+
"https://api.example.test/items?limit=10&offset=2.5&active=true&label=10.0"
|
|
226
|
+
"&values=10.0&values=2.5&values=true&values=10.0"
|
|
227
|
+
)
|
|
228
|
+
assert sent.body == '{"limit": 10.0}'
|
|
229
|
+
|
|
230
|
+
|
|
191
231
|
def test_post_validates_and_serializes_body_by_alias() -> None:
|
|
192
232
|
transport = FakeTransport(
|
|
193
233
|
_ok(201, {"id": ITEM_ID, "name": "widget"}),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|