From d67decc6f0a3a9a3b9f116e936b110a43281a3ac Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Tue, 30 Aug 2022 12:57:52 +0300 Subject: [PATCH] Add some deprecated directives (for previous deprecations) to the docs. --- docs/validate.rst | 4 ++++ jsonschema/protocols.py | 10 ++++++++++ jsonschema/validators.py | 2 ++ 3 files changed, 16 insertions(+) diff --git a/docs/validate.rst b/docs/validate.rst index d59d63473..f9498377b 100644 --- a/docs/validate.rst +++ b/docs/validate.rst @@ -209,6 +209,10 @@ By default, no validation is enforced, but optionally, validation can be enabled `jsonschema.exceptions.ValidationError.cause` attribute of the resulting validation error. + .. deprecated:: v4.14.0 + + Use `FormatChecker.checks` on an instance instead. + .. autoexception:: FormatError :noindex: diff --git a/jsonschema/protocols.py b/jsonschema/protocols.py index a8406164e..1f4384d67 100644 --- a/jsonschema/protocols.py +++ b/jsonschema/protocols.py @@ -74,6 +74,11 @@ class Validator(Protocol): against instances. Ensure you've installed `jsonschema` with its `extra (optional) dependencies ` when invoking ``pip``. + + .. deprecated:: v4.12.0 + + Subclassing validator classes now explicitly warns this is not part of + their public API. """ #: An object representing the validator's meta schema (the schema that @@ -171,6 +176,11 @@ def iter_errors(self, instance: Any) -> Iterable[ValidationError]: ... print(error.message) 4 is not one of [1, 2, 3] [2, 3, 4] is too long + + .. deprecated:: v4.0.0 + + Calling this function with a second schema argument is deprecated. + Use `Validator.evolve` instead. """ def validate(self, instance: Any) -> None: diff --git a/jsonschema/validators.py b/jsonschema/validators.py index cb460474c..ea6f52b8e 100644 --- a/jsonschema/validators.py +++ b/jsonschema/validators.py @@ -803,6 +803,8 @@ def base_uri(self): def in_scope(self, scope): """ Temporarily enter the given scope for the duration of the context. + + .. deprecated:: v4.0.0 """ warnings.warn( "jsonschema.RefResolver.in_scope is deprecated and will be "