hexastack-fastapi 0.8.0__tar.gz → 0.9.0__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 (34) hide show
  1. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/PKG-INFO +1 -1
  2. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/pyproject.toml +1 -1
  3. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/pyproject.toml.orig +1 -1
  4. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/openziti.py +7 -9
  5. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/ratelimit.py +15 -9
  6. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/testing/recorder.py +7 -8
  7. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/README.md +0 -0
  8. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/__init__.py +0 -0
  9. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/__init__.py +0 -0
  10. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/db_session.py +0 -0
  11. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/dependencies.py +0 -0
  12. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/docs.py +0 -0
  13. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/health.py +0 -0
  14. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/metrics.py +0 -0
  15. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/routing.py +0 -0
  16. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/sse.py +0 -0
  17. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/adapters/websockets.py +0 -0
  18. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/domain/__init__.py +0 -0
  19. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/domain/config.py +0 -0
  20. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/__init__.py +0 -0
  21. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/app.py +0 -0
  22. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/autodiscovery.py +0 -0
  23. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/bootstrap.py +0 -0
  24. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/config.py +0 -0
  25. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/decorators.py +0 -0
  26. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/exception_handlers.py +0 -0
  27. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/middleware/__init__.py +0 -0
  28. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/middleware/correlation.py +0 -0
  29. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/middleware/logging.py +0 -0
  30. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/infra/middleware/metrics.py +0 -0
  31. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/py.typed +0 -0
  32. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/testing/__init__.py +0 -0
  33. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/testing/cursor.py +0 -0
  34. {hexastack_fastapi-0.8.0 → hexastack_fastapi-0.9.0}/src/hexastack_fastapi/testing/server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hexastack-fastapi
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: FastAPI presentation adapter for Hexastack
5
5
  Author: Richard West
6
6
  Author-email: Richard West <dopplereffect.us@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hexastack-fastapi"
3
- version = "0.8.0"
3
+ version = "0.9.0"
4
4
  description = "FastAPI presentation adapter for Hexastack"
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hexastack-fastapi"
3
- version = "0.8.0"
3
+ version = "0.9.0"
4
4
  description = "FastAPI presentation adapter for Hexastack"
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -16,6 +16,7 @@ from pathlib import Path
16
16
  from typing import Any
17
17
 
18
18
  from hexastack_core.domain.exceptions import MissingDependencyError
19
+ from hexastack_core.utils import require_dependency
19
20
 
20
21
  __all__ = [
21
22
  "openziti_bind",
@@ -90,15 +91,12 @@ class OpenZitiASGIAdapter:
90
91
  Raises:
91
92
  MissingDependencyError: If openziti is not installed.
92
93
  """
93
- try:
94
- import openziti
95
-
96
- return openziti
97
- except ImportError as exc:
98
- raise MissingDependencyError(
99
- "openziti is required for OpenZiti zero-trust networking. "
100
- "Install with 'pip install hexastack-fastapi[ziti]' or 'pip install openziti'."
101
- ) from exc
94
+ return require_dependency(
95
+ "openziti",
96
+ extra="ziti",
97
+ package="hexastack-fastapi",
98
+ feature_name="OpenZiti Zero-Trust Network",
99
+ )
102
100
 
103
101
  def get_bindings(
104
102
  self, host: str | None = None, port: int | None = None
@@ -5,8 +5,8 @@ from typing import Any, cast
5
5
 
6
6
  from fastapi import HTTPException, Request, status
7
7
 
8
- from hexastack_core.domain.exceptions import MissingDependencyError
9
8
  from hexastack_core.ports.ratelimit import RateLimiterPort
9
+ from hexastack_core.utils import require_dependency
10
10
  from hexastack_core.utils.context import get_user_context
11
11
 
12
12
 
@@ -77,14 +77,20 @@ class SlowapiRateLimiterAdapter(RateLimiterPort):
77
77
  Raises:
78
78
  MissingDependencyError: If slowapi or limits is not installed.
79
79
  """
80
- try:
81
- from limits.storage import storage_from_string
82
- from slowapi import Limiter
83
- except ImportError as e:
84
- raise MissingDependencyError(
85
- "slowapi and limits are required for SlowapiRateLimiterAdapter. "
86
- "Install with 'pip install hexastack-fastapi[ratelimit]'."
87
- ) from e
80
+ limits_storage = require_dependency(
81
+ "limits.storage",
82
+ extra="ratelimit",
83
+ package="hexastack-fastapi",
84
+ feature_name="Slowapi Rate Limiter Storage",
85
+ )
86
+ slowapi = require_dependency(
87
+ "slowapi",
88
+ extra="ratelimit",
89
+ package="hexastack-fastapi",
90
+ feature_name="Slowapi Rate Limiter",
91
+ )
92
+ storage_from_string = limits_storage.storage_from_string
93
+ Limiter = slowapi.Limiter
88
94
 
89
95
  self._key_func = key_func or get_user_or_ip_key
90
96
  self._default_limits: list[Any] = list(default_limits or ["100/minute"])
@@ -7,7 +7,7 @@ import time
7
7
  from pathlib import Path
8
8
  from typing import Any
9
9
 
10
- from hexastack_core.domain.exceptions import MissingDependencyError
10
+ from hexastack_core.utils import require_dependency
11
11
  from hexastack_core.utils.fs import atomic_write_text
12
12
  from hexastack_fastapi.testing.cursor import VIRTUAL_CURSOR_SCRIPT
13
13
 
@@ -71,13 +71,12 @@ class DemoNarrator:
71
71
  Raises:
72
72
  MissingDependencyError: If `playwright` is not installed.
73
73
  """
74
- try:
75
- import playwright # noqa: F401
76
- except ImportError as e:
77
- raise MissingDependencyError(
78
- "Playwright is required to record feature demos. "
79
- "Install with 'pip install hexastack-fastapi[testing]' or 'pip install playwright'."
80
- ) from e
74
+ require_dependency(
75
+ "playwright",
76
+ extra="testing",
77
+ package="hexastack-fastapi",
78
+ feature_name="Feature Demo Recording",
79
+ )
81
80
 
82
81
  self.page = page
83
82
  self.output_name = output_name