File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -271,21 +271,26 @@ def retry(cmd, **kwargs):
271
271
272
272
def read_config ():
273
273
"""Read the jupyter-releaser config data"""
274
- config = {}
274
+ config = None
275
+
275
276
if JUPYTER_RELEASER_CONFIG .exists ():
276
277
config = toml .loads (JUPYTER_RELEASER_CONFIG .read_text (encoding = "utf-8" ))
277
278
278
- elif PYPROJECT .exists ():
279
+ if not config and PYPROJECT .exists ():
279
280
data = toml .loads (PYPROJECT .read_text (encoding = "utf-8" ))
280
- config = data .get ("tool" , {}).get ("jupyter-releaser" ) or {}
281
+ pyproject_config = data .get ("tool" , {}).get ("jupyter-releaser" )
282
+ if pyproject_config :
283
+ config = pyproject_config
281
284
282
- elif PACKAGE_JSON .exists ():
285
+ if not config and PACKAGE_JSON .exists ():
283
286
data = json .loads (PACKAGE_JSON .read_text (encoding = "utf-8" ))
284
287
if "jupyter-releaser" in data :
285
288
config = data ["jupyter-releaser" ]
286
289
287
290
with open (osp .join (HERE , "schema.json" )) as fid :
288
291
schema = json .load (fid )
292
+
293
+ config = config or {}
289
294
validator = Validator (schema )
290
295
validator .validate (config )
291
296
return config
You can’t perform that action at this time.
0 commit comments