From 30f0830f62b40d1734534dd696dcda855806474a3ad4401e99b72cedfbdab7cb Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 6 Jan 2023 13:08:21 +0000 Subject: [PATCH 1/4] - update to 1.0.1: * Drop support for Python versions less than 3.7 (including Python 2). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jmespath?expand=0&rev=43 --- 217.patch | 23 +++++++++++++++++++++++ jmespath-0.10.0.tar.gz | 3 --- jmespath-1.0.1.tar.gz | 3 +++ python-jmespath.changes | 6 ++++++ python-jmespath.spec | 16 ++++++---------- remove-nose.patch | 34 ---------------------------------- 6 files changed, 38 insertions(+), 47 deletions(-) create mode 100644 217.patch delete mode 100644 jmespath-0.10.0.tar.gz create mode 100644 jmespath-1.0.1.tar.gz delete mode 100644 remove-nose.patch diff --git a/217.patch b/217.patch new file mode 100644 index 0000000..719a970 --- /dev/null +++ b/217.patch @@ -0,0 +1,23 @@ +From 325d8111a924a951d8778c9fc1dbce30be267435 Mon Sep 17 00:00:00 2001 +From: Karthikeyan Singaravelan +Date: Wed, 10 Mar 2021 14:15:36 +0000 +Subject: [PATCH] Use list for random.sample since using a set has been + deprecated since Python 3.9 + +--- + jmespath/parser.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/jmespath/parser.py b/jmespath/parser.py +index eeac38fa..47066880 100644 +--- a/jmespath/parser.py ++++ b/jmespath/parser.py +@@ -489,7 +489,7 @@ def _raise_parse_error_maybe_eof(self, expected_type, token): + lex_position, actual_value, actual_type, message) + + def _free_cache_entries(self): +- for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): ++ for key in random.sample(list(self._CACHE.keys()), int(self._MAX_SIZE / 2)): + self._CACHE.pop(key, None) + + @classmethod diff --git a/jmespath-0.10.0.tar.gz b/jmespath-0.10.0.tar.gz deleted file mode 100644 index adea7fe..0000000 --- a/jmespath-0.10.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:999b0ef13b798cf04de5451a51201d63a6feaf07c3fdcfbab4e5bca2b4ac653e -size 81860 diff --git a/jmespath-1.0.1.tar.gz b/jmespath-1.0.1.tar.gz new file mode 100644 index 0000000..d9012d5 --- /dev/null +++ b/jmespath-1.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a02470b1716ec7a32abe89a873a4795c41c938468225f8a53d860980ec9e3c6 +size 80936 diff --git a/python-jmespath.changes b/python-jmespath.changes index 7d230ca..04ee571 100644 --- a/python-jmespath.changes +++ b/python-jmespath.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Sep 17 15:41:47 UTC 2022 - Dirk Müller + +- update to 1.0.1: + * Drop support for Python versions less than 3.7 (including Python 2). + ------------------------------------------------------------------- Mon Sep 27 03:03:07 UTC 2021 - Steve Kowalik diff --git a/python-jmespath.spec b/python-jmespath.spec index 2f1c0ab..70c2544 100644 --- a/python-jmespath.spec +++ b/python-jmespath.spec @@ -1,7 +1,7 @@ # # spec file for package python-jmespath # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,18 +16,18 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?!python_module:%define python_module() python3-%{**}} Name: python-jmespath -Version: 0.10.0 +Version: 1.0.1 Release: 0 Summary: Python module for declarative JSON document element extraction License: MIT URL: https://github.com/jmespath/jmespath.py Source: https://github.com/jmespath/jmespath.py/archive/refs/tags/%{version}.tar.gz#/jmespath-%{version}.tar.gz -Patch0: remove-nose.patch # Testing BuildRequires: %{python_module hypothesis} BuildRequires: %{python_module ply >= 3.4} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module simplejson} BuildRequires: fdupes @@ -71,8 +71,7 @@ The * can also be used for hash types: The expression: foo.*.name will return ["one", "two"]. %prep -%setup -q -n jmespath.py-%{version} -%autopatch -p1 +%autosetup -p1 -n jmespath.py-%{version} %build %python_build @@ -84,11 +83,8 @@ mv %{buildroot}%{_bindir}/jp.py %{buildroot}%{_bindir}/jp %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%if 0%{?suse_version} > 1500 +# hangs on python 3.8 with pytest %pyunittest discover -v -%else -%python_exec setup.py test -%endif %post %python_install_alternative jp diff --git a/remove-nose.patch b/remove-nose.patch deleted file mode 100644 index f6a9ee1..0000000 --- a/remove-nose.patch +++ /dev/null @@ -1,34 +0,0 @@ -Index: jmespath.py-0.10.0/extra/test_hypothesis.py -=================================================================== ---- jmespath.py-0.10.0.orig/extra/test_hypothesis.py -+++ jmespath.py-0.10.0/extra/test_hypothesis.py -@@ -6,7 +6,6 @@ import os - import sys - import numbers - --from nose.plugins.skip import SkipTest - from hypothesis import given, settings, assume, HealthCheck - import hypothesis.strategies as st - -Index: jmespath.py-0.10.0/tests/test_compliance.py -=================================================================== ---- jmespath.py-0.10.0.orig/tests/test_compliance.py -+++ jmespath.py-0.10.0/tests/test_compliance.py -@@ -3,8 +3,6 @@ from pprint import pformat - from tests import OrderedDict - from tests import json - --from nose.tools import assert_equal -- - from jmespath.visitor import Options - - -@@ -80,7 +78,7 @@ def _test_expression(given, expression, - actual_repr, pformat(parsed.parsed), - json.dumps(given, indent=4))) - error_msg = error_msg.replace(r'\n', '\n') -- assert_equal(actual, expected, error_msg) -+ assert actual == expected, error_msg - - - def _test_error_expression(given, expression, error, filename): From 7bc92749b16061697074ff3838cc7a1c693116d817613507bd7937e24fc4c81f Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 6 Jan 2023 13:09:02 +0000 Subject: [PATCH 2/4] - add 217.patch for python 3.11 support - drop remove-nose.patch (upstream) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jmespath?expand=0&rev=44 --- python-jmespath.changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-jmespath.changes b/python-jmespath.changes index 04ee571..bc70165 100644 --- a/python-jmespath.changes +++ b/python-jmespath.changes @@ -3,6 +3,8 @@ Sat Sep 17 15:41:47 UTC 2022 - Dirk Müller - update to 1.0.1: * Drop support for Python versions less than 3.7 (including Python 2). +- add 217.patch for python 3.11 support +- drop remove-nose.patch (upstream) ------------------------------------------------------------------- Mon Sep 27 03:03:07 UTC 2021 - Steve Kowalik From 58adc35dc713325b2e23930fa25dfcb2888315eb74c62cf296c1b8d563344c74 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 23 Jan 2023 17:16:08 +0000 Subject: [PATCH 3/4] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jmespath?expand=0&rev=45 --- python-jmespath.changes | 1 - 1 file changed, 1 deletion(-) diff --git a/python-jmespath.changes b/python-jmespath.changes index bc70165..c192560 100644 --- a/python-jmespath.changes +++ b/python-jmespath.changes @@ -3,7 +3,6 @@ Sat Sep 17 15:41:47 UTC 2022 - Dirk Müller - update to 1.0.1: * Drop support for Python versions less than 3.7 (including Python 2). -- add 217.patch for python 3.11 support - drop remove-nose.patch (upstream) ------------------------------------------------------------------- From c1157725854ea7b1a6c7200aa928b4a0a2855669ed75069856611e941ae580c6 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 23 Jan 2023 17:16:14 +0000 Subject: [PATCH 4/4] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jmespath?expand=0&rev=46 --- 217.patch | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 217.patch diff --git a/217.patch b/217.patch deleted file mode 100644 index 719a970..0000000 --- a/217.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 325d8111a924a951d8778c9fc1dbce30be267435 Mon Sep 17 00:00:00 2001 -From: Karthikeyan Singaravelan -Date: Wed, 10 Mar 2021 14:15:36 +0000 -Subject: [PATCH] Use list for random.sample since using a set has been - deprecated since Python 3.9 - ---- - jmespath/parser.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/jmespath/parser.py b/jmespath/parser.py -index eeac38fa..47066880 100644 ---- a/jmespath/parser.py -+++ b/jmespath/parser.py -@@ -489,7 +489,7 @@ def _raise_parse_error_maybe_eof(self, expected_type, token): - lex_position, actual_value, actual_type, message) - - def _free_cache_entries(self): -- for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): -+ for key in random.sample(list(self._CACHE.keys()), int(self._MAX_SIZE / 2)): - self._CACHE.pop(key, None) - - @classmethod