Skip to content

Commit 1638a07

Browse files
authored
Add log when loading configuration (#475)
1 parent fdd0712 commit 1638a07

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

jupyter_releaser/util.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,17 +449,26 @@ def read_config():
449449

450450
if JUPYTER_RELEASER_CONFIG.exists():
451451
config = toml.loads(JUPYTER_RELEASER_CONFIG.read_text(encoding="utf-8"))
452+
log(f"jupyter-releaser configuration loaded from {JUPYTER_RELEASER_CONFIG}.")
452453

453-
if not config and PYPROJECT.exists():
454+
if PYPROJECT.exists():
454455
data = toml.loads(PYPROJECT.read_text(encoding="utf-8"))
455456
pyproject_config = data.get("tool", {}).get("jupyter-releaser")
456457
if pyproject_config:
457-
config = pyproject_config
458+
if not config:
459+
config = pyproject_config
460+
log(f"jupyter-releaser configuration loaded from {PYPROJECT}.")
461+
else:
462+
log(f"Ignoring jupyter-releaser configuration from {PYPROJECT}.")
458463

459-
if not config and PACKAGE_JSON.exists():
464+
if PACKAGE_JSON.exists():
460465
data = json.loads(PACKAGE_JSON.read_text(encoding="utf-8"))
461466
if "jupyter-releaser" in data:
462-
config = data["jupyter-releaser"]
467+
if not config:
468+
config = data["jupyter-releaser"]
469+
log(f"jupyter-releaser configuration loaded from {PACKAGE_JSON}.")
470+
else:
471+
log(f"Ignoring jupyter-releaser configuration from {PACKAGE_JSON}.")
463472

464473
config = config or {}
465474
validator = Validator(SCHEMA)

0 commit comments

Comments
 (0)