maleo-foundation 0.1.25__tar.gz → 0.1.27__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 (94) hide show
  1. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/PKG-INFO +1 -1
  2. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/service.py +31 -3
  3. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation.egg-info/PKG-INFO +1 -1
  4. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/pyproject.toml +1 -1
  5. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/README.md +0 -0
  6. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/__init__.py +0 -0
  7. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/authentication.py +0 -0
  8. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/__init__.py +0 -0
  9. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/general/__init__.py +0 -0
  10. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/general/http.py +0 -0
  11. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/google/__init__.py +0 -0
  12. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/google/base.py +0 -0
  13. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/google/cloud/__init__.py +0 -0
  14. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/google/cloud/base.py +0 -0
  15. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/google/cloud/logging.py +0 -0
  16. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/google/cloud/secret.py +0 -0
  17. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/google/cloud/storage.py +0 -0
  18. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/google/secret.py +0 -0
  19. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/google/storage.py +0 -0
  20. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/utils/__init__.py +0 -0
  21. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/clients/utils/logger.py +0 -0
  22. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/constants.py +0 -0
  23. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/db/__init__.py +0 -0
  24. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/db/engine.py +0 -0
  25. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/db/manager.py +0 -0
  26. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/db/session.py +0 -0
  27. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/db/table.py +0 -0
  28. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/enums.py +0 -0
  29. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/expanded_types/__init__.py +0 -0
  30. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/expanded_types/client.py +0 -0
  31. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/expanded_types/general.py +0 -0
  32. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/expanded_types/query.py +0 -0
  33. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/expanded_types/service.py +0 -0
  34. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/expanded_types/token.py +0 -0
  35. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/extended_types.py +0 -0
  36. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/__init__.py +0 -0
  37. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/client/__init__.py +0 -0
  38. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/client/base.py +0 -0
  39. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/client/google/__init__.py +0 -0
  40. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/client/google/base.py +0 -0
  41. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/client/google/secret.py +0 -0
  42. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/client/google/storage.py +0 -0
  43. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/client/http.py +0 -0
  44. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/client/maleo.py +0 -0
  45. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/db.py +0 -0
  46. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/managers/middleware.py +0 -0
  47. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/middlewares/__init__.py +0 -0
  48. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/middlewares/authentication.py +0 -0
  49. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/middlewares/base.py +0 -0
  50. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/middlewares/cors.py +0 -0
  51. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/__init__.py +0 -0
  52. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/responses.py +0 -0
  53. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/schemas/__init__.py +0 -0
  54. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/schemas/general.py +0 -0
  55. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/schemas/parameter.py +0 -0
  56. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/schemas/result.py +0 -0
  57. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/schemas/token.py +0 -0
  58. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/__init__.py +0 -0
  59. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/general/__init__.py +0 -0
  60. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/general/token.py +0 -0
  61. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
  62. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/parameters/client.py +0 -0
  63. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/parameters/general.py +0 -0
  64. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/parameters/service.py +0 -0
  65. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/parameters/token.py +0 -0
  66. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/__init__.py +0 -0
  67. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
  68. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
  69. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/client/controllers/http.py +0 -0
  70. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/client/service.py +0 -0
  71. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/service/__init__.py +0 -0
  72. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
  73. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/service/controllers/rest.py +0 -0
  74. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/service/general.py +0 -0
  75. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/service/query.py +0 -0
  76. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/models/transfers/results/token.py +0 -0
  77. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/services/__init__.py +0 -0
  78. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/services/token.py +0 -0
  79. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/types.py +0 -0
  80. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/__init__.py +0 -0
  81. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/controller.py +0 -0
  82. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/exceptions.py +0 -0
  83. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/extractor.py +0 -0
  84. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/formatter/__init__.py +0 -0
  85. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/formatter/case.py +0 -0
  86. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/keyloader.py +0 -0
  87. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/logger.py +0 -0
  88. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/logging.py +0 -0
  89. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation/utils/query.py +0 -0
  90. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation.egg-info/SOURCES.txt +0 -0
  91. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation.egg-info/dependency_links.txt +0 -0
  92. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation.egg-info/requires.txt +0 -0
  93. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/maleo_foundation.egg-info/top_level.txt +0 -0
  94. {maleo_foundation-0.1.25 → maleo_foundation-0.1.27}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.1.25
