1
0

- 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
This commit is contained in:
Dirk Mueller 2023-01-06 13:08:21 +00:00 committed by Git OBS Bridge
parent 44cd312eed
commit 30f0830f62
6 changed files with 38 additions and 47 deletions

23
217.patch Normal file
View File

@ -0,0 +1,23 @@
From 325d8111a924a951d8778c9fc1dbce30be267435 Mon Sep 17 00:00:00 2001
From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
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

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:999b0ef13b798cf04de5451a51201d63a6feaf07c3fdcfbab4e5bca2b4ac653e
size 81860

BIN
jmespath-1.0.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Sep 17 15:41:47 UTC 2022 - Dirk Müller <dmueller@suse.com>
- 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 <steven.kowalik@suse.com> Mon Sep 27 03:03:07 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package python-jmespath # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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 Name: python-jmespath
Version: 0.10.0 Version: 1.0.1
Release: 0 Release: 0
Summary: Python module for declarative JSON document element extraction Summary: Python module for declarative JSON document element extraction
License: MIT License: MIT
URL: https://github.com/jmespath/jmespath.py URL: https://github.com/jmespath/jmespath.py
Source: https://github.com/jmespath/jmespath.py/archive/refs/tags/%{version}.tar.gz#/jmespath-%{version}.tar.gz Source: https://github.com/jmespath/jmespath.py/archive/refs/tags/%{version}.tar.gz#/jmespath-%{version}.tar.gz
Patch0: remove-nose.patch
# Testing # Testing
BuildRequires: %{python_module hypothesis} BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module ply >= 3.4} BuildRequires: %{python_module ply >= 3.4}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module simplejson} BuildRequires: %{python_module simplejson}
BuildRequires: fdupes BuildRequires: fdupes
@ -71,8 +71,7 @@ The * can also be used for hash types:
The expression: foo.*.name will return ["one", "two"]. The expression: foo.*.name will return ["one", "two"].
%prep %prep
%setup -q -n jmespath.py-%{version} %autosetup -p1 -n jmespath.py-%{version}
%autopatch -p1
%build %build
%python_build %python_build
@ -84,11 +83,8 @@ mv %{buildroot}%{_bindir}/jp.py %{buildroot}%{_bindir}/jp
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
%if 0%{?suse_version} > 1500 # hangs on python 3.8 with pytest
%pyunittest discover -v %pyunittest discover -v
%else
%python_exec setup.py test
%endif
%post %post
%python_install_alternative jp %python_install_alternative jp

View File

@ -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):