haraka 0.2.53__tar.gz → 0.2.55__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 (43) hide show
  1. {haraka-0.2.53 → haraka-0.2.55}/PKG-INFO +1 -1
  2. haraka-0.2.55/haraka/PyFast/Runtime.py +49 -0
  3. {haraka-0.2.53 → haraka-0.2.55}/haraka/utils/manifests/PyFast.yml +2 -2
  4. {haraka-0.2.53 → haraka-0.2.55}/haraka.egg-info/PKG-INFO +1 -1
  5. {haraka-0.2.53 → haraka-0.2.55}/pyproject.toml +1 -1
  6. haraka-0.2.53/haraka/PyFast/Runtime.py +0 -47
  7. {haraka-0.2.53 → haraka-0.2.55}/MANIFEST.in +0 -0
  8. {haraka-0.2.53 → haraka-0.2.55}/haraka/PyFast/__init__.py +0 -0
  9. {haraka-0.2.53 → haraka-0.2.55}/haraka/__init__.py +0 -0
  10. {haraka-0.2.53 → haraka-0.2.55}/haraka/art/__init__.py +0 -0
  11. {haraka-0.2.53 → haraka-0.2.55}/haraka/art/ascii/__init__.py +0 -0
  12. {haraka-0.2.53 → haraka-0.2.55}/haraka/art/ascii/assets.py +0 -0
  13. {haraka-0.2.53 → haraka-0.2.55}/haraka/art/ascii/frame/__init__.py +0 -0
  14. {haraka-0.2.53 → haraka-0.2.55}/haraka/art/ascii/frame/border.py +0 -0
  15. {haraka-0.2.53 → haraka-0.2.55}/haraka/art/ascii/frame/framer.py +0 -0
  16. {haraka-0.2.53 → haraka-0.2.55}/haraka/art/ascii/frame/width_utils.py +0 -0
  17. {haraka-0.2.53 → haraka-0.2.55}/haraka/art/create.py +0 -0
  18. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/__init__.py +0 -0
  19. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/config/__init__.py +0 -0
  20. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/config/config.py +0 -0
  21. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/resources/__init__.py +0 -0
  22. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/resources/assets.py +0 -0
  23. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/runner.py +0 -0
  24. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/service/__init__.py +0 -0
  25. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/service/command.py +0 -0
  26. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/service/fileOps/__init__.py +0 -0
  27. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/service/fileOps/files.py +0 -0
  28. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/service/fileOps/purge.py +0 -0
  29. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/service/gitOps/__init__.py +0 -0
  30. {haraka-0.2.53 → haraka-0.2.55}/haraka/post_gen/service/gitOps/gitops.py +0 -0
  31. {haraka-0.2.53 → haraka-0.2.55}/haraka/utils/__init__.py +0 -0
  32. {haraka-0.2.53 → haraka-0.2.55}/haraka/utils/common/__init__.py +0 -0
  33. {haraka-0.2.53 → haraka-0.2.55}/haraka/utils/common/utils.py +0 -0
  34. {haraka-0.2.53 → haraka-0.2.55}/haraka/utils/logging/__init__.py +0 -0
  35. {haraka-0.2.53 → haraka-0.2.55}/haraka/utils/logging/log_util.py +0 -0
  36. {haraka-0.2.53 → haraka-0.2.55}/haraka/utils/manifests/GoUltraFast.yml +0 -0
  37. {haraka-0.2.53 → haraka-0.2.55}/haraka/utils/manifests/JavaFein.yml +0 -0
  38. {haraka-0.2.53 → haraka-0.2.55}/haraka/utils/manifests/go-grpc-gateway-buf.yml +0 -0
  39. {haraka-0.2.53 → haraka-0.2.55}/haraka.egg-info/SOURCES.txt +0 -0
  40. {haraka-0.2.53 → haraka-0.2.55}/haraka.egg-info/dependency_links.txt +0 -0
  41. {haraka-0.2.53 → haraka-0.2.55}/haraka.egg-info/requires.txt +0 -0
  42. {haraka-0.2.53 → haraka-0.2.55}/haraka.egg-info/top_level.txt +0 -0
  43. {haraka-0.2.53 → haraka-0.2.55}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haraka
3
- Version: 0.2.53
3
+ Version: 0.2.55
4
4
  Summary: Reusable post-generation helper for Cookiecutter micro-service templates
5
5
  Author-email: Will Burks <will@example.com>
6
6
  License: MIT
