Update to version 1.21 upstream

Added a patch to disable unit test test_js_file. An issue
has been reported upstream in [1].

[1] https://github.com/stefankoegl/python-json-patch/issues/82
This commit is contained in:
Alfredo Moralejo 2018-02-06 16:35:32 +00:00
parent 503ab82b53
commit 760285efc4
5 changed files with 39 additions and 40 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/jsonpatch-1.2.tar.gz /jsonpatch-1.2.tar.gz
/python-json-patch-1.2-f6f3cd2.tar.gz /python-json-patch-1.2-f6f3cd2.tar.gz
/jsonpatch-1.14.tar.gz /jsonpatch-1.14.tar.gz
/jsonpatch-1.21.tar.gz

View File

@ -0,0 +1,25 @@
From 5bf37e237694ac7bf028f9129561d1265fd95621 Mon Sep 17 00:00:00 2001
From: Alfredo Moralejo <amoralej@redhat.com>
Date: Tue, 6 Feb 2018 16:57:17 +0000
Subject: [PATCH] Skip unit test in packaging
Tarball from pypy does not provides tests.js file.
---
tests.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests.py b/tests.py
index 548d28b..0386e29 100755
--- a/tests.py
+++ b/tests.py
@@ -13,6 +13,7 @@ import sys
class ApplyPatchTestCase(unittest.TestCase):
+ @unittest.skip("Skipping in packaging")
def test_js_file(self):
with open('./tests.js', 'r') as f:
tests = json.load(f)
--
1.8.3.1

View File

@ -4,18 +4,16 @@
%endif %endif
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 1.14 Version: 1.21
Release: 5%{?dist} Release: 1%{?dist}
Summary: Applying JSON Patches in Python Summary: Applying JSON Patches in Python
License: BSD License: BSD
URL: https://github.com/stefankoegl/%{github_name} URL: https://github.com/stefankoegl/%{github_name}
#Source0: https://pypi.python.org/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
# pypi tarball does not contain README.md and tests.py
Source0: https://pypi.io/packages/source/j/jsonpatch/%{pypi_name}-%{version}.tar.gz Source0: https://pypi.io/packages/source/j/jsonpatch/%{pypi_name}-%{version}.tar.gz
# Fix python 3 tests # tarball from pypi does not include file tests.js required for a specific test.
# From upstream commit: https://github.com/stefankoegl/python-json-patch/commit/d6e9a0047bad780b53151f572ea257f1cb6ebe41 # upstream issue https://github.com/stefankoegl/python-json-patch/issues/82
Patch0: use-inspect.signature-on-Python-3.patch Patch0: 0001-Skip-unit-test-in-packaging.patch
BuildArch: noarch BuildArch: noarch
@ -26,9 +24,9 @@ Library to apply JSON Patches according to RFC 6902 - Python 2 build.
Summary: Applying JSON Patches in Python 2 Summary: Applying JSON Patches in Python 2
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python2-setuptools
BuildRequires: python-jsonpointer BuildRequires: python2-jsonpointer
Requires: python-jsonpointer Requires: python2-jsonpointer
%{?python_provide:%python_provide python2-%{pypi_name}} %{?python_provide:%python_provide python2-%{pypi_name}}
@ -55,6 +53,7 @@ Library to apply JSON Patches according to RFC 6902 - Python 3 build.
%setup -qn %{pypi_name}-%{version} %setup -qn %{pypi_name}-%{version}
%patch0 -p1 %patch0 -p1
%build %build
%py2_build %py2_build
@ -114,6 +113,9 @@ done;
%endif %endif
%changelog %changelog
* Tue Feb 6 2018 Alfredo Moralejo <amoralej@redhat.com> - 1.21-1
- Update to 1.21
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 1.14-5 * Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 1.14-5
- Cleanup spec file conditionals - Cleanup spec file conditionals

View File

@ -1 +1 @@
cf4fbad8188f1389363433dbf867109f jsonpatch-1.14.tar.gz SHA512 (jsonpatch-1.21.tar.gz) = dc902b750241833a68612430f07007080ed56dce8a7a4bdd1c042f944cd6cfdc03f4b422cc6bed6bc3b21ea390c5a281cd08181e27d6b57fc5fb657787c1d740

View File

@ -1,29 +0,0 @@
From d6e9a0047bad780b53151f572ea257f1cb6ebe41 Mon Sep 17 00:00:00 2001
From: Victor Stinner <vstinner@redhat.com>
Date: Wed, 29 Jun 2016 11:13:00 +0200
Subject: [PATCH] Use inspect.signature() on Python 3
The inspect.getargspec() function has been deprecated in Python 3:
https://docs.python.org/3/library/inspect.html#inspect.getargspec
---
jsonpatch.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/jsonpatch.py b/jsonpatch.py
index 32508e2..3c83f61 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -105,8 +105,11 @@ def get_loadjson():
function with object_pairs_hook set to multidict for Python versions that
support the parameter. """
- argspec = inspect.getargspec(json.load)
- if 'object_pairs_hook' not in argspec.args:
+ if sys.version_info >= (3, 3):
+ args = inspect.signature(json.load).parameters
+ else:
+ args = inspect.getargspec(json.load).args
+ if 'object_pairs_hook' not in args:
return json.load
return functools.partial(json.load, object_pairs_hook=multidict)