From 760285efc407bf7e859d39cc8ace9e18873e7905 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Tue, 6 Feb 2018 16:35:32 +0000 Subject: [PATCH] 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 --- .gitignore | 1 + 0001-Skip-unit-test-in-packaging.patch | 25 +++++++++++++++++++++ python-jsonpatch.spec | 22 ++++++++++--------- sources | 2 +- use-inspect.signature-on-Python-3.patch | 29 ------------------------- 5 files changed, 39 insertions(+), 40 deletions(-) create mode 100644 0001-Skip-unit-test-in-packaging.patch delete mode 100644 use-inspect.signature-on-Python-3.patch diff --git a/.gitignore b/.gitignore index 79b7d7f..17be253 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /jsonpatch-1.2.tar.gz /python-json-patch-1.2-f6f3cd2.tar.gz /jsonpatch-1.14.tar.gz +/jsonpatch-1.21.tar.gz diff --git a/0001-Skip-unit-test-in-packaging.patch b/0001-Skip-unit-test-in-packaging.patch new file mode 100644 index 0000000..5f03e5c --- /dev/null +++ b/0001-Skip-unit-test-in-packaging.patch @@ -0,0 +1,25 @@ +From 5bf37e237694ac7bf028f9129561d1265fd95621 Mon Sep 17 00:00:00 2001 +From: Alfredo Moralejo +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 + diff --git a/python-jsonpatch.spec b/python-jsonpatch.spec index cd2ff27..0f56872 100644 --- a/python-jsonpatch.spec +++ b/python-jsonpatch.spec @@ -4,18 +4,16 @@ %endif Name: python-%{pypi_name} -Version: 1.14 -Release: 5%{?dist} +Version: 1.21 +Release: 1%{?dist} Summary: Applying JSON Patches in Python License: BSD 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 -# Fix python 3 tests -# From upstream commit: https://github.com/stefankoegl/python-json-patch/commit/d6e9a0047bad780b53151f572ea257f1cb6ebe41 -Patch0: use-inspect.signature-on-Python-3.patch +# tarball from pypi does not include file tests.js required for a specific test. +# upstream issue https://github.com/stefankoegl/python-json-patch/issues/82 +Patch0: 0001-Skip-unit-test-in-packaging.patch 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 BuildRequires: python2-devel -BuildRequires: python-setuptools -BuildRequires: python-jsonpointer -Requires: python-jsonpointer +BuildRequires: python2-setuptools +BuildRequires: python2-jsonpointer +Requires: python2-jsonpointer %{?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} %patch0 -p1 + %build %py2_build @@ -114,6 +113,9 @@ done; %endif %changelog +* Tue Feb 6 2018 Alfredo Moralejo - 1.21-1 +- Update to 1.21 + * Fri Sep 29 2017 Troy Dawson - 1.14-5 - Cleanup spec file conditionals diff --git a/sources b/sources index e1d188f..542368e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -cf4fbad8188f1389363433dbf867109f jsonpatch-1.14.tar.gz +SHA512 (jsonpatch-1.21.tar.gz) = dc902b750241833a68612430f07007080ed56dce8a7a4bdd1c042f944cd6cfdc03f4b422cc6bed6bc3b21ea390c5a281cd08181e27d6b57fc5fb657787c1d740 diff --git a/use-inspect.signature-on-Python-3.patch b/use-inspect.signature-on-Python-3.patch deleted file mode 100644 index 48df694..0000000 --- a/use-inspect.signature-on-Python-3.patch +++ /dev/null @@ -1,29 +0,0 @@ -From d6e9a0047bad780b53151f572ea257f1cb6ebe41 Mon Sep 17 00:00:00 2001 -From: Victor Stinner -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)