Closed jmsmkn closed 1 year ago
DeprecationWarning: pkg_resources
is from package django-simple-history
(v3.3.0). The warning hould be fixed in the next release of django-simple-history.
Relevant commit (2023-07-04): https://github.com/jazzband/django-simple-history/commit/5439c006b228fb86f3e0d5f4c0840f1277c8be3a
Rabbit hole for the validator warning:
/opt/poetry/.venv/lib/python3.10/site-packages/jsonschema/_validators.py:341: DeprecationWarning: Automatically retrieving remote references can be a security vulnerability and is discouraged by the JSON Schema specifications. Relying on this behavior is deprecated and will shortly become an error. If you are sure you want to remotely retrieve your reference and that it is safe to do so, you can find instructions for doing so via referencing. Registry in the referencing documentation
It boils down to adding this to the general schema for "CHART"
type of Component-Interface Values:
https://github.com/comic/grand-challenge.org/blob/7f987304983a7e718981d8d94f014d93b7638952/app/grandchallenge/components/schemas.py#L533-L536
Making the linked schema a static item isn't ideal since it is 31.000+ lines long (!).
As such perhaps the best approach is implementing the registry mentioned in the deprecation warning. However, the default jsonschema.validate
does not seem to allow one to specify which registry to use... so we need to function one level lower and instantiate the ...Validator()
objects ourselves... oh joy! More info here: https://python-jsonschema.readthedocs.io/en/stable/referencing/
Rabbit hole!
Actually, it seems like a passthrough occurs for *args, **kwargs
for validate()
:
https://github.com/python-jsonschema/jsonschema/blob/2f5ff0b14c9ec317a64aef02898f7c44e81ec607/jsonschema/validators.py#L1304C45-L1304C45
I've created two PRs that should address ~99% of all the warnings.
The remaining warning from django simple history/pkg_resources can be ignored in pytest.ini
.
Lots of warnings from a full test run now, these need to be handled.