Use latest jsonschema version v4.18 or higher
shahzebsiddiqui opened this issue · 2 comments
shahzebsiddiqui commented
According to https://github.com/python-jsonschema/jsonschema/releases/tag/v4.18.0 the RefResolver has been deprecated in favor of referencing library which requires a bit of work to change the codebase. This will impact the way we call custom_validator
method
buildtest/buildtest/schemas/defaults.py
Lines 84 to 112 in ba44c82
What we need to do
- Update the requirements.txt and pyproject.toml from
jsonschema < 4.18
tojsonschema >= 4.18
- Update the file https://github.com/buildtesters/buildtest/blob/devel/buildtest/schemas/defaults.py. The variable
schema_table
may not be needed we need to update all references.
To summarize the following line needs to be changed since resolver
needs to be handled via Registry().with_resource()
resolver = RefResolver.from_schema(
schema_table["definitions.schema.json"]["recipe"], store=schema_store
)
For more details also check out https://python-jsonschema.readthedocs.io/en/stable/referencing/
shahzebsiddiqui commented
shahzebsiddiqui commented
this was addressed in #1802