drukbox-python-sdk 0.0.4__tar.gz → 0.0.5__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.
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/PKG-INFO +2 -2
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/README.md +1 -1
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/pyproject.toml +1 -1
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/src/drukbox_sdk/api.py +7 -0
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/tests/test_api.py +14 -0
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/.github/workflows/on-main-merge.yml +0 -0
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/.github/workflows/on-pull-request.yml +0 -0
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/.github/workflows/release.yml +0 -0
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/.gitignore +0 -0
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/AGENTS.md +0 -0
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/src/drukbox_sdk/__init__.py +0 -0
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/src/drukbox_sdk/exceptions.py +0 -0
- {drukbox_python_sdk-0.0.4 → drukbox_python_sdk-0.0.5}/tests/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: drukbox-python-sdk
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: Async Python client for Drukbox.
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Requires-Dist: httpx>=0.28
|
|
@@ -80,7 +80,7 @@ Supported host operations:
|
|
|
80
80
|
- `aclose`
|
|
81
81
|
|
|
82
82
|
`create_host` supports the service's optional `image`, `env`, `expires_at`,
|
|
83
|
-
and `Idempotency-Key` inputs.
|
|
83
|
+
`provider`, and `Idempotency-Key` inputs.
|
|
84
84
|
|
|
85
85
|
`doctor` fetches `GET /doctor` — read-only dependency health. The service
|
|
86
86
|
runs one cheap, non-mutating probe per dependency (database, active VM
|
|
@@ -72,7 +72,7 @@ Supported host operations:
|
|
|
72
72
|
- `aclose`
|
|
73
73
|
|
|
74
74
|
`create_host` supports the service's optional `image`, `env`, `expires_at`,
|
|
75
|
-
and `Idempotency-Key` inputs.
|
|
75
|
+
`provider`, and `Idempotency-Key` inputs.
|
|
76
76
|
|
|
77
77
|
`doctor` fetches `GET /doctor` — read-only dependency health. The service
|
|
78
78
|
runs one cheap, non-mutating probe per dependency (database, active VM
|
|
@@ -214,6 +214,7 @@ class SandboxAPI:
|
|
|
214
214
|
expires_at: datetime | None = None,
|
|
215
215
|
idempotency_key: str | None = None,
|
|
216
216
|
image: str | None = None,
|
|
217
|
+
provider: str | None = None,
|
|
217
218
|
) -> SandboxHost:
|
|
218
219
|
"""Provision a new host.
|
|
219
220
|
|
|
@@ -228,6 +229,10 @@ class SandboxAPI:
|
|
|
228
229
|
header. Useful for retry safety on flaky networks — a retry with
|
|
229
230
|
the same key after a successful provision returns the original
|
|
230
231
|
host instead of creating a duplicate.
|
|
232
|
+
|
|
233
|
+
``provider`` pins which VM provider serves the request; omit it to
|
|
234
|
+
use the service default. An unknown provider raises
|
|
235
|
+
:class:`SandboxResponseError` (the service rejects it with 400).
|
|
231
236
|
"""
|
|
232
237
|
|
|
233
238
|
payload: dict[str, Any] = {}
|
|
@@ -237,6 +242,8 @@ class SandboxAPI:
|
|
|
237
242
|
payload["expires_at"] = expires_at.isoformat()
|
|
238
243
|
if image is not None:
|
|
239
244
|
payload["image"] = image
|
|
245
|
+
if provider is not None:
|
|
246
|
+
payload["provider"] = provider
|
|
240
247
|
|
|
241
248
|
headers: dict[str, str] = {}
|
|
242
249
|
if idempotency_key is not None:
|
|
@@ -164,9 +164,23 @@ async def test_create_host_omits_image_and_env_when_unset(api: SandboxAPI):
|
|
|
164
164
|
assert "image" not in body
|
|
165
165
|
assert "env" not in body
|
|
166
166
|
assert "expires_at" not in body
|
|
167
|
+
assert "provider" not in body
|
|
167
168
|
assert "Idempotency-Key" not in route.calls.last.request.headers
|
|
168
169
|
|
|
169
170
|
|
|
171
|
+
@respx.mock
|
|
172
|
+
async def test_create_host_sends_provider_when_set(api: SandboxAPI):
|
|
173
|
+
payload = _host_payload(provider="hetzner")
|
|
174
|
+
route = respx.post(f"{BASE_URL}/hosts").mock(
|
|
175
|
+
return_value=httpx.Response(201, json=payload),
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
host = await api.create_host(provider="hetzner")
|
|
179
|
+
|
|
180
|
+
assert '"provider":"hetzner"' in route.calls.last.request.content.decode()
|
|
181
|
+
assert host.provider == "hetzner"
|
|
182
|
+
|
|
183
|
+
|
|
170
184
|
@respx.mock
|
|
171
185
|
async def test_get_host_returns_parsed_host(api: SandboxAPI):
|
|
172
186
|
payload = _host_payload(status="active")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|