devhelm 0.6.1__tar.gz → 0.6.2__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 (50) hide show
  1. {devhelm-0.6.1 → devhelm-0.6.2}/PKG-INFO +11 -15
  2. {devhelm-0.6.1 → devhelm-0.6.2}/README.md +10 -14
  3. {devhelm-0.6.1 → devhelm-0.6.2}/pyproject.toml +1 -1
  4. {devhelm-0.6.1 → devhelm-0.6.2}/tests/test_client.py +29 -0
  5. {devhelm-0.6.1 → devhelm-0.6.2}/uv.lock +1 -1
  6. {devhelm-0.6.1 → devhelm-0.6.2}/.github/workflows/ci.yml +0 -0
  7. {devhelm-0.6.1 → devhelm-0.6.2}/.github/workflows/release.yml +0 -0
  8. {devhelm-0.6.1 → devhelm-0.6.2}/.github/workflows/spec-check.yml +0 -0
  9. {devhelm-0.6.1 → devhelm-0.6.2}/.gitignore +0 -0
  10. {devhelm-0.6.1 → devhelm-0.6.2}/LICENSE +0 -0
  11. {devhelm-0.6.1 → devhelm-0.6.2}/Makefile +0 -0
  12. {devhelm-0.6.1 → devhelm-0.6.2}/docs/openapi/monitoring-api.json +0 -0
  13. {devhelm-0.6.1 → devhelm-0.6.2}/scripts/inject_strict_config.py +0 -0
  14. {devhelm-0.6.1 → devhelm-0.6.2}/scripts/regen-from.sh +0 -0
  15. {devhelm-0.6.1 → devhelm-0.6.2}/scripts/release.sh +0 -0
  16. {devhelm-0.6.1 → devhelm-0.6.2}/scripts/typegen.sh +0 -0
  17. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/__init__.py +0 -0
  18. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/_errors.py +0 -0
  19. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/_generated.py +0 -0
  20. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/_http.py +0 -0
  21. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/_pagination.py +0 -0
  22. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/_validation.py +0 -0
  23. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/client.py +0 -0
  24. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/py.typed +0 -0
  25. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/__init__.py +0 -0
  26. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/alert_channels.py +0 -0
  27. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/api_keys.py +0 -0
  28. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/dependencies.py +0 -0
  29. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/deploy_lock.py +0 -0
  30. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/environments.py +0 -0
  31. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/forensics.py +0 -0
  32. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/incidents.py +0 -0
  33. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/monitors.py +0 -0
  34. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/notification_policies.py +0 -0
  35. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/resource_groups.py +0 -0
  36. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/secrets.py +0 -0
  37. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/status.py +0 -0
  38. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/status_pages.py +0 -0
  39. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/tags.py +0 -0
  40. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/resources/webhooks.py +0 -0
  41. {devhelm-0.6.1 → devhelm-0.6.2}/src/devhelm/types.py +0 -0
  42. {devhelm-0.6.1 → devhelm-0.6.2}/tests/__init__.py +0 -0
  43. {devhelm-0.6.1 → devhelm-0.6.2}/tests/run_sdk.py +0 -0
  44. {devhelm-0.6.1 → devhelm-0.6.2}/tests/test_errors.py +0 -0
  45. {devhelm-0.6.1 → devhelm-0.6.2}/tests/test_http.py +0 -0
  46. {devhelm-0.6.1 → devhelm-0.6.2}/tests/test_negative_validation.py +0 -0
  47. {devhelm-0.6.1 → devhelm-0.6.2}/tests/test_schemas.py +0 -0
  48. {devhelm-0.6.1 → devhelm-0.6.2}/tests/test_spec_parity.py +0 -0
  49. {devhelm-0.6.1 → devhelm-0.6.2}/tests/test_typing.py +0 -0
  50. {devhelm-0.6.1 → devhelm-0.6.2}/tests/test_validation_helpers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devhelm
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: DevHelm SDK for Python — typed client for monitors, incidents, alerting, and more
5
5
  Project-URL: Homepage, https://github.com/devhelmhq/sdk-python
