Skip to content

Commit aacae6f

Browse files
feat: update pyinstaller build (#64)
1 parent 585997a commit aacae6f

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

src/aali/flowkit/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
except ImportError:
2929
raise ImportError("Please install uvicorn to run the service: pip install aali-flowkit-python[all]")
3030
import argparse
31+
import multiprocessing
3132
from urllib.parse import urlparse
3233

3334

@@ -98,4 +99,5 @@ def main():
9899

99100

100101
if __name__ == "__main__":
102+
multiprocessing.freeze_support()
101103
main()

src/aali/flowkit/config/_config.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(self):
6060
configuration file.
6161
6262
"""
63-
config_path = os.getenv("Aali_CONFIG_PATH", "config.yaml")
63+
config_path = os.getenv("AALI_CONFIG_PATH", os.getenv("Aali_CONFIG_PATH", "config.yaml"))
6464
self._yaml = self._load_config(config_path)
6565

6666
# Define the configuration variables to be parsed from the YAML file
@@ -99,23 +99,26 @@ def _load_config(self, config_path: str) -> dict:
9999
Raises
100100
------
101101
FileNotFoundError
102-
If the configuration file is not found at the given path.
103-
102+
If the configuration file is not found at any given path.
104103
"""
105-
try:
106-
with Path(config_path).open("r") as file:
107-
return yaml.safe_load(file)
108-
except FileNotFoundError:
109-
print(f"Configuration file not found at: {config_path}, using default location.")
104+
search_paths: list[Path] = []
105+
106+
# 1. Use explicitly set path first
107+
if config_path:
108+
search_paths.append(Path(config_path))
109+
110+
# 2. Fallbacks for local dev
111+
search_paths.append(Path("configs/config.yaml"))
112+
search_paths.append(Path("../../configs/config.yaml"))
113+
114+
for path in search_paths:
110115
try:
111-
with Path("configs/config.yaml").open("r") as file:
116+
with path.open("r") as file:
112117
return yaml.safe_load(file)
113118
except FileNotFoundError:
114-
try:
115-
with Path("../../configs/config.yaml").open("r") as file:
116-
return yaml.safe_load(file)
117-
except FileNotFoundError:
118-
raise FileNotFoundError("Configuration file not found at the default location.")
119+
continue
120+
121+
raise FileNotFoundError("Configuration file not found at any default location.")
119122

120123
def _get_config_from_azure_key_vault(self):
121124
"""Extract configuration from Azure Key Vault and set attributes."""

0 commit comments

Comments
 (0)