Notification time stamped 2023-06-30 16:46:24 UTC
From e09aaa1b6c5bf23094e7fce72798fbcc84b48686 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley code@musicinmybrain.net Date: Jan 16 2023 14:39:16 +0000 Subject: Update to 0.5.2 (close RHBZ#2161144, fix RHBZ#2160913)
- Switch to GitHub source and run the (offline) tests
---
diff --git a/.gitignore b/.gitignore index 83de72d..711105b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /openapi-spec-validator-0.5.1.tar.gz +/openapi-spec-validator-0.5.2.tar.gz diff --git a/188.patch b/188.patch new file mode 100644 index 0000000..9c44015 --- /dev/null +++ b/188.patch @@ -0,0 +1,29 @@ +From b2b2424977bd8f4f4665e576d1044064aed60762 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" code@musicinmybrain.net +Date: Mon, 16 Jan 2023 09:21:56 -0500 +Subject: [PATCH] Fix an errant string identity comparison in a test +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Short strings can be interned as an optimization in the Python +interpreter, so comparing them by identity (“is”, memory address) can +succeed in practice, but it is neither correct nor reliable when +comparing by equality (“==”, value) is intended. +--- + tests/integration/validation/test_exceptions.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/integration/validation/test_exceptions.py b/tests/integration/validation/test_exceptions.py +index cbd9976..8f3b675 100644 +--- a/tests/integration/validation/test_exceptions.py ++++ b/tests/integration/validation/test_exceptions.py +@@ -465,7 +465,7 @@ def test_parameter_default_value_custom_format_invalid(self, validator_v30): + + @oas30_format_checker.checks("custom") + def validate(to_validate) -> bool: +- return to_validate is "valid" ++ return to_validate == "valid" + + spec = { + "openapi": "3.0.0", diff --git a/openapi-spec-validator_importlib-resources.patch b/openapi-spec-validator_importlib-resources.patch deleted file mode 100644 index ed39c75..0000000 --- a/openapi-spec-validator_importlib-resources.patch +++ /dev/null @@ -1,53 +0,0 @@ -From c4746e3aeea4c762292035751c9e358ed80afae7 Mon Sep 17 00:00:00 2001 -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 - -Signed-off-by: Arthur Zamarin arthurzam@gentoo.org ---- - openapi_spec_validator/schemas/utils.py | 10 +++++++--- - pyproject.toml | 2 +- - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/openapi_spec_validator/schemas/utils.py b/openapi_spec_validator/schemas/utils.py -index b9a5eaa..d3d2fba 100644 ---- a/openapi_spec_validator/schemas/utils.py -+++ b/openapi_spec_validator/schemas/utils.py -@@ -1,18 +1,22 @@ - """OpenAIP spec validator schemas utils module.""" -+import sys - from os import path - from typing import Any - from typing import Hashable - from typing import Mapping - from typing import Tuple - --import importlib_resources -+if sys.version_info >= (3, 9): -+ from importlib.resources import as_file, files -+else: -+ 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() - -diff --git a/pyproject.toml b/pyproject.toml -index 3bd90ee..62d8fb9 100644 ---- 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" diff --git a/python-openapi-spec-validator.spec b/python-openapi-spec-validator.spec index e82b4d5..6a54712 100644 --- a/python-openapi-spec-validator.spec +++ b/python-openapi-spec-validator.spec @@ -2,21 +2,23 @@ %global modname openapi_spec_validator
Name: python-%{srcname} -Version: 0.5.1 +Version: 0.5.2 Release: %autorelease Summary: Python library for OpenAPI specs validation
License: Apache-2.0 -URL: https://pypi.python.org/pypi/%%7Bsrcname%7D -Source: %{pypi_source} +URL: https://github.com/p1c2u/%%7Bsrcname%7D +# The GitHub archive has the tests; the PyPI sdist does not. +Source: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
-Patch: openapi-spec-validator_importlib-resources.patch +# Fix an errant string identity comparison in a test +# https://github.com/p1c2u/openapi-spec-validator/pull/188 +Patch: %{url}/pull/188.patch
BuildArch: noarch
BuildRequires: python3-devel -BuildRequires: poetry - +BuildRequires: python3dist(pytest)
%global _description %{expand: OpenAPI Spec Validator is a Python library that validates OpenAPI Specs @@ -34,6 +36,9 @@ Summary: %{summary}
%prep %autosetup -p1 -n %{srcname}-%{version} +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters +sed -r -i '/^--cov[-=]/d' pyproject.toml +
%generate_buildrequires %pyproject_buildrequires @@ -49,7 +54,7 @@ Summary: %{summary}
%check -%pyproject_check_import +%pytest -m 'not network'
%files -n python3-%{srcname} -f %{pyproject_files} diff --git a/sources b/sources index ebdb36e..4c660eb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openapi-spec-validator-0.5.1.tar.gz) = 303d8ebb66a05664423f2012c91b9bdf745712a61b98308a778c49ab9053a4cd89f02a185e0f99def8c4286bfa6b8f5c4b20dc152f828c455d090023b6694ec1 +SHA512 (openapi-spec-validator-0.5.2.tar.gz) = 68f7d507a239c555575e2edb3bab576fd1fede9bcebde48c57361e3e764c9c19c4dc0d63e650851c2f6e7f2dd7f4efcdcd028842e259aa9e341823cd052a6e20
https://src.fedoraproject.org/rpms/python-openapi-spec-validator/c/e09aaa1b6...