6
6
  Project-URL: Repository, https://github.com/devhelmhq/sdk-python.git
@@ -37,11 +37,7 @@ pip install devhelm
37
37
  ```python
38
38
  from devhelm import Devhelm
39
39
 
40
- client = Devhelm(
41
- token="your-api-token",
42
- org_id="your-org-id",
43
- workspace_id="your-workspace-id",
44
- )
40
+ client = Devhelm(token="your-api-token")
45
41
 
46
42
  # List all monitors
47
43
  monitors = client.monitors.list()
@@ -79,20 +75,20 @@ client.monitors.delete(monitor.id)
79
75
  from devhelm import Devhelm
80
76
 
81
77
  client = Devhelm(
82
- token="your-api-token", # required (or DEVHELM_API_TOKEN env var)
83
- org_id="1", # required (or DEVHELM_ORG_ID env var)
84
- workspace_id="1", # required (or DEVHELM_WORKSPACE_ID env var)
78
+ token="your-api-token", # required (or DEVHELM_API_TOKEN env var)
79
+ org_id="1", # optional see notes below
80
+ workspace_id="1", # optional see notes below
85
81
  base_url="https://api.devhelm.io", # optional, defaults to production
86
82
  )
87
83
  ```
88
84
 
89
85
  Environment variables are used as fallbacks when constructor arguments are not provided:
90
86
 
91
- | Parameter | Env Variable |
92
- | -------------- | ----------------------- |
93
- | `token` | `DEVHELM_API_TOKEN` |
94
- | `org_id` | `DEVHELM_ORG_ID` |
95
- | `workspace_id` | `DEVHELM_WORKSPACE_ID` |
87
+ | Parameter | Required | Env Variable | Notes |
88
+ | -------------- | -------- | ---------------------- | -------------------------------------------------------------------------------------------------------- |
89
+ | `token` | Yes | `DEVHELM_API_TOKEN` | Personal or workspace API token. |
90
+ | `org_id` | No | `DEVHELM_ORG_ID` | Auto-resolved if your token is scoped to one org. Required only when the token has access to multiple. |
91
+ | `workspace_id` | No | `DEVHELM_WORKSPACE_ID` | Auto-resolved if your token is scoped to one workspace. Required only when the token spans multiple. |
96
92
 
97
93
  ## Resources
98
94
 
@@ -159,7 +155,7 @@ Every `DevhelmApiError` carries:
159
155
  ```python
160
156
  from devhelm import Devhelm, DevhelmAuthError, DevhelmError
161
157
 
162
- client = Devhelm(token="bad-token", org_id="1", workspace_id="1")
158
+ client = Devhelm(token="bad-token")
163
159
 
164
160
  try:
165
161
  client.monitors.list()
@@ -13,11 +13,7 @@ pip install devhelm
13
13
  ```python
14
14
  from devhelm import Devhelm
15
15
 
16
- client = Devhelm(
17
- token="your-api-token",
18
- org_id="your-org-id",
19
- workspace_id="your-workspace-id",
20
- )
16
+ client = Devhelm(token="your-api-token")
21
17
 
22
18
  # List all monitors
23
19
  monitors = client.monitors.list()
@@ -55,20 +51,20 @@ client.monitors.delete(monitor.id)
55
51
  from devhelm import Devhelm
56
52
 
57
53
  client = Devhelm(
58
- token="your-api-token", # required (or DEVHELM_API_TOKEN env var)
59
- org_id="1", # required (or DEVHELM_ORG_ID env var)
60
- workspace_id="1", # required (or DEVHELM_WORKSPACE_ID env var)
54
+ token="your-api-token", # required (or DEVHELM_API_TOKEN env var)
55
+ org_id="1", # optional see notes below
56
+ workspace_id="1", # optional see notes below
61
57
  base_url="https://api.devhelm.io", # optional, defaults to production
62
58
  )
