spakky-fastapi 2.0.0__tar.gz → 2.0.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 (25) hide show
  1. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/PKG-INFO +1 -1
  2. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/pyproject.toml +2 -2
  3. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/post_processors/register_routes.py +9 -13
  4. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/README.md +0 -0
  5. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/__init__.py +0 -0
  6. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/error.py +0 -0
  7. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/main.py +0 -0
  8. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/middlewares/__init__.py +0 -0
  9. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/middlewares/error_handling.py +0 -0
  10. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/middlewares/manage_context.py +0 -0
  11. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/post_processors/__init__.py +0 -0
  12. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/post_processors/add_builtin_middlewares.py +0 -0
  13. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/py.typed +0 -0
  14. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/__init__.py +0 -0
  15. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/delete.py +0 -0
  16. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/get.py +0 -0
  17. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/head.py +0 -0
  18. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/options.py +0 -0
  19. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/patch.py +0 -0
  20. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/post.py +0 -0
  21. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/put.py +0 -0
  22. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/route.py +0 -0
  23. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/routes/websocket.py +0 -0
  24. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/stereotypes/__init__.py +0 -0
  25. {spakky_fastapi-2.0.0 → spakky_fastapi-2.0.2}/spakky_fastapi/stereotypes/api_controller.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spakky-fastapi
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Highly abstracted Framework core to use DDD & DI/IoC & AOP & Etc...
5
5
  Author: Spakky
6
6
  Author-email: sejong418@icloud.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "spakky-fastapi"
3
- version = "2.0.0"
3
+ version = "2.0.2"
4
4
  description = "Highly abstracted Framework core to use DDD & DI/IoC & AOP & Etc..."
5
5
  authors = ["Spakky <sejong418@icloud.com>"]
6
6
  readme = "README.md"
@@ -42,7 +42,7 @@ builtins = ["_"]
42
42
  cache-dir = "~/.cache/ruff"
43
43
 
44
44
  [tool.pytest.ini_options]
45
- pythonpath = "spakky"
45
+ pythonpath = "spakky_fastapi"
46
46
  testpaths = "tests"
47
47
  python_files = ["test_*.py"]
48
48
  asyncio_mode = "auto"
@@ -9,11 +9,9 @@ from fastapi.exceptions import FastAPIError
9
9
  from fastapi.utils import create_model_field # type: ignore
10
10
  from spakky.pod.annotations.order import Order
11
11
  from spakky.pod.annotations.pod import Pod
12
- from spakky.pod.interfaces.application_context import IApplicationContext
13
- from spakky.pod.interfaces.aware.application_context_aware import (
14
- IApplicationContextAware,
15
- )
12
+ from spakky.pod.interfaces.aware.container_aware import IContainerAware
16
13
  from spakky.pod.interfaces.aware.logger_aware import ILoggerAware
14
+ from spakky.pod.interfaces.container import IContainer
17
15
  from spakky.pod.interfaces.post_processor import IPostProcessor
18
16
 
19
17
  from spakky_fastapi.routes.route import Route
@@ -23,23 +21,21 @@ from spakky_fastapi.stereotypes.api_controller import ApiController
23
21
 
24
22
  @Order(0)
25
23
  @Pod()
26
- class RegisterRoutesPostProcessor(
27
- IPostProcessor, ILoggerAware, IApplicationContextAware
28
- ):
24
+ class RegisterRoutesPostProcessor(IPostProcessor, ILoggerAware, IContainerAware):
29
25
  __logger: Logger
30
- __application_context: IApplicationContext
26
+ __container: IContainer
31
27
 
32
28
  def set_logger(self, logger: Logger) -> None:
33
29
  self.__logger = logger
34
30
 
35
- def set_application_context(self, application_context: IApplicationContext) -> None:
36
- self.__application_context = application_context
31
+ def set_container(self, container: IContainer) -> None:
32
+ self.__container = container
37
33
 
38
34
  def post_process(self, pod: object) -> object:
39
35
  if not ApiController.exists(pod):
40
36
  return pod
41
37
 
42
- fast_api = self.__application_context.get(FastAPI)
38
+ fast_api = self.__container.get(FastAPI)
43
39
  controller = ApiController.get(pod)
44
40
  router: APIRouter = APIRouter(prefix=controller.prefix, tags=controller.tags)
45
41
  for name, method in getmembers(pod, callable):
@@ -71,7 +67,7 @@ class RegisterRoutesPostProcessor(
71
67
  *args: Any,
72
68
  method_name: str = name,
73
69
  controller_type: type[object] = controller.type_,
74
- context: IApplicationContext = self.__application_context,
70
+ context: IContainer = self.__container,
75
71
  **kwargs: Any,
76
72
  ) -> Any:
77
73
  controller_instance = context.get(controller_type)
@@ -94,7 +90,7 @@ class RegisterRoutesPostProcessor(
94
90
  *args: Any,
95
91
  method_name: str = name,
96
92
  controller_type: type[object] = controller.type_,
97
- context: IApplicationContext = self.__application_context,
93
+ context: IContainer = self.__container,
98
94
  **kwargs: Any,
99
95
  ) -> Any:
100
96
  controller_instance = context.get(controller_type)
File without changes