@@ -0,0 +1,49 @@
1
+ from enum import Enum, auto
2
+ from fastapi import FastAPI
3
+ import socket
4
+ from haraka.utils import Logger
5
+
6
+
7
+ class LifecycleState(Enum):
8
+ UNINITIALIZED = auto()
9
+ STARTED = auto()
10
+ DESTROYED = auto()
11
+
12
+
13
+ class Lifecycle:
14
+ """
15
+ A helper class to handle initialization and shutdown messaging for a FastAPI application.
16
+ Tracks internal state to guard against invalid transitions.
17
+ """
18
+ def __init__(self, variant: str = "PyFast"):
19
+ self.variant = variant
20
+ self.logger = Logger(self.variant).start_logger()
21
+ self.state = LifecycleState.UNINITIALIZED
22
+
23
+ async def start(self, settings, app: FastAPI):
24
+ if self.state != LifecycleState.UNINITIALIZED:
25
+ self.logger.warn(f"🟡 Attempted to start, but state is already {self.state.name}")
26
+ return
27
+
28
+ try:
29
+ port = settings.port
30
+ docs_path = app.docs_url or "/docs"
31
+ local_url = f"http://localhost:{port}{docs_path}"
32
+
33
+ host = socket.gethostbyname(socket.gethostname())
34
+ network_url = f"http://{host}:{port}{docs_path}"
35
+
36
+ self.logger.info(f"✅ Swagger UI available at: {local_url}")
37
+ self.logger.info(f"🌐 Network Swagger UI available at: {network_url}")
38
+ self.state = LifecycleState.STARTED
39
+
40
+ except Exception as e:
41
+ self.logger.warn(f"⚠️ Failed to determine network URL: {e}")
42
+
43
+ async def destroy(self):
44
+ if self.state == LifecycleState.DESTROYED:
45
+ self.logger.warn("🟡 destroy() called, but app is already shut down.")
46
+ return
47
+
48
+ self.logger.info("🛑 Application is shutting down!")
49
+ self.state = LifecycleState.DESTROYED
@@ -17,8 +17,8 @@ keep:
17
17
  - README.md
18
18
 
19
19
  # ── IDE / run configs ──────────────────────────────
20
- - runConfigurations/Python/
21
- - runConfigurations/Python/FastAPI.run.xml
20
+ - runConfigurations/FastAPI/
21
+ - runConfigurations/FastAPI/FastAPI.run.xml
22
22
 
23
23
  # ── deployment & infra (shared) ────────────────────
24
24
  - skaffold.yaml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haraka
3
- Version: 0.2.53
3
+ Version: 0.2.55
4
4
  Summary: Reusable post-generation helper for Cookiecutter micro-service templates
5
5
  Author-email: Will Burks <will@example.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "haraka"
7
- version = "0.2.53" # Incremented version
7
+ version = "0.2.55" # Incremented version
8
8
  description = "Reusable post-generation helper for Cookiecutter micro-service templates"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -1,47 +0,0 @@
1
- from fastapi import FastAPI
2
- import socket
3
- from haraka.utils import Logger
4
-
5
- class Lifecycle:
6
- """
7
- A helper class to handle initialization and shutdown messaging for a FastAPI application.
8
- """
9
- def __init__(self, variant: str = "PyFast"):
10
- """
11
- Initializes the PyFast instance with a logger.
12
-
13
- Args:
14
- variant (str): A string identifier for the application. Default is 'PyFast'.
15
- """
16
- self.variant = variant
17
- self.logger = Logger(self.variant).start_logger()
18
-
19
- def start(self, settings, app: FastAPI):
20
- """
21
- Initializes the application and logs Swagger UI availability.
22
-
23
- Args:
24
- settings: A settings object containing application configuration (e.g., port).
25
- app (FastAPI): The FastAPI application instance.
26
- """
27
- try:
28
- port = settings.port
29
- docs_path = app.docs_url or "/docs" # Default to '/docs' if not set
30
- local_url = f"http://localhost:{port}{docs_path}"
31
-
32
- # Resolve the network-accessible hostname
33
- host = socket.gethostbyname(socket.gethostname())
34
- network_url = f"http://{host}:{port}{docs_path}"
35
-
36
- # Log the Swagger UI URLs
37
- self.logger.info(f"Swagger UI available at: {local_url}")
38
- self.logger.info(f"Network Swagger UI available at: {network_url}")
39
-
40
- except Exception as e:
41
- self.logger.warn(f"Failed to determine network URL: {e}")
42
-
43
- def destroy(self):
44
- """
45
- Logs a shutdown message when the application is shutting down.
46
- """
47
- self.logger.info("🛑 Application is shutting down!")
File without changes
File without changes
File without changes
File without changes
File without changes