devnomads 0.4.0__tar.gz → 0.4.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.
Files changed (39) hide show
  1. {devnomads-0.4.0 → devnomads-0.4.1}/PKG-INFO +1 -1
  2. {devnomads-0.4.0 → devnomads-0.4.1}/pyproject.toml +1 -1
  3. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/api/client.py +15 -1
  4. {devnomads-0.4.0 → devnomads-0.4.1}/.flake8 +0 -0
  5. {devnomads-0.4.0 → devnomads-0.4.1}/.gitignore +0 -0
  6. {devnomads-0.4.0 → devnomads-0.4.1}/.gitlab-ci.yml +0 -0
  7. {devnomads-0.4.0 → devnomads-0.4.1}/Makefile +0 -0
  8. {devnomads-0.4.0 → devnomads-0.4.1}/README.md +0 -0
  9. {devnomads-0.4.0 → devnomads-0.4.1}/openapi.json +0 -0
  10. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/__init__.py +0 -0
  11. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/acme/__init__.py +0 -0
  12. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/acme/challenge_server.py +0 -0
  13. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/acme/client.py +0 -0
  14. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/acme/dns01.py +0 -0
  15. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/acme/errors.py +0 -0
  16. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/acme/http01.py +0 -0
  17. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/acme/keys.py +0 -0
  18. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/acme/verify.py +0 -0
  19. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/api/__init__.py +0 -0
  20. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/api/_services.py +0 -0
  21. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/api/credentials.py +0 -0
  22. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/api/errors.py +0 -0
  23. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/dns/__init__.py +0 -0
  24. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/dns/errors.py +0 -0
  25. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/dns/names.py +0 -0
  26. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/dns/zones.py +0 -0
  27. {devnomads-0.4.0 → devnomads-0.4.1}/src/devnomads/py.typed +0 -0
  28. {devnomads-0.4.0 → devnomads-0.4.1}/tests/conftest.py +0 -0
  29. {devnomads-0.4.0 → devnomads-0.4.1}/tests/test_acme_challenges.py +0 -0
  30. {devnomads-0.4.0 → devnomads-0.4.1}/tests/test_acme_client.py +0 -0
  31. {devnomads-0.4.0 → devnomads-0.4.1}/tests/test_acme_keys.py +0 -0
  32. {devnomads-0.4.0 → devnomads-0.4.1}/tests/test_client.py +0 -0
  33. {devnomads-0.4.0 → devnomads-0.4.1}/tests/test_credentials.py +0 -0
  34. {devnomads-0.4.0 → devnomads-0.4.1}/tests/test_dns.py +0 -0
  35. {devnomads-0.4.0 → devnomads-0.4.1}/tests/test_names.py +0 -0
  36. {devnomads-0.4.0 → devnomads-0.4.1}/tests/test_services.py +0 -0
  37. {devnomads-0.4.0 → devnomads-0.4.1}/tools/bump_version.py +0 -0
  38. {devnomads-0.4.0 → devnomads-0.4.1}/tools/generate.py +0 -0
  39. {devnomads-0.4.0 → devnomads-0.4.1}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devnomads
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Python client library for the DevNomads API (transport, DNS, ACME)
5
5
  Project-URL: Homepage, https://devnomads.nl
6
6
  Author-email: DevNomads <support@devnomads.nl>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "devnomads"
7
- version = "0.4.0"
7
+ version = "0.4.1"
8
8
  description = "Python client library for the DevNomads API (transport, DNS, ACME)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -124,12 +124,26 @@ class Client(ResourcesMixin):
124
124
  status=status,
125
125
  detail=_error_detail(response),
126
126
  )
127
+ if 300 <= status < 400:
128
+ location = response.headers.get("location", "")
129
+ raise ApiError(
130
+ f"API returned an unexpected HTTP {status} redirect"
131
+ + (f" to {location}" if location else "")
132
+ + " - the endpoint or credentials may be misrouted",
133
+ status=status,
134
+ detail=location,
135
+ )
127
136
  if status == 204 or not response.content:
128
137
  return None
129
138
  try:
130
139
  return _unwrap(response.json())
131
140
  except ValueError as exc:
132
- raise ApiError(f"API returned invalid JSON: {exc}", status=status) from exc
141
+ snippet = response.text[:200].strip()
142
+ raise ApiError(
143
+ f"API returned invalid JSON (HTTP {status}): {exc}; "
144
+ f"body starts with: {snippet!r}",
145
+ status=status,
146
+ ) from exc
133
147
 
134
148
  def _send(
135
149
  self,
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