Skip to content

Commit

Permalink
Use settings file that is within package directory
Browse files Browse the repository at this point in the history
  • Loading branch information
wigging committed Dec 20, 2024
1 parent c368602 commit 972b57b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/flowcept/configs.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Configuration module."""

import getpass
import importlib.resources
import os
import random
import socket
import getpass

from omegaconf import OmegaConf
import random

########################
# Project Settings #
Expand All @@ -17,9 +17,9 @@

if not os.path.exists(SETTINGS_PATH):
SETTINGS_PATH = None
from importlib import resources
settings_res = importlib.resources.files("flowcept") / "settings"

with resources.files("resources").joinpath("sample_settings.yaml").open("r") as f:
with importlib.resources.as_file(settings_res / "sample_settings.yaml") as f:
settings = OmegaConf.load(f)
else:
settings = OmegaConf.load(SETTINGS_PATH)
Expand Down

0 comments on commit 972b57b

Please sign in to comment.