Skip to content

Commit 9259f2f

Browse files
committed
Read the schema on import
1 parent 5af9ea7 commit 9259f2f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

jupyter_releaser/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
RELEASE_API_PATTERN = "https://api.github.com/repos/(?P<owner>[^/]+)/(?P<repo>[^/]+)/releases/tags/(?P<tag>.*)"
4343

4444

45+
schema = files("jupyter_releaser").joinpath("schema.json").read_text()
46+
schema = json.loads(schema)
47+
48+
4549
def run(cmd, **kwargs):
4650
"""Run a command as a subprocess and get the output as a string"""
4751
quiet_error = kwargs.pop("quiet_error", False)
@@ -287,9 +291,6 @@ def read_config():
287291
if "jupyter-releaser" in data:
288292
config = data["jupyter-releaser"]
289293

290-
schema = files("jupyter_releaser").joinpath("schema.json").read_text()
291-
schema = json.loads(schema)
292-
293294
config = config or {}
294295
validator = Validator(schema)
295296
validator.validate(config)

0 commit comments

Comments
 (0)