Skip to content

Commit

Permalink
Merge pull request #138 from jtpio/importlib
Browse files Browse the repository at this point in the history
Use `importlib_resources` to read `schema.json`
  • Loading branch information
Steven Silvester authored Sep 8, 2021
2 parents a5be6ea + 78be2b7 commit 5af9ea7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jupyter_releaser/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
from subprocess import PIPE

import toml
from importlib_resources import files
from jsonschema import Draft4Validator as Validator
from pkg_resources import parse_version

from jupyter_releaser.tee import run as tee

HERE = osp.dirname(osp.abspath(__file__))
PYPROJECT = Path("pyproject.toml")
SETUP_PY = Path("setup.py")
SETUP_CFG = Path("setup.cfg")
Expand Down Expand Up @@ -287,8 +287,8 @@ def read_config():
if "jupyter-releaser" in data:
config = data["jupyter-releaser"]

with open(osp.join(HERE, "schema.json")) as fid:
schema = json.load(fid)
schema = files("jupyter_releaser").joinpath("schema.json").read_text()
schema = json.loads(schema)

config = config or {}
validator = Validator(schema)
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ install_requires =
click
ghapi
github-activity~=0.1
importlib_resources
jsonschema>=3.0.1
pre-commit
pypiserver
Expand Down

0 comments on commit 5af9ea7

Please sign in to comment.