Skip to content

Commit 32b9c85

Browse files
authored
Merge pull request #326 from alejoe91/json-schema-location
Add json schema to core and make jsonschema dependency optional
2 parents 5e45e90 + 0d9a3ad commit 32b9c85

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ build-backend = "setuptools.build_meta"
3636
packages = ["probeinterface"]
3737
package-dir = {"probeinterface" = "src/probeinterface"}
3838

39+
[tool.setuptools.package-data]
40+
"probeinterface" = ["schema/probe.json.schema"]
41+
3942

4043
[project.optional-dependencies]
4144

File renamed without changes.

src/probeinterface/testing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
from pathlib import Path
33

44
from probeinterface import __version__ as version
5-
import jsonschema
65

7-
json_schema_file = Path(__file__).absolute().parent.parent.parent / "resources" / "probe.json.schema"
6+
json_schema_file = Path(__file__).absolute().parent / "schema" / "probe.json.schema"
87
schema = json.load(open(json_schema_file, "r"))
98

109

1110
def validate_probe_dict(probe_dict):
11+
import jsonschema
12+
1213
instance = dict(specification="probeinterface", version=version, probes=[probe_dict])
1314
jsonschema.validate(instance=instance, schema=schema)

0 commit comments

Comments
 (0)