63
59
  ```
64
60
 
65
61
  Environment variables are used as fallbacks when constructor arguments are not provided:
66
62
 
67
- | Parameter | Env Variable |
68
- | -------------- | ----------------------- |
69
- | `token` | `DEVHELM_API_TOKEN` |
70
- | `org_id` | `DEVHELM_ORG_ID` |
71
- | `workspace_id` | `DEVHELM_WORKSPACE_ID` |
63
+ | Parameter | Required | Env Variable | Notes |
64
+ | -------------- | -------- | ---------------------- | -------------------------------------------------------------------------------------------------------- |
65
+ | `token` | Yes | `DEVHELM_API_TOKEN` | Personal or workspace API token. |
66
+ | `org_id` | No | `DEVHELM_ORG_ID` | Auto-resolved if your token is scoped to one org. Required only when the token has access to multiple. |
67
+ | `workspace_id` | No | `DEVHELM_WORKSPACE_ID` | Auto-resolved if your token is scoped to one workspace. Required only when the token spans multiple. |
72
68
 
73
69
  ## Resources
74
70
 
@@ -135,7 +131,7 @@ Every `DevhelmApiError` carries:
135
131
  ```python
136
132
  from devhelm import Devhelm, DevhelmAuthError, DevhelmError
137
133
 
138
- client = Devhelm(token="bad-token", org_id="1", workspace_id="1")
134
+ client = Devhelm(token="bad-token")
139
135
 
140
136
  try:
141
137
  client.monitors.list()
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "devhelm"
3
- version = "0.6.1"
3
+ version = "0.6.2"
4
4
  description = "DevHelm SDK for Python — typed client for monitors, incidents, alerting, and more"
5
5
  authors = [{ name = "DevHelm", email = "hello@devhelm.io" }]
6
6
  license = "MIT"
@@ -5,6 +5,7 @@ from __future__ import annotations
5
5
  import pytest
6
6
 
7
7
  from devhelm import Devhelm
8
+ from devhelm._http import DevhelmConfig
8
9
  from devhelm.resources.alert_channels import AlertChannels
9
10
  from devhelm.resources.api_keys import ApiKeys
10
11
  from devhelm.resources.dependencies import Dependencies
@@ -131,3 +132,31 @@ class TestStatusPagesResource:
131
132
  assert callable(d.add)
132
133
  assert callable(d.verify)
133
134
  assert callable(d.remove)
135
+
136
+
137
+ class TestClientOptionalTenantArgs:
138
+ """`org_id` / `workspace_id` are optional — single-tenant tokens
139
+ auto-resolve them server-side, so the README quickstart and the
140
+ constructor must work with just a token (the most common case).
141
+ """
142
+
143
+ def test_constructible_without_org_or_workspace(
144
+ self, monkeypatch: pytest.MonkeyPatch
145
+ ) -> None:
146
+ # Strip any env fallback so we prove the constructor itself accepts
147
+ # missing tenant args, not that the test environment leaks them in.
148
+ monkeypatch.delenv("DEVHELM_ORG_ID", raising=False)
149
+ monkeypatch.delenv("DEVHELM_WORKSPACE_ID", raising=False)
150
+
151
+ client = Devhelm(token="test-token", base_url="http://localhost:8080")
152
+
153
+ assert client.monitors is not None
154
+ assert client.incidents is not None
155
+
156
+ def test_config_defaults_tenant_ids_to_none(self) -> None:
157
+ # Documents the API contract: leaving them unset on the config
158
+ # dataclass yields ``None``, which ``build_client`` then resolves
159
+ # via env var or the server-side default.
160
+ config = DevhelmConfig(token="test-token")
161
+ assert config.org_id is None
162
+ assert config.workspace_id is None
@@ -315,7 +315,7 @@ wheels = [
315
315
 
316
316
  [[package]]
317
317
  name = "devhelm"
318
- version = "0.6.1"
318
+ version = "0.6.2"
319
319
  source = { editable = "." }
320
320
  dependencies = [
321
321
  { name = "httpx" },
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