Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-jsonschema for openSUSE:Factory checked in at 2024-07-16 22:02:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-jsonschema (Old) and /work/SRC/openSUSE:Factory/.python-jsonschema.new.17339 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jsonschema" Tue Jul 16 22:02:21 2024 rev:49 rq:1187609 version:4.23.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-jsonschema/python-jsonschema.changes 2024-05-03 00:09:50.567325206 +0200 +++ /work/SRC/openSUSE:Factory/.python-jsonschema.new.17339/python-jsonschema.changes 2024-07-16 22:02:26.701916165 +0200 @@ -1,0 +2,8 @@ +Thu Jul 11 19:39:45 UTC 2024 - Johannes Kastl <opensuse_buildserv...@ojkastl.de> + +- update to 4.23.0: + * Add some typing to the exceptions.py module by @DanielNoord in + #1019 + * Declare support for 3.13 by @rominf in #1282 + +------------------------------------------------------------------- Old: ---- jsonschema-4.22.0.tar.gz New: ---- jsonschema-4.23.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-jsonschema.spec ++++++ --- /var/tmp/diff_new_pack.cL6vpb/_old 2024-07-16 22:02:28.085966641 +0200 +++ /var/tmp/diff_new_pack.cL6vpb/_new 2024-07-16 22:02:28.085966641 +0200 @@ -33,7 +33,7 @@ %{?sle15_python_module_pythons} Name: python-jsonschema%{psuffix} -Version: 4.22.0 +Version: 4.23.0 Release: 0 Summary: An implementation of JSON-Schema validation for Python License: MIT ++++++ jsonschema-4.22.0.tar.gz -> jsonschema-4.23.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/.github/workflows/ci.yml new/jsonschema-4.23.0/.github/workflows/ci.yml --- old/jsonschema-4.22.0/.github/workflows/ci.yml 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/.github/workflows/ci.yml 2020-02-02 01:00:00.000000000 +0100 @@ -2,12 +2,17 @@ on: push: + branches-ignore: + - "wip*" + tags: + - "v*" pull_request: release: types: [published] schedule: # Daily at 3:21 - cron: "21 3 * * *" + workflow_dispatch: env: PIP_DISABLE_PIP_VERSION_CHECK: "1" @@ -82,6 +87,7 @@ 3.10 3.11 3.12 + 3.13 pypy3.10 allow-prereleases: true - name: Set up nox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/.pre-commit-config.yaml new/jsonschema-4.23.0/.pre-commit-config.yaml --- old/jsonschema-4.22.0/.pre-commit-config.yaml 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/.pre-commit-config.yaml 2020-02-02 01:00:00.000000000 +0100 @@ -16,7 +16,7 @@ args: [--fix, lf] - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.2" + rev: "v0.5.0" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/CHANGELOG.rst new/jsonschema-4.23.0/CHANGELOG.rst --- old/jsonschema-4.22.0/CHANGELOG.rst 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/CHANGELOG.rst 2020-02-02 01:00:00.000000000 +0100 @@ -1,3 +1,9 @@ +v4.23.0 +======= + +* Do not reorder dictionaries (schemas, instances) that are printed as part of validation errors. +* Declare support for Py3.13 + v4.22.0 ======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/PKG-INFO new/jsonschema-4.23.0/PKG-INFO --- old/jsonschema-4.22.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.3 Name: jsonschema -Version: 4.22.0 +Version: 4.23.0 Summary: An implementation of JSON Schema validation for Python Project-URL: Homepage, https://github.com/python-jsonschema/jsonschema Project-URL: Documentation, https://python-jsonschema.readthedocs.io/ @@ -23,6 +23,7 @@ Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: File Formats :: JSON @@ -51,7 +52,7 @@ Requires-Dist: rfc3339-validator; extra == 'format-nongpl' Requires-Dist: rfc3986-validator>0.1.0; extra == 'format-nongpl' Requires-Dist: uri-template; extra == 'format-nongpl' -Requires-Dist: webcolors>=1.11; extra == 'format-nongpl' +Requires-Dist: webcolors>=24.6.0; extra == 'format-nongpl' Description-Content-Type: text/x-rst ========== @@ -168,8 +169,8 @@ Release Information ------------------- -v4.22.0 +v4.23.0 ======= -* Improve ``best_match`` (and thereby error messages from ``jsonschema.validate``) in cases where there are multiple *sibling* errors from applying ``anyOf`` / ``allOf`` -- i.e. when multiple elements of a JSON array have errors, we now do prefer showing errors from earlier elements rather than simply showing an error for the full array (#1250). -* (Micro-)optimize equality checks when comparing for JSON Schema equality by first checking for object identity, as ``==`` would. +* Do not reorder dictionaries (schemas, instances) that are printed as part of validation errors. +* Declare support for Py3.13 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/docs/errors.rst new/jsonschema-4.23.0/docs/errors.rst --- old/jsonschema-4.22.0/docs/errors.rst 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/docs/errors.rst 2020-02-02 01:00:00.000000000 +0100 @@ -216,8 +216,8 @@ 3 is not valid under any of the given schemas Failed validating 'anyOf' in schema['items']: - {'anyOf': [{'maxLength': 2, 'type': 'string'}, - {'minimum': 5, 'type': 'integer'}]} + {'anyOf': [{'type': 'string', 'maxLength': 2}, + {'type': 'integer', 'minimum': 5}]} On instance[1]: 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/docs/requirements.txt new/jsonschema-4.23.0/docs/requirements.txt --- old/jsonschema-4.22.0/docs/requirements.txt 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/docs/requirements.txt 2020-02-02 01:00:00.000000000 +0100 @@ -6,31 +6,29 @@ # alabaster==0.7.16 # via sphinx -anyascii==0.3.2 - # via sphinx-autoapi -astroid==3.1.0 +astroid==3.2.2 # via sphinx-autoapi attrs==23.2.0 # via # jsonschema # referencing -babel==2.14.0 +babel==2.15.0 # via sphinx beautifulsoup4==4.12.3 # via furo -certifi==2024.2.2 +certifi==2024.6.2 # via requests charset-normalizer==3.3.2 # via requests docutils==0.21.2 # via sphinx -furo==2024.4.27 +furo==2024.5.6 # via -r docs/requirements.in idna==3.7 # via requests imagesize==1.4.1 # via sphinx -jinja2==3.1.3 +jinja2==3.1.4 # via # sphinx # sphinx-autoapi @@ -38,31 +36,31 @@ # via -r docs/requirements.in jsonschema-specifications==2023.12.1 # via jsonschema -lxml==5.2.1 +lxml==5.2.2 # via # -r docs/requirements.in # sphinx-json-schema-spec markupsafe==2.1.5 # via jinja2 -packaging==24.0 +packaging==24.1 # via sphinx pyenchant==3.3.0rc1 # via # -r docs/requirements.in # sphinxcontrib-spelling -pygments==2.17.2 +pygments==2.18.0 # via # furo # sphinx pyyaml==6.0.1 # via sphinx-autoapi -referencing==0.35.0 +referencing==0.35.1 # via # jsonschema # jsonschema-specifications -requests==2.31.0 +requests==2.32.3 # via sphinx -rpds-py==0.18.0 +rpds-py==0.18.1 # via # jsonschema # referencing @@ -81,9 +79,9 @@ # sphinx-json-schema-spec # sphinxcontrib-spelling # sphinxext-opengraph -sphinx-autoapi==3.0.0 +sphinx-autoapi==3.1.1 # via -r docs/requirements.in -sphinx-autodoc-typehints==2.1.0 +sphinx-autodoc-typehints==2.1.1 # via -r docs/requirements.in sphinx-basic-ng==1.0.0b2 # via furo @@ -107,5 +105,5 @@ # via -r docs/requirements.in sphinxext-opengraph==0.9.1 # via -r docs/requirements.in -urllib3==2.2.1 +urllib3==2.2.2 # via requests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/jsonschema/_format.py new/jsonschema-4.23.0/jsonschema/_format.py --- old/jsonschema-4.22.0/jsonschema/_format.py 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/jsonschema/_format.py 2020-02-02 01:00:00.000000000 +0100 @@ -413,20 +413,16 @@ with suppress(ImportError): - from webcolors import CSS21_NAMES_TO_HEX import webcolors - def is_css_color_code(instance: object) -> bool: - return webcolors.normalize_hex(instance) - @_checks_drafts(draft3="color", raises=(ValueError, TypeError)) def is_css21_color(instance: object) -> bool: - if ( - not isinstance(instance, str) - or instance.lower() in CSS21_NAMES_TO_HEX - ): - return True - return is_css_color_code(instance) + if isinstance(instance, str): + try: + webcolors.name_to_hex(instance) + except ValueError: + webcolors.normalize_hex(instance.lower()) + return True with suppress(ImportError): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/jsonschema/exceptions.py new/jsonschema-4.23.0/jsonschema/exceptions.py --- old/jsonschema-4.22.0/jsonschema/exceptions.py 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/jsonschema/exceptions.py 2020-02-02 01:00:00.000000000 +0100 @@ -6,7 +6,7 @@ from collections import defaultdict, deque from pprint import pformat from textwrap import dedent, indent -from typing import TYPE_CHECKING, ClassVar +from typing import TYPE_CHECKING, Any, ClassVar import heapq import itertools import warnings @@ -17,7 +17,9 @@ from jsonschema import _utils if TYPE_CHECKING: - from collections.abc import Iterable, Mapping, MutableMapping + from collections.abc import Iterable, Mapping, MutableMapping, Sequence + + from jsonschema import _types WEAK_MATCHES: frozenset[str] = frozenset(["anyOf", "oneOf"]) STRONG_MATCHES: frozenset[str] = frozenset() @@ -25,6 +27,13 @@ _unset = _utils.Unset() +def _pretty(thing: Any, prefix: str): + """ + Format something for an error message as prettily as we currently can. + """ + return indent(pformat(thing, width=72, sort_dicts=False), prefix).lstrip() + + def __getattr__(name): if name == "RefResolutionError": warnings.warn( @@ -44,17 +53,17 @@ def __init__( self, message: str, - validator=_unset, - path=(), - cause=None, + validator: str = _unset, # type: ignore[assignment] + path: Iterable[str | int] = (), + cause: Exception | None = None, context=(), - validator_value=_unset, - instance=_unset, - schema=_unset, - schema_path=(), - parent=None, - type_checker=_unset, - ): + validator_value: Any = _unset, + instance: Any = _unset, + schema: Mapping[str, Any] | bool = _unset, # type: ignore[assignment] + schema_path: Iterable[str | int] = (), + parent: _Error | None = None, + type_checker: _types.TypeChecker = _unset, # type: ignore[assignment] + ) -> None: super().__init__( message, validator, @@ -82,10 +91,10 @@ for error in context: error.parent = self - def __repr__(self): + def __repr__(self) -> str: return f"<{self.__class__.__name__}: {self.message!r}>" - def __str__(self): + def __str__(self) -> str: essential_for_verbose = ( self.validator, self.validator_value, self.instance, self.schema, ) @@ -107,19 +116,19 @@ {self.message} Failed validating {self.validator!r} in {schema_path}: - {indent(pformat(self.schema, width=72), prefix).lstrip()} + {_pretty(self.schema, prefix=prefix)} On {instance_path}: - {indent(pformat(self.instance, width=72), prefix).lstrip()} + {_pretty(self.instance, prefix=prefix)} """.rstrip(), ) @classmethod - def create_from(cls, other): + def create_from(cls, other: _Error): return cls(**other._contents()) @property - def absolute_path(self): + def absolute_path(self) -> Sequence[str | int]: parent = self.parent if parent is None: return self.relative_path @@ -129,7 +138,7 @@ return path @property - def absolute_schema_path(self): + def absolute_schema_path(self) -> Sequence[str | int]: parent = self.parent if parent is None: return self.relative_schema_path @@ -139,7 +148,7 @@ return path @property - def json_path(self): + def json_path(self) -> str: path = "$" for elem in self.absolute_path: if isinstance(elem, int): @@ -148,7 +157,11 @@ path += "." + elem return path - def _set(self, type_checker=None, **kwargs): + def _set( + self, + type_checker: _types.TypeChecker | None = None, + **kwargs: Any, + ) -> None: if type_checker is not None and self._type_checker is _unset: self._type_checker = type_checker @@ -163,9 +176,10 @@ ) return {attr: getattr(self, attr) for attr in attrs} - def _matches_type(self): + def _matches_type(self) -> bool: try: - expected = self.schema["type"] + # We ignore this as we want to simply crash if this happens + expected = self.schema["type"] # type: ignore[index] except (KeyError, TypeError): return False @@ -215,7 +229,7 @@ return NotImplemented # pragma: no cover -- uncovered but deprecated # noqa: E501 return self._cause == other._cause - def __str__(self): + def __str__(self) -> str: return str(self._cause) @@ -248,10 +262,10 @@ A type checker was asked to check a type it did not have registered. """ - def __init__(self, type): + def __init__(self, type: str) -> None: self.type = type - def __str__(self): + def __str__(self) -> str: return f"Type {self.type!r} is unknown to this type checker" @@ -271,10 +285,10 @@ return dedent( f"""\ Unknown type {self.type!r} for validator with schema: - {indent(pformat(self.schema, width=72), prefix).lstrip()} + {_pretty(self.schema, prefix=prefix)} While checking instance: - {indent(pformat(self.instance, width=72), prefix).lstrip()} + {_pretty(self.instance, prefix=prefix)} """.rstrip(), ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/jsonschema/tests/test_exceptions.py new/jsonschema-4.23.0/jsonschema/tests/test_exceptions.py --- old/jsonschema-4.22.0/jsonschema/tests/test_exceptions.py 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/jsonschema/tests/test_exceptions.py 2020-02-02 01:00:00.000000000 +0100 @@ -648,6 +648,29 @@ validator="maxLength", ) + def test_does_not_reorder_dicts(self): + self.assertShows( + """ + Failed validating 'type' in schema: + {'do': 3, 'not': 7, 'sort': 37, 'me': 73} + + On instance: + {'here': 73, 'too': 37, 'no': 7, 'sorting': 3} + """, + schema={ + "do": 3, + "not": 7, + "sort": 37, + "me": 73, + }, + instance={ + "here": 73, + "too": 37, + "no": 7, + "sorting": 3, + }, + ) + def test_str_works_with_instances_having_overriden_eq_operator(self): """ Check for #164 which rendered exceptions unusable when a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/noxfile.py new/jsonschema-4.23.0/noxfile.py --- old/jsonschema-4.22.0/noxfile.py 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/noxfile.py 2020-02-02 01:00:00.000000000 +0100 @@ -35,13 +35,13 @@ "The Unlicense (Unlicense)", ] -SUPPORTED = ["3.8", "3.9", "3.10", "pypy3.10", "3.11", "3.12"] -LATEST = SUPPORTED[-1] +SUPPORTED = ["3.8", "3.9", "3.10", "pypy3.10", "3.11", "3.12", "3.13"] +LATEST_STABLE = "3.12" nox.options.sessions = [] -def session(default=True, python=LATEST, **kwargs): # noqa: D103 +def session(default=True, python=LATEST_STABLE, **kwargs): # noqa: D103 def _session(fn): if default: nox.options.sessions.append(kwargs.get("name", fn.__name__)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-4.22.0/pyproject.toml new/jsonschema-4.23.0/pyproject.toml --- old/jsonschema-4.22.0/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 +++ new/jsonschema-4.23.0/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -31,6 +31,7 @@ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: File Formats :: JSON", @@ -66,7 +67,7 @@ "rfc3339-validator", "rfc3986-validator>0.1.0", "uri_template", - "webcolors>=1.11", + "webcolors>=24.6.0", ] [project.scripts]