Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adopt jsonschema version 4 #83

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions ipywidgets_jsonschema/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import collections
import ipywidgets
import jsonschema
from jsonschema.validators import Draft7Validator
import json
import os
import re
Expand Down Expand Up @@ -99,13 +100,7 @@ def __init__(
the built-in sorted, but is no-op if sorted raises a TypeError.
"""
# Make sure that the given schema is valid
filename = os.path.join(
os.path.split(jsonschema.__file__)[0], "schemas", "draft7.json"
)
with open(filename, "r") as f:
meta_schema = json.load(f)
meta_schema["additionalProperties"] = False
jsonschema.validate(instance=schema, schema=meta_schema)
Draft7Validator.check_schema(schema)

# Store the given data members
self.schema = schema
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ classifiers = [
dependencies = [
"IPython",
"ipywidgets",
"jsonschema<4",
"jsonschema<5",
"packaging",
"traitlets",
]
Expand Down