diff --git a/jsondiff-1.2.0.tar.gz b/jsondiff-1.2.0.tar.gz deleted file mode 100644 index 515632c..0000000 --- a/jsondiff-1.2.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:34941bc431d10aa15828afe1cbb644977a114e75eef6cc74fb58951312326303 -size 7985 diff --git a/jsondiff-1.3.0.tar.gz b/jsondiff-1.3.0.tar.gz new file mode 100644 index 0000000..13d2d09 --- /dev/null +++ b/jsondiff-1.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a899ebc34cad04561651a8b618df44004b5dbe35fadb83addd7f912faf4a43fb +size 15283 diff --git a/python-jsondiff.changes b/python-jsondiff.changes index 981c9b0..67b549b 100644 --- a/python-jsondiff.changes +++ b/python-jsondiff.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Tue Dec 7 09:32:07 UTC 2021 - John Paul Adrian Glaubitz + +- Update to version 1.3.0 + * Update README.rst + * Add license to setup.py + * Upating travis config to explicitly set ubuntu versions to use + for each python version. + * Fix long list diffing bug by converting recursive code to iterative. + * Add failing test for list-diff recursion error bug +- Refresh patches for new version + * remove_nose.patch +- Switch Source field to point to Github tarball URL + * The tarball from PyPi does not contain the tests + ------------------------------------------------------------------- Sun Sep 13 17:39:27 UTC 2020 - Matej Cepl diff --git a/python-jsondiff.spec b/python-jsondiff.spec index f269894..63d4922 100644 --- a/python-jsondiff.spec +++ b/python-jsondiff.spec @@ -1,7 +1,7 @@ # # spec file for package python-jsondiff # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,12 +18,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-jsondiff -Version: 1.2.0 +Version: 1.3.0 Release: 0 Summary: Module to diff JSON and JSON-like structures in Python License: MIT URL: https://github.com/ZoomerAnalytics/jsondiff -Source: https://files.pythonhosted.org/packages/source/j/jsondiff/jsondiff-%{version}.tar.gz +Source: https://github.com/ZoomerAnalytics/jsondiff/archive/%{version}.tar.gz#/jsondiff-%{version}.tar.gz # PATCH-FEATURE-UPSTREAM remove_nose.patch bsc#[0-9]+ mcepl@suse.com # Replace nose-random plugin with ripped of version independent of nose. Patch0: remove_nose.patch @@ -33,7 +33,7 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives BuildArch: noarch %python_subpackages diff --git a/remove_nose.patch b/remove_nose.patch index 66bbdbd..09971fd 100644 --- a/remove_nose.patch +++ b/remove_nose.patch @@ -1,44 +1,10 @@ ---- /dev/null -+++ b/tests/_random.py -@@ -0,0 +1,33 @@ -+import sys -+from random import Random -+ -+PY3 = (sys.version_info[0] == 3) -+ -+ -+def _generate_tag(n, rng): -+ return ''.join(rng.choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') -+ for _ in range(n)) -+ -+ -+def randomize(n, scenario_generator, seed=12038728732): -+ def decorator(test): -+ def randomized_test(self): -+ rng_seed = Random(seed) -+ nseeds = n -+ # (rng_seed.getrandbits(32) for i in range(n)) -+ seeds = (_generate_tag(12, rng_seed) for i in range(n)) -+ for i, rseed in enumerate(seeds): -+ rng = Random(rseed) -+ scenario = scenario_generator(self, rng) -+ try: -+ test(self, scenario) -+ except Exception as e: -+ import sys -+ if PY3: -+ raise type(e).with_traceback(type(e)('%s with scenario %s (%i of %i)' % -+ (e.message, rseed, i+1, nseeds)), sys.exc_info()[2]) -+ else: -+ raise (type(e), type(e)('%s with scenario %s (%i of %i)' -+ % (e.message, rseed, i+1, nseeds)), sys.exc_info()[2]) -+ return randomized_test -+ return decorator ---- a/tests/__init__.py -+++ b/tests/__init__.py -@@ -1,115 +0,0 @@ +diff -Nru jsondiff-1.3.0.orig/tests/__init__.py jsondiff-1.3.0/tests/__init__.py +--- jsondiff-1.3.0.orig/tests/__init__.py 2021-04-19 21:51:14.000000000 +0200 ++++ jsondiff-1.3.0/tests/__init__.py 2021-12-07 10:25:30.252455974 +0100 +@@ -1,130 +1,15 @@ + import sys -import unittest -- + -from jsondiff import diff, replace, add, discard, insert, delete, update, JsonDiffer - -from .utils import generate_random_json, perturbate_json @@ -152,8 +118,73 @@ - self.assertEqual(a, differ.unpatch(b, d)) - dm = differ.marshal(d) - self.assertEqual(d, differ.unmarshal(dm)) ---- /dev/null -+++ b/tests/test_jsondiff.py +- +- def test_long_arrays(self): +- size = 100 +- a = [{'a': i, 'b': 2 * i} for i in range(1, size)] +- b = [{'a': i, 'b': 3 * i} for i in range(1, size)] +- r = sys.getrecursionlimit() +- sys.setrecursionlimit(size - 1) +- +- try: +- diff(a, b) +- except RecursionError: +- self.fail('cannot diff long arrays') +- finally: +- sys.setrecursionlimit(r) ++def test_long_arrays(self): ++ size = 100 ++ a = [{'a': i, 'b': 2 * i} for i in range(1, size)] ++ b = [{'a': i, 'b': 3 * i} for i in range(1, size)] ++ r = sys.getrecursionlimit() ++ sys.setrecursionlimit(size - 1) ++ ++ try: ++ diff(a, b) ++ except RecursionError: ++ self.fail('cannot diff long arrays') ++ finally: ++ sys.setrecursionlimit(r) +diff -Nru jsondiff-1.3.0.orig/tests/_random.py jsondiff-1.3.0/tests/_random.py +--- jsondiff-1.3.0.orig/tests/_random.py 1970-01-01 01:00:00.000000000 +0100 ++++ jsondiff-1.3.0/tests/_random.py 2021-12-07 10:21:59.457195559 +0100 +@@ -0,0 +1,33 @@ ++import sys ++from random import Random ++ ++PY3 = (sys.version_info[0] == 3) ++ ++ ++def _generate_tag(n, rng): ++ return ''.join(rng.choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') ++ for _ in range(n)) ++ ++ ++def randomize(n, scenario_generator, seed=12038728732): ++ def decorator(test): ++ def randomized_test(self): ++ rng_seed = Random(seed) ++ nseeds = n ++ # (rng_seed.getrandbits(32) for i in range(n)) ++ seeds = (_generate_tag(12, rng_seed) for i in range(n)) ++ for i, rseed in enumerate(seeds): ++ rng = Random(rseed) ++ scenario = scenario_generator(self, rng) ++ try: ++ test(self, scenario) ++ except Exception as e: ++ import sys ++ if PY3: ++ raise type(e).with_traceback(type(e)('%s with scenario %s (%i of %i)' % ++ (e.message, rseed, i+1, nseeds)), sys.exc_info()[2]) ++ else: ++ raise (type(e), type(e)('%s with scenario %s (%i of %i)' ++ % (e.message, rseed, i+1, nseeds)), sys.exc_info()[2]) ++ return randomized_test ++ return decorator +diff -Nru jsondiff-1.3.0.orig/tests/test_jsondiff.py jsondiff-1.3.0/tests/test_jsondiff.py +--- jsondiff-1.3.0.orig/tests/test_jsondiff.py 1970-01-01 01:00:00.000000000 +0100 ++++ jsondiff-1.3.0/tests/test_jsondiff.py 2021-12-07 10:21:59.457195559 +0100 @@ -0,0 +1,112 @@ +import unittest +