File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
tools/schemacode/src/bidsschematools Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 88from copy import deepcopy
99from functools import lru_cache
1010
11- from jsonschema import ValidationError , validate
12-
1311from . import __bids_version__ , __version__ , data , utils
1412from .types import Namespace
1513
@@ -292,6 +290,14 @@ def filter_schema(schema, **kwargs):
292290
293291def validate_schema (schema : Namespace ):
294292 """Validate a schema against the BIDS metaschema."""
293+ try :
294+ from jsonschema import ValidationError , validate
295+ except ImportError as e :
296+ raise RuntimeError (
297+ "The `jsonschema` package is required to validate schemas. "
298+ "Please install it with `pip install jsonschema`."
299+ ) from e
300+
295301 from .data import load
296302
297303 metaschema = json .loads (load .readable ("metaschema.json" ).read_text ())
You can’t perform that action at this time.
0 commit comments