Skip to content

Commit 8b1e28b

Browse files
author
Mike Cayanan
committed
Phase 1: Update config loading to check ~/mozart/etc/settings.cfg first for PyPI installs
1 parent 43249c7 commit 8b1e28b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mozart/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ def resource_not_found(e):
8585
app.wsgi_app = ReverseProxied(app.wsgi_app)
8686

8787
# Only load config if it exists (allows imports without runtime environment)
88-
config_path = os.path.join(os.path.dirname(__file__), "..", "settings.cfg")
88+
# Priority: 1) Runtime location (PyPI installs), 2) Package location (editable installs)
89+
config_path = os.path.expanduser("~/mozart/etc/settings.cfg")
90+
if not os.path.exists(config_path):
91+
# Fallback to package-relative location for editable installs
92+
config_path = os.path.join(os.path.dirname(__file__), "..", "settings.cfg")
93+
8994
if os.path.exists(config_path):
9095
app.config.from_pyfile(config_path)
9196

0 commit comments

Comments
 (0)