haraka 0.2.52__tar.gz → 0.2.54__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.
- {haraka-0.2.52 → haraka-0.2.54}/PKG-INFO +11 -1
- haraka-0.2.54/haraka/PyFast/Runtime.py +49 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka.egg-info/PKG-INFO +11 -1
- {haraka-0.2.52 → haraka-0.2.54}/haraka.egg-info/SOURCES.txt +1 -0
- haraka-0.2.54/haraka.egg-info/requires.txt +12 -0
- {haraka-0.2.52 → haraka-0.2.54}/pyproject.toml +16 -1
- haraka-0.2.52/haraka/PyFast/Runtime.py +0 -47
- {haraka-0.2.52 → haraka-0.2.54}/MANIFEST.in +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/PyFast/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/art/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/art/ascii/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/art/ascii/assets.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/art/ascii/frame/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/art/ascii/frame/border.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/art/ascii/frame/framer.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/art/ascii/frame/width_utils.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/art/create.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/config/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/config/config.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/resources/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/resources/assets.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/runner.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/service/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/service/command.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/service/fileOps/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/service/fileOps/files.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/service/fileOps/purge.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/service/gitOps/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/post_gen/service/gitOps/gitops.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/utils/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/utils/common/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/utils/common/utils.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/utils/logging/__init__.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/utils/logging/log_util.py +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/utils/manifests/GoUltraFast.yml +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/utils/manifests/JavaFein.yml +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/utils/manifests/PyFast.yml +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka/utils/manifests/go-grpc-gateway-buf.yml +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka.egg-info/dependency_links.txt +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/haraka.egg-info/top_level.txt +0 -0
- {haraka-0.2.52 → haraka-0.2.54}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: haraka
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.54
|
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
|
@@ -12,3 +12,13 @@ Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Topic :: Software Development :: Build Tools
|
13
13
|
Requires-Python: >=3.9
|
14
14
|
Description-Content-Type: text/markdown
|
15
|
+
Requires-Dist: pathspec==0.10.3
|
16
|
+
Requires-Dist: PyYAML==6.0.1
|
17
|
+
Requires-Dist: wcwidth==0.2.5
|
18
|
+
Requires-Dist: fastapi==0.115.14
|
19
|
+
Provides-Extra: gen
|
20
|
+
Requires-Dist: pathspec==0.10.3; extra == "gen"
|
21
|
+
Requires-Dist: PyYAML==6.0.1; extra == "gen"
|
22
|
+
Requires-Dist: wcwidth==0.2.5; extra == "gen"
|
23
|
+
Provides-Extra: pyfast
|
24
|
+
Requires-Dist: fastapi==0.115.14; extra == "pyfast"
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: haraka
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.54
|
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
|
@@ -12,3 +12,13 @@ Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Topic :: Software Development :: Build Tools
|
13
13
|
Requires-Python: >=3.9
|
14
14
|
Description-Content-Type: text/markdown
|
15
|
+
Requires-Dist: pathspec==0.10.3
|
16
|
+
Requires-Dist: PyYAML==6.0.1
|
17
|
+
Requires-Dist: wcwidth==0.2.5
|
18
|
+
Requires-Dist: fastapi==0.115.14
|
19
|
+
Provides-Extra: gen
|
20
|
+
Requires-Dist: pathspec==0.10.3; extra == "gen"
|
21
|
+
Requires-Dist: PyYAML==6.0.1; extra == "gen"
|
22
|
+
Requires-Dist: wcwidth==0.2.5; extra == "gen"
|
23
|
+
Provides-Extra: pyfast
|
24
|
+
Requires-Dist: fastapi==0.115.14; extra == "pyfast"
|
@@ -4,12 +4,18 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "haraka"
|
7
|
-
version = "0.2.
|
7
|
+
version = "0.2.54" # Incremented version
|
8
8
|
description = "Reusable post-generation helper for Cookiecutter micro-service templates"
|
9
9
|
readme = "README.md"
|
10
10
|
license = {text = "MIT"}
|
11
11
|
authors = [{name = "Will Burks", email = "will@example.com"}]
|
12
12
|
requires-python = ">=3.9"
|
13
|
+
dependencies = [
|
14
|
+
"pathspec==0.10.3",
|
15
|
+
"PyYAML==6.0.1",
|
16
|
+
"wcwidth==0.2.5",
|
17
|
+
"fastapi==0.115.14"
|
18
|
+
]
|
13
19
|
|
14
20
|
classifiers = [
|
15
21
|
"Programming Language :: Python :: 3",
|
@@ -31,3 +37,12 @@ where = ["."]
|
|
31
37
|
[tool.setuptools]
|
32
38
|
include-package-data = true
|
33
39
|
|
40
|
+
[project.optional-dependencies]
|
41
|
+
gen = [
|
42
|
+
"pathspec==0.10.3",
|
43
|
+
"PyYAML==6.0.1",
|
44
|
+
"wcwidth==0.2.5",
|
45
|
+
]
|
46
|
+
PyFast = [
|
47
|
+
"fastapi==0.115.14",
|
48
|
+
]
|
@@ -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
|
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
|
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
|
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
|