summaryrefslogtreecommitdiff
path: root/dev-python/openapi-spec-validator
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-09-02 22:17:13 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-09-02 22:17:13 +0100
commitec321939a77843497c860196ea06d7776d94b755 (patch)
tree426c3b59f57bfb684b461e65c4416048b369b4ce /dev-python/openapi-spec-validator
parent2982504d287f7f91eade76902f11e691f8181071 (diff)
gentoo auto-resync : 02:09:2022 - 22:17:13
Diffstat (limited to 'dev-python/openapi-spec-validator')
-rw-r--r--dev-python/openapi-spec-validator/Manifest3
-rw-r--r--dev-python/openapi-spec-validator/files/openapi-spec-validator-0.5.0-std-importlib.patch43
-rw-r--r--dev-python/openapi-spec-validator/openapi-spec-validator-0.5.0.ebuild63
3 files changed, 109 insertions, 0 deletions
diff --git a/dev-python/openapi-spec-validator/Manifest b/dev-python/openapi-spec-validator/Manifest
index 000f3647e540..d042ee09ba76 100644
--- a/dev-python/openapi-spec-validator/Manifest
+++ b/dev-python/openapi-spec-validator/Manifest
@@ -1,3 +1,6 @@
+AUX openapi-spec-validator-0.5.0-std-importlib.patch 1451 BLAKE2B ed6a94863f92e5eef2b443826239ccd110b1caacc559465edb0bada4028c38164e9fbfd1a4585211f5384b76866f25dcf55f229ce3582fe377ed2d7f1e711745 SHA512 2d1550cbd8364f26d62e709567fd08e5a134b5ab69ec88fd2f00c928f878c811ef850ce4ed01ac79abe583c84403de912c9845c3ccd264707b403fe1c9ee0544
DIST openapi-spec-validator-0.4.0.gh.tar.gz 46051 BLAKE2B 43a1458ab1801700261f750e49d45b0cb4d02f1c17a16943b5232836061e0e1466fc973343bbd4bf7a8669b682bd6761cb905fdfb3b80c0b9720253cc2d5a926 SHA512 d2eaf22c75e72eb5061a916eb37b13179a5ba65eb8a00ec42e81c6b4168239bc8613388f2d77ce35113d260385b175280d8863a3deedf18ea5aa93a79f058419
+DIST openapi-spec-validator-0.5.0.gh.tar.gz 39173 BLAKE2B 0c9ac1617423b2f1983e1036b5bfddba3388ace454bb3df743d9d5fe62708fabd54ff4373b77901fc78e7e761d0cc059132a557e73bf5095618fd6f1f074bcfe SHA512 728f600962b493a0e6914d5ac662cda107929630e26b95fb3d5749579d90d278073f5b5d69445cbe90e4c3edbc2ee5de34045f34003a8c75a3d5a33df52cb1fc
EBUILD openapi-spec-validator-0.4.0.ebuild 1503 BLAKE2B 9630f20e77d363c1dbc99ab2a3cc6a5732fb1a9931fb39a7070e8822b24f4d45310b53287ca0c6fe3c09bd6f4a0f7acf01233b60b79c040954fd42fa36efddf2 SHA512 0c8f2cfbc74d2235fc83f579a33f781972b6756a632074ccea4a41f87014286b9edefb23d14fa3e311b81350372387ddd463a758d3f69c5c705ddb8a64db25af
+EBUILD openapi-spec-validator-0.5.0.ebuild 1913 BLAKE2B 1c7a619634cd56147b74c5d5a81cd01a9538f3ea42bd1dad92787c578af1e1e673c53206f9a914d37b975ce0a8723a56363bfb1e736d30f9c913a8ccad19f4d6 SHA512 c764cc282cbdb6a048628cec0c092f45dbda0d652d9e2c1c35d52edbe552d4f57c54aaa3d72c5c4fd50dd822c8fbe4589be1aea98782846f76ff2438e8bc18c5
MISC metadata.xml 372 BLAKE2B 6b08d5f1a63e2ddf4c0f1ab8479a18109231211c82a2a1178a9e1d0775ad0fd5811580c3b2175137ec135b6c8d8ad0e0d728d79da98c092fd87fc604c7cc8a4f SHA512 4fe628abc1481b9dd5874dd5efaaefa5f1adf24e2e58183d2ca75677680077a443702887bb21c67049df998052dc6afae590ac9197b6edb87cc10c126ae22345
diff --git a/dev-python/openapi-spec-validator/files/openapi-spec-validator-0.5.0-std-importlib.patch b/dev-python/openapi-spec-validator/files/openapi-spec-validator-0.5.0-std-importlib.patch
new file mode 100644
index 000000000000..ac794b49cd9a
--- /dev/null
+++ b/dev-python/openapi-spec-validator/files/openapi-spec-validator-0.5.0-std-importlib.patch
@@ -0,0 +1,43 @@
+From: Arthur Zamarin <arthurzam@gentoo.org>
+Date: Fri, 2 Sep 2022 18:11:35 +0300
+Subject: [PATCH] Use stdlib importlib.resources on python >= 3.9
+
+https://github.com/p1c2u/openapi-spec-validator/pull/174
+
+--- a/openapi_spec_validator/schemas/utils.py
++++ b/openapi_spec_validator/schemas/utils.py
+@@ -5,14 +5,17 @@ from typing import Hashable
+ from typing import Mapping
+ from typing import Tuple
+
+-import importlib_resources
++try:
++ from importlib.resources import as_file, files
++except ImportError:
++ from importlib_resources import as_file, files
+ from jsonschema_spec.readers import FilePathReader
+
+
+ def get_schema(version: str) -> Tuple[Mapping[Hashable, Any], str]:
+ schema_path = f"resources/schemas/v{version}/schema.json"
+- ref = importlib_resources.files("openapi_spec_validator") / schema_path
+- with importlib_resources.as_file(ref) as resource_path:
++ ref = files("openapi_spec_validator") / schema_path
++ with as_file(ref) as resource_path:
+ schema_path_full = path.join(path.dirname(__file__), resource_path)
+ return FilePathReader(schema_path_full).read()
+
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -49,7 +49,7 @@ openapi-schema-validator = "^0.3.2"
+ python = "^3.7.0"
+ PyYAML = ">=5.1"
+ requests = {version = "*", optional = true}
+-importlib-resources = "^5.8.0"
++importlib-resources = {version = "^5.8.0", python = "<3.9" }
+ jsonschema-spec = "^0.1.1"
+ lazy-object-proxy = "^1.7.1"
+
+--
+2.37.3
+
diff --git a/dev-python/openapi-spec-validator/openapi-spec-validator-0.5.0.ebuild b/dev-python/openapi-spec-validator/openapi-spec-validator-0.5.0.ebuild
new file mode 100644
index 000000000000..e6eeebc3d5af
--- /dev/null
+++ b/dev-python/openapi-spec-validator/openapi-spec-validator-0.5.0.ebuild
@@ -0,0 +1,63 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=poetry
+PYTHON_COMPAT=( pypy3 python3_{8..11} )
+
+inherit distutils-r1
+
+DESCRIPTION="OpenAPI 2.0 (aka Swagger) and OpenAPI 3.0 spec validator"
+HOMEPAGE="
+ https://github.com/p1c2u/openapi-spec-validator/
+ https://pypi.org/project/openapi-spec-validator/
+"
+SRC_URI="
+ https://github.com/p1c2u/openapi-spec-validator/archive/${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~riscv"
+
+RDEPEND="
+ >=dev-python/jsonschema-3.2.0[${PYTHON_USEDEP}]
+ dev-python/jsonschema-spec[${PYTHON_USEDEP}]
+ >=dev-python/openapi-schema-validator-0.2.0[${PYTHON_USEDEP}]
+ >=dev-python/pyyaml-5.1[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/importlib_resources[${PYTHON_USEDEP}]
+ ' 3.8)
+"
+
+PATCHES=(
+ # https://github.com/p1c2u/openapi-spec-validator/pull/174
+ "${FILESDIR}/${P}-std-importlib.patch"
+)
+
+distutils_enable_tests pytest
+
+EPYTEST_DESELECT=(
+ # Internet
+ tests/integration/test_shortcuts.py::TestPetstoreV2Example
+ tests/integration/test_shortcuts.py::TestApiV2WithExampe
+ tests/integration/test_shortcuts.py::TestPetstoreV2ExpandedExample
+ tests/integration/test_shortcuts.py::TestPetstoreExample
+ tests/integration/test_shortcuts.py::TestRemoteValidatev2SpecUrl
+ tests/integration/test_shortcuts.py::TestRemoteValidatev30SpecUrl
+ tests/integration/test_shortcuts.py::TestApiWithExample
+ tests/integration/test_shortcuts.py::TestPetstoreExpandedExample
+ tests/integration/test_validate.py::TestPetstoreExample
+ tests/integration/test_validate.py::TestApiWithExample
+ tests/integration/test_validate.py::TestPetstoreExpandedExample
+ tests/integration/validation/test_validators.py
+)
+
+src_prepare() {
+ sed -i -e '/--cov/d' pyproject.toml || die
+ distutils-r1_src_prepare
+}