feat: added service config helper

This commit is contained in:
2023-09-05 16:16:24 +02:00
parent 7e60f3f9b5
commit ef33838ffe
3 changed files with 15 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
from .service_config import load_service_config
+13
View File
@@ -0,0 +1,13 @@
import yaml
CONFIG_PATH = ""
def load_service_config() -> dict:
"""Load the service configuration from the YAML file."""
with open(CONFIG_PATH, "r", encoding="utf-8") as stream:
try:
config = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
return config
+1 -1
View File
@@ -2,6 +2,6 @@ from setuptools import setup
if __name__ == "__main__":
setup(
install_requires=[],
install_requires=["pyyaml"],
extras_require={"dev": ["pytest", "pytest-random-order", "coverage"]},
)