Skip to content

Commit 13c5fba

Browse files
committed
Fix handling of releaser config in multiple files
1 parent 506beb6 commit 13c5fba

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

jupyter_releaser/util.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,20 @@ def read_config():
275275
if JUPYTER_RELEASER_CONFIG.exists():
276276
config = toml.loads(JUPYTER_RELEASER_CONFIG.read_text(encoding="utf-8"))
277277

278-
elif PYPROJECT.exists():
278+
if not config and PYPROJECT.exists():
279279
data = toml.loads(PYPROJECT.read_text(encoding="utf-8"))
280-
config = data.get("tool", {}).get("jupyter-releaser") or {}
280+
pyproject_config = data.get("tool", {}).get("jupyter-releaser")
281+
if pyproject_config:
282+
config = pyproject_config
281283

282-
elif PACKAGE_JSON.exists():
284+
if not config and PACKAGE_JSON.exists():
283285
data = json.loads(PACKAGE_JSON.read_text(encoding="utf-8"))
284286
if "jupyter-releaser" in data:
285287
config = data["jupyter-releaser"]
286288

287289
with open(osp.join(HERE, "schema.json")) as fid:
288290
schema = json.load(fid)
291+
289292
validator = Validator(schema)
290293
validator.validate(config)
291294
return config

0 commit comments

Comments
 (0)