Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-poetry for openSUSE:Factory checked in at 2023-10-01 21:22:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-poetry (Old) and /work/SRC/openSUSE:Factory/.python-poetry.new.28202 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-poetry" Sun Oct 1 21:22:13 2023 rev:28 rq:1114133 version:1.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-poetry/python-poetry.changes 2023-09-25 20:03:42.923268467 +0200 +++ /work/SRC/openSUSE:Factory/.python-poetry.new.28202/python-poetry.changes 2023-10-01 21:22:48.065719684 +0200 @@ -1,0 +2,12 @@ +Thu Sep 28 18:49:43 UTC 2023 - Ben Greiner <c...@bnavigator.de> + +- Drop unlimit-jsonschema.patch in favor of + poetry-pr8447-fastjsonschema.patch + * gh#python-poetry/poetry#8447 + +------------------------------------------------------------------- +Thu Sep 28 07:22:24 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- add unlimit-jsonschema.patch to avoid installation issue + +------------------------------------------------------------------- New: ---- poetry-pr8447-fastjsonschema.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-poetry.spec ++++++ --- /var/tmp/diff_new_pack.noid7l/_old 2023-10-01 21:22:49.181760067 +0200 +++ /var/tmp/diff_new_pack.noid7l/_new 2023-10-01 21:22:49.181760067 +0200 @@ -33,24 +33,28 @@ License: MIT Group: Development/Languages/Python URL: https://python-poetry.org/ -# PyPI sdist doesnt contain tests +# PyPI sdist doesn't contain tests Source: https://github.com/python-poetry/poetry/archive/%{version}.tar.gz#/poetry-%{version}.tar.gz +# PATCH-FIX-UPSTREAM build-1.patch gh#python-poetry/poetry#8400 Patch0: build-1.patch +# PATCH-FIX-UPSTREAM poetry-pr8447-fastjsonschema.patch gh#python-poetry/poetry#8447 +Patch1: poetry-pr8447-fastjsonschema.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module pip} BuildRequires: %{python_module poetry-core = 1.7.0} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-build >= 1.0.3 +Requires: python-poetry-core = 1.7.0 +Requires: python-poetry-plugin-export >= 1.5.0 # SECTION cachecontrol[filecache] Requires: python-CacheControl >= 0.13 Requires: python-filelock >= 3.8.0 # /SECTION -Requires: python-build >= 1.0.3 Requires: python-cleo >= 2.0.0 Requires: python-crashtest >= 0.4.1 Requires: python-dulwich >= 0.21.2 -Requires: python-poetry-core = 1.7.0 -Requires: python-poetry-plugin-export >= 1.5.0 +Requires: python-fastjsonschema >= 2.18.0 %if 0%{?python_version_nodots} < 310 Requires: python-importlib-metadata >= 4.4 %endif @@ -63,7 +67,6 @@ Requires: python-pyproject-hooks >= 1.0.0 Requires: python-requests >= 2.26 Requires: python-shellingham >= 1.5 -Requires: (python-jsonschema >= 4.10.0 with python-jsonschema < 4.18) Requires: (python-requests-toolbelt >= 0.9.1 with python-requests-toolbelt < 2) %if 0%{?python_version_nodots} < 311 Requires: python-tomli >= 2.0.1 ++++++ build-1.patch ++++++ --- /var/tmp/diff_new_pack.noid7l/_old 2023-10-01 21:22:49.209761080 +0200 +++ /var/tmp/diff_new_pack.noid7l/_new 2023-10-01 21:22:49.213761224 +0200 @@ -10,11 +10,11 @@ src/poetry/installation/chef.py | 19 +++++++++++++------ 4 files changed, 36 insertions(+), 19 deletions(-) -diff --git a/poetry.lock b/poetry.lock -index 19b9c5d8120..fbb506a7cc0 100644 ---- a/poetry.lock -+++ b/poetry.lock -@@ -20,25 +20,26 @@ tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pyte +Index: poetry-1.6.1/poetry.lock +=================================================================== +--- poetry-1.6.1.orig/poetry.lock ++++ poetry-1.6.1/poetry.lock +@@ -20,25 +20,26 @@ tests-no-zope = ["cloudpickle", "hypothe [[package]] name = "build" @@ -87,16 +87,16 @@ {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, -@@ -1668,4 +1679,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p +@@ -1668,4 +1679,4 @@ testing = ["big-O", "jaraco.functools", [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "368d5dce2e2375400d677b575523352c47f89070355aaf6ade29360ca7bdb5e2" +content-hash = "12ff5da9d9bc41c06665f74354ba6f2a4383ea54665e9aa873d983a8b105c4cf" -diff --git a/pyproject.toml b/pyproject.toml -index 8f5db44f8a7..73e31be5de7 100644 ---- a/pyproject.toml -+++ b/pyproject.toml +Index: poetry-1.6.1/pyproject.toml +=================================================================== +--- poetry-1.6.1.orig/pyproject.toml ++++ poetry-1.6.1/pyproject.toml @@ -34,7 +34,7 @@ python = "^3.8" poetry-core = "1.7.0" @@ -106,11 +106,11 @@ cachecontrol = { version = "^0.13.0", extras = ["filecache"] } cleo = "^2.0.0" crashtest = "^0.4.1" -diff --git a/src/poetry/inspection/info.py b/src/poetry/inspection/info.py -index d1461d4ed76..e45046dceea 100644 ---- a/src/poetry/inspection/info.py -+++ b/src/poetry/inspection/info.py -@@ -46,11 +46,10 @@ +Index: poetry-1.6.1/src/poetry/inspection/info.py +=================================================================== +--- poetry-1.6.1.orig/src/poetry/inspection/info.py ++++ poetry-1.6.1/src/poetry/inspection/info.py +@@ -46,11 +46,10 @@ import pyproject_hooks source = '{source}' dest = '{dest}' @@ -125,7 +125,7 @@ runner=pyproject_hooks.quiet_subprocess_runner, ) env.install(builder.build_system_requires) -@@ -58,7 +57,7 @@ +@@ -58,7 +57,7 @@ with build.env.IsolatedEnvBuilder() as e builder.metadata_path(dest) """ @@ -134,10 +134,10 @@ class PackageInfoError(ValueError): -diff --git a/src/poetry/installation/chef.py b/src/poetry/installation/chef.py -index da8679df21f..bcbb77d5ba1 100644 ---- a/src/poetry/installation/chef.py -+++ b/src/poetry/installation/chef.py +Index: poetry-1.6.1/src/poetry/installation/chef.py +=================================================================== +--- poetry-1.6.1.orig/src/poetry/installation/chef.py ++++ poetry-1.6.1/src/poetry/installation/chef.py @@ -1,5 +1,6 @@ from __future__ import annotations @@ -145,7 +145,7 @@ import tarfile import tempfile import zipfile -@@ -43,12 +44,19 @@ def __init__(self, env: Env, pool: RepositoryPool) -> None: +@@ -43,12 +44,19 @@ class IsolatedEnv(BaseIsolatedEnv): self._pool = pool @property @@ -169,7 +169,7 @@ def install(self, requirements: Collection[str]) -> None: from cleo.io.null_io import NullIO -@@ -109,8 +117,7 @@ def _prepare( +@@ -109,8 +117,7 @@ class Chef: env = IsolatedEnv(venv, self._pool) builder = ProjectBuilder( directory, ++++++ poetry-pr8447-fastjsonschema.patch ++++++ >From 266fa9acc227e303b8f200fd7d81c9bb47758d28 Mon Sep 17 00:00:00 2001 From: David Hotham <david.hot...@blueyonder.co.uk> Date: Sun, 17 Sep 2023 13:59:29 +0100 Subject: [PATCH 1/2] fastjsonschema forwards compatibility --- tests/console/commands/test_check.py | 12 +++++++++--- tests/test_factory.py | 14 +++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) Index: poetry-1.6.1/tests/console/commands/test_check.py =================================================================== --- poetry-1.6.1.orig/tests/console/commands/test_check.py +++ poetry-1.6.1/tests/console/commands/test_check.py @@ -77,8 +77,10 @@ def test_check_invalid( tester.execute("--lock") - expected = """\ -Error: 'description' is a required property + jsonschema_error = "'description' is a required property" + fastjsonschema_error = "data must contain ['description'] properties" + expected_template = """\ +Error: {schema_error} Error: Project name (invalid) is same as one of its dependencies Error: Unrecognized classifiers: ['Intended Audience :: Clowns']. Error: Declared README file does not exist: never/exists.md @@ -93,8 +95,12 @@ Warning: Deprecated classifier\ 'Topic :: Communications :: Chat :: AOL Instant Messenger'.\ Must be removed. """ + expected = { + expected_template.format(schema_error=schema_error) + for schema_error in (jsonschema_error, fastjsonschema_error) + } - assert tester.io.fetch_error() == expected + assert tester.io.fetch_error() in expected def test_check_private( Index: poetry-1.6.1/tests/test_factory.py =================================================================== --- poetry-1.6.1.orig/tests/test_factory.py +++ poetry-1.6.1/tests/test_factory.py @@ -519,12 +519,20 @@ def test_create_poetry_fails_on_invalid_ with pytest.raises(RuntimeError) as e: Factory().create_poetry(fixture_dir("invalid_pyproject") / "pyproject.toml") - expected = """\ + jsonschema_error = "'description' is a required property" + fastjsonschema_error = "data must contain ['description'] properties" + + expected_template = """\ The Poetry configuration is invalid: - - 'description' is a required property + - {schema_error} - Project name (invalid) is same as one of its dependencies """ - assert str(e.value) == expected + expected = { + expected_template.format(schema_error=schema_error) + for schema_error in (jsonschema_error, fastjsonschema_error) + } + + assert str(e.value) in expected def test_create_poetry_with_local_config(fixture_dir: FixtureDirGetter) -> None: Index: poetry-1.6.1/.cirrus.yml =================================================================== --- poetry-1.6.1.orig/.cirrus.yml +++ poetry-1.6.1/.cirrus.yml @@ -23,8 +23,7 @@ test_task: - POETRY_HOME=/opt/poetry - $PYTHON -m venv $POETRY_HOME - $POETRY_HOME/bin/pip install --upgrade pip setuptools wheel - # jsonschema 4.18 uses Rust-based libraries which causes issues when building from source - - $POETRY_HOME/bin/pip install poetry "jsonschema<4.18.0" + - $POETRY_HOME/bin/pip install poetry - echo "PATH=$POETRY_HOME/bin:$PATH" >> $CIRRUS_ENV install_and_test_script: - poetry install Index: poetry-1.6.1/poetry.lock =================================================================== --- poetry-1.6.1.orig/poetry.lock +++ poetry-1.6.1/poetry.lock @@ -1,24 +1,6 @@ # This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. [[package]] -name = "attrs" -version = "23.1.0" -description = "Classes Without Boilerplate" -optional = false -python-versions = ">=3.7" -files = [ - {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, - {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, -] - -[package.extras] -cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] -dev = ["attrs[docs,tests]", "pre-commit"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] -tests = ["attrs[tests-no-zope]", "zope-interface"] -tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] - -[[package]] name = "build" version = "1.0.3" description = "A simple, correct Python build frontend" @@ -526,6 +508,20 @@ files = [ testing = ["hatch", "pre-commit", "pytest", "tox"] [[package]] +name = "fastjsonschema" +version = "2.18.0" +description = "Fastest Python implementation of JSON schema" +optional = false +python-versions = "*" +files = [ + {file = "fastjsonschema-2.18.0-py3-none-any.whl", hash = "sha256:128039912a11a807068a7c87d0da36660afbfd7202780db26c4aa7153cfdc799"}, + {file = "fastjsonschema-2.18.0.tar.gz", hash = "sha256:e820349dd16f806e4bd1467a138dced9def4bc7d6213a34295272a6cac95b5bd"}, +] + +[package.extras] +devel = ["colorama", "json-spec", "jsonschema", "pylint", "pytest", "pytest-benchmark", "pytest-cache", "validictory"] + +[[package]] name = "filelock" version = "3.12.2" description = "A platform independent file lock." @@ -668,27 +664,6 @@ test = ["async-timeout", "pytest", "pyte trio = ["async_generator", "trio"] [[package]] -name = "jsonschema" -version = "4.17.3" -description = "An implementation of JSON Schema validation for Python" -optional = false -python-versions = ">=3.7" -files = [ - {file = "jsonschema-4.17.3-py3-none-any.whl", hash = "sha256:a870ad254da1a8ca84b6a2905cac29d265f805acc57af304784962a2aa6508f6"}, - {file = "jsonschema-4.17.3.tar.gz", hash = "sha256:0f864437ab8b6076ba6707453ef8f98a6a0d512a80e93f8abdb676f737ecb60d"}, -] - -[package.dependencies] -attrs = ">=17.4.0" -importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} -pkgutil-resolve-name = {version = ">=1.3.10", markers = "python_version < \"3.9\""} -pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" - -[package.extras] -format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] -format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"] - -[[package]] name = "keyring" version = "24.2.0" description = "Store and access your passwords safely." @@ -920,17 +895,6 @@ files = [ testing = ["pytest", "pytest-cov"] [[package]] -name = "pkgutil-resolve-name" -version = "1.3.10" -description = "Resolve a name to an object." -optional = false -python-versions = ">=3.6" -files = [ - {file = "pkgutil_resolve_name-1.3.10-py3-none-any.whl", hash = "sha256:ca27cc078d25c5ad71a9de0a7a330146c4e014c2462d9af19c6b828280649c5e"}, - {file = "pkgutil_resolve_name-1.3.10.tar.gz", hash = "sha256:357d6c9e6a755653cfd78893817c0853af365dd51ec97f3d358a819373bbd174"}, -] - -[[package]] name = "platformdirs" version = "3.10.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." @@ -1067,42 +1031,6 @@ files = [ tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} [[package]] -name = "pyrsistent" -version = "0.19.3" -description = "Persistent/Functional/Immutable data structures" -optional = false -python-versions = ">=3.7" -files = [ - {file = "pyrsistent-0.19.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:20460ac0ea439a3e79caa1dbd560344b64ed75e85d8703943e0b66c2a6150e4a"}, - {file = "pyrsistent-0.19.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4c18264cb84b5e68e7085a43723f9e4c1fd1d935ab240ce02c0324a8e01ccb64"}, - {file = "pyrsistent-0.19.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4b774f9288dda8d425adb6544e5903f1fb6c273ab3128a355c6b972b7df39dcf"}, - {file = "pyrsistent-0.19.3-cp310-cp310-win32.whl", hash = "sha256:5a474fb80f5e0d6c9394d8db0fc19e90fa540b82ee52dba7d246a7791712f74a"}, - {file = "pyrsistent-0.19.3-cp310-cp310-win_amd64.whl", hash = "sha256:49c32f216c17148695ca0e02a5c521e28a4ee6c5089f97e34fe24163113722da"}, - {file = "pyrsistent-0.19.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f0774bf48631f3a20471dd7c5989657b639fd2d285b861237ea9e82c36a415a9"}, - {file = "pyrsistent-0.19.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3ab2204234c0ecd8b9368dbd6a53e83c3d4f3cab10ecaf6d0e772f456c442393"}, - {file = "pyrsistent-0.19.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e42296a09e83028b3476f7073fcb69ffebac0e66dbbfd1bd847d61f74db30f19"}, - {file = "pyrsistent-0.19.3-cp311-cp311-win32.whl", hash = "sha256:64220c429e42a7150f4bfd280f6f4bb2850f95956bde93c6fda1b70507af6ef3"}, - {file = "pyrsistent-0.19.3-cp311-cp311-win_amd64.whl", hash = "sha256:016ad1afadf318eb7911baa24b049909f7f3bb2c5b1ed7b6a8f21db21ea3faa8"}, - {file = "pyrsistent-0.19.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c4db1bd596fefd66b296a3d5d943c94f4fac5bcd13e99bffe2ba6a759d959a28"}, - {file = "pyrsistent-0.19.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aeda827381f5e5d65cced3024126529ddc4289d944f75e090572c77ceb19adbf"}, - {file = "pyrsistent-0.19.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:42ac0b2f44607eb92ae88609eda931a4f0dfa03038c44c772e07f43e738bcac9"}, - {file = "pyrsistent-0.19.3-cp37-cp37m-win32.whl", hash = "sha256:e8f2b814a3dc6225964fa03d8582c6e0b6650d68a232df41e3cc1b66a5d2f8d1"}, - {file = "pyrsistent-0.19.3-cp37-cp37m-win_amd64.whl", hash = "sha256:c9bb60a40a0ab9aba40a59f68214eed5a29c6274c83b2cc206a359c4a89fa41b"}, - {file = "pyrsistent-0.19.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:a2471f3f8693101975b1ff85ffd19bb7ca7dd7c38f8a81701f67d6b4f97b87d8"}, - {file = "pyrsistent-0.19.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc5d149f31706762c1f8bda2e8c4f8fead6e80312e3692619a75301d3dbb819a"}, - {file = "pyrsistent-0.19.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3311cb4237a341aa52ab8448c27e3a9931e2ee09561ad150ba94e4cfd3fc888c"}, - {file = "pyrsistent-0.19.3-cp38-cp38-win32.whl", hash = "sha256:f0e7c4b2f77593871e918be000b96c8107da48444d57005b6a6bc61fb4331b2c"}, - {file = "pyrsistent-0.19.3-cp38-cp38-win_amd64.whl", hash = "sha256:c147257a92374fde8498491f53ffa8f4822cd70c0d85037e09028e478cababb7"}, - {file = "pyrsistent-0.19.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b735e538f74ec31378f5a1e3886a26d2ca6351106b4dfde376a26fc32a044edc"}, - {file = "pyrsistent-0.19.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99abb85579e2165bd8522f0c0138864da97847875ecbd45f3e7e2af569bfc6f2"}, - {file = "pyrsistent-0.19.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a8cb235fa6d3fd7aae6a4f1429bbb1fec1577d978098da1252f0489937786f3"}, - {file = "pyrsistent-0.19.3-cp39-cp39-win32.whl", hash = "sha256:c74bed51f9b41c48366a286395c67f4e894374306b197e62810e0fdaf2364da2"}, - {file = "pyrsistent-0.19.3-cp39-cp39-win_amd64.whl", hash = "sha256:878433581fc23e906d947a6814336eee031a00e6defba224234169ae3d3d6a98"}, - {file = "pyrsistent-0.19.3-py3-none-any.whl", hash = "sha256:ccf0d6bd208f8111179f0c26fdf84ed7c3891982f2edaeae7422575f47e66b64"}, - {file = "pyrsistent-0.19.3.tar.gz", hash = "sha256:1a2994773706bbb4995c31a97bc94f1418314923bd1048c6d964837040376440"}, -] - -[[package]] name = "pytest" version = "7.4.0" description = "pytest: simple powerful testing with Python" @@ -1494,17 +1422,6 @@ files = [ ] [[package]] -name = "types-jsonschema" -version = "4.17.0.10" -description = "Typing stubs for jsonschema" -optional = false -python-versions = "*" -files = [ - {file = "types-jsonschema-4.17.0.10.tar.gz", hash = "sha256:8e979db34d69bc9f9b3d6e8b89bdbc60b3a41cfce4e1fb87bf191d205c7f5098"}, - {file = "types_jsonschema-4.17.0.10-py3-none-any.whl", hash = "sha256:3aa2a89afbd9eaa6ce0c15618b36f02692a621433889ce73014656f7d8caf971"}, -] - -[[package]] name = "types-requests" version = "2.31.0.2" description = "Typing stubs for requests" Index: poetry-1.6.1/pyproject.toml =================================================================== --- poetry-1.6.1.orig/pyproject.toml +++ poetry-1.6.1/pyproject.toml @@ -39,10 +39,9 @@ cachecontrol = { version = "^0.13.0", ex cleo = "^2.0.0" crashtest = "^0.4.1" dulwich = "^0.21.2" +fastjsonschema = "^2.18.0" importlib-metadata = { version = ">=4.4", python = "<3.10" } installer = "^0.7.0" -# jsonschema 4.18 uses Rust-based libraries which causes issues when building from source -jsonschema = ">=4.10.0,<4.18.0" keyring = "^24.0.0" # packaging uses calver, so version is unclamped packaging = ">=20.4" @@ -74,7 +73,6 @@ pytest-xdist = { version = "^3.1", extra [tool.poetry.group.typing.dependencies] mypy = ">=1.0" -types-jsonschema = ">=4.9.0" types-requests = ">=2.28.8" # only used in github actions @@ -181,6 +179,7 @@ warn_unused_ignores = false [[tool.mypy.overrides]] module = [ 'deepdiff.*', + 'fastjsonschema.*', 'httpretty.*', 'keyring.*', 'pexpect.*', Index: poetry-1.6.1/src/poetry/json/__init__.py =================================================================== --- poetry-1.6.1.orig/src/poetry/json/__init__.py +++ poetry-1.6.1/src/poetry/json/__init__.py @@ -5,8 +5,9 @@ import json from pathlib import Path from typing import Any -import jsonschema +import fastjsonschema +from fastjsonschema.exceptions import JsonSchemaException from poetry.core.json import SCHEMA_DIR as CORE_SCHEMA_DIR @@ -21,18 +22,13 @@ def validate_object(obj: dict[str, Any]) schema_file = Path(SCHEMA_DIR, "poetry.json") schema = json.loads(schema_file.read_text(encoding="utf-8")) - validator = jsonschema.Draft7Validator(schema) - validation_errors = sorted(validator.iter_errors(obj), key=lambda e: e.path) + validate = fastjsonschema.compile(schema) errors = [] - - for error in validation_errors: - message = error.message - if error.path: - path = ".".join(str(x) for x in error.absolute_path) - message = f"[{path}] {message}" - - errors.append(message) + try: + validate(obj) + except JsonSchemaException as e: + errors = [e.message] core_schema = json.loads( (CORE_SCHEMA_DIR / "poetry-schema.json").read_text(encoding="utf-8") Index: poetry-1.6.1/tests/json/test_schema_sources.py =================================================================== --- poetry-1.6.1.orig/tests/json/test_schema_sources.py +++ poetry-1.6.1/tests/json/test_schema_sources.py @@ -29,8 +29,8 @@ def test_pyproject_toml_invalid_priority content = toml["tool"]["poetry"] assert Factory.validate(content) == { "errors": [ - "[source.0.priority] 'arbitrary' is not one of ['primary', 'default'," - " 'secondary', 'supplemental', 'explicit']" + "data.source[0].priority must be one of ['primary', 'default', " + "'secondary', 'supplemental', 'explicit']" ], "warnings": [], } @@ -42,12 +42,6 @@ def test_pyproject_toml_invalid_priority ).read() content = toml["tool"]["poetry"] assert Factory.validate(content) == { - "errors": [ - "[source.0] {'name': 'pypi-simple', 'url': " - "'https://pypi.org/simple/', 'default': False, 'priority': " - "'primary'} should not be valid under {'anyOf': [{'required': " - "['priority', 'default']}, {'required': ['priority', " - "'secondary']}]}" - ], + "errors": ["data.source[0] must NOT match a disallowed definition"], "warnings": [], }