3
+ Version: 0.1.27
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -365,17 +365,26 @@ class ServiceManager:
365
365
  return result.data.token
366
366
 
367
367
  def create_app(self, router:APIRouter, lifespan:Optional[Lifespan[AppType]] = None, request_processor:Optional[RequestProcessor] = None) -> FastAPI:
368
+ self._loggers.application.info("Creating FastAPI application")
368
369
  self._app = FastAPI(title=self._configs.service.name, lifespan=lifespan)
370
+ self._loggers.application.info("FastAPI application created successfully")
369
371
 
372
+ #* Add middleware(s)
373
+ self._loggers.application.info("Configuring middlewares")
370
374
  self._middleware = MiddlewareManager(app=self._app, configurations=self._configs.middleware)
371
375
  self._middleware.add_all(loggers=self.loggers.middleware, key=self._keys.public, request_processor=request_processor)
376
+ self._loggers.application.info("Middlewares addedd successfully")
372
377
 
373
378
  #* Add exception handler(s)
379
+ self._loggers.application.info("Adding exception handlers")
374
380
  self._app.add_exception_handler(RequestValidationError, BaseExceptions.validation_exception_handler)
375
381
  self._app.add_exception_handler(HTTPException, BaseExceptions.http_exception_handler)
382
+ self._loggers.application.info("Exception handlers addedd successfully")
376
383
 
377
384
  #* Include router
385
+ self._loggers.application.info("Including routers")
378
386
  self._app.include_router(router)
387
+ self._loggers.application.info("Routers included successfully")
379
388
 
380
389
  return self._app
381
390
 
@@ -384,9 +393,16 @@ class ServiceManager:
384
393
  return self._app
385
394
 
386
395
  def run_app(self) -> None:
396
+ self._loggers.application.info("Detected environment: '%s'", self._settings.ENVIRONMENT)
387
397
  if self._settings.ENVIRONMENT == BaseEnums.EnvironmentType.LOCAL:
388
398
  import importlib.util
399
+ import logging
389
400
  import sys
401
+
402
+ # Configure logging
403
+ logging.basicConfig(level=logging.DEBUG)
404
+ logger = logging.getLogger(__name__)
405
+
390
406
  # Get the module path and add it to sys.path if needed
391
407
  spec = importlib.util.find_spec("app")
392
408
  if spec and spec.origin:
@@ -394,11 +410,23 @@ class ServiceManager:
394
410
  if module_path not in sys.path:
395
411
  sys.path.insert(0, module_path)
396
412
 
413
+ logger.debug(f"Module path: {module_path}")
397
414
  # Create the import string for uvicorn
398
415
  app_import_string = "app.main:app"
399
-
400
- # Run with reload enabled
401
- uvicorn.run(app_import_string, host=self._configs.service.host, port=self._configs.service.port, reload=True, reload_dirs=[os.path.dirname(os.path.dirname(spec.origin))])
416
+ logger.debug(f"Using import string: {app_import_string}")
417
+
418
+ try:
419
+ uvicorn.run(
420
+ app_import_string,
421
+ host=self._configs.service.host,
422
+ port=self._configs.service.port,
423
+ reload=True,
424
+ log_level="debug",
425
+ reload_dirs=[os.path.dirname(os.path.dirname(spec.origin))]
426
+ )
427
+ except Exception as e:
428
+ logger.error(f"Error starting uvicorn: {e}")
429
+ raise
402
430
  else:
403
431
  uvicorn.run(self._app, host=self._configs.service.host, port=self._configs.service.port)
404
432
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.1.25
3
+ Version: 0.1.27
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maleo_foundation"
7
- version = "0.1.25"
7
+ version = "0.1.27"
8
8
  description = "Foundation package for Maleo"
9
9
  authors = [
10
10
  { name = "Agra Bima Yuda", email = "agra@nexmedis.com" }