Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-jsondiff for openSUSE:Factory 
checked in at 2022-05-24 20:33:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jsondiff (Old)
 and      /work/SRC/openSUSE:Factory/.python-jsondiff.new.2254 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-jsondiff"

Tue May 24 20:33:35 2022 rev:8 rq:978978 version:2.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jsondiff/python-jsondiff.changes  
2021-12-08 00:00:37.687559594 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-jsondiff.new.2254/python-jsondiff.changes    
    2022-05-24 20:33:35.751038756 +0200
@@ -1,0 +2,12 @@
+Tue May 24 13:11:04 UTC 2022 - John Paul Adrian Glaubitz 
<adrian.glaub...@suse.com>
+
+- Update to version 2.0.0
+  * Removed deprecated function
+  * Remove deprecated jsondiff entry point
+- from version 1.3.1
+  * Optionally allow different escape_str than '$'
+  * Clarified the readme, closes #23
+  * Fixed readme
+- Remove jsondiff command from %install, %post, %postun and %files sections
+
+-------------------------------------------------------------------

Old:
----
  jsondiff-1.3.0.tar.gz

New:
----
  jsondiff-2.0.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-jsondiff.spec ++++++
--- /var/tmp/diff_new_pack.PcdkLW/_old  2022-05-24 20:33:36.303039249 +0200
+++ /var/tmp/diff_new_pack.PcdkLW/_new  2022-05-24 20:33:36.307039253 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-jsondiff
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-jsondiff
-Version:        1.3.0
+Version:        2.0.0
 Release:        0
 Summary:        Module to diff JSON and JSON-like structures in Python
 License:        MIT
@@ -48,7 +48,6 @@
 
 %install
 %python_install
-%python_clone -a %{buildroot}%{_bindir}/jsondiff
 %python_clone -a %{buildroot}%{_bindir}/jdiff
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
@@ -56,11 +55,9 @@
 %pytest tests/__init__.py
 
 %post
-%python_install_alternative jsondiff
 %python_install_alternative jdiff
 
 %postun
-%python_uninstall_alternative jsondiff
 %python_uninstall_alternative jdiff
 
 %files %{python_files}
@@ -68,6 +65,5 @@
 %doc README.rst
 %{python_sitelib}/*
 %python_alternative %{_bindir}/jdiff
-%python_alternative %{_bindir}/jsondiff
 
 %changelog

++++++ jsondiff-1.3.0.tar.gz -> jsondiff-2.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsondiff-1.3.0/README.rst 
new/jsondiff-2.0.0/README.rst
--- old/jsondiff-1.3.0/README.rst       2021-04-19 21:51:14.000000000 +0200
+++ new/jsondiff-2.0.0/README.rst       2022-04-10 17:10:11.000000000 +0200
@@ -13,6 +13,7 @@
 
 .. code-block:: python
 
+    >>> import jsondiff as jd
     >>> from jsondiff import diff
 
     >>> diff({'a': 1, 'b': 2}, {'b': 3, 'c': 4})
@@ -47,13 +48,24 @@
     >>> print diff('["a", "b", "c"]', '["a", "c", "d"]', load=True, dump=True)
     {"$delete": [1], "$insert": [[2, "d"]]}
 
+    # NOTE: Default keys in the result are objects, not strings!
+    >>> d = diff({'a': 1, 'delete': 2}, {'b': 3, 'delete': 4})
+    >>> d
+    {'delete': 4, 'b': 3, delete: ['a']}
+    >>> d[jd.delete]
+    ['a']
+    >>> d['delete']
+    4
+    # Alternatively, you can use marshal=True to get back strings with a 
leading $
+    >>> diff({'a': 1, 'delete': 2}, {'b': 3, 'delete': 4}, marshal=True)
+    {'delete': 4, 'b': 3, '$delete': ['a']}
 
 Command Line Client
 -------------------
 
 Usage::
 
-    jsondiff [-h] [-p] [-s SYNTAX] [-i INDENT] first second
+    jdiff [-h] [-p] [-s SYNTAX] [-i INDENT] first second
 
     positional arguments:
       first
@@ -69,6 +81,6 @@
 
 .. code-block:: bash
 
-    $ jsondiff a.json b.json -i 2
+    $ jdiff a.json b.json -i 2
 
-    $ jsondiff a.json b.json -i 2 -s symmetric
+    $ jdiff a.json b.json -i 2 -s symmetric
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsondiff-1.3.0/jsondiff/__init__.py 
new/jsondiff-2.0.0/jsondiff/__init__.py
--- old/jsondiff-1.3.0/jsondiff/__init__.py     2021-04-19 21:51:14.000000000 
+0200
+++ new/jsondiff-2.0.0/jsondiff/__init__.py     2022-04-10 17:10:11.000000000 
+0200
@@ -1,4 +1,4 @@
-__version__ = '1.3.0'
+__version__ = '2.0.0'
 
 import sys
 import json
@@ -7,7 +7,7 @@
 from .symbols import Symbol
 
 # rules
-# - keys and strings which start with $ are escaped to $$
+# - keys and strings which start with $ (or specified escape_str) are escaped 
to $$ (or escape_str * 2)
 # - when source is dict and diff is a dict -> patch
 # - when source is list and diff is a list patch dict -> patch
 # - else -> replacement
@@ -354,7 +354,8 @@
     class Options(object):
         pass
 
-    def __init__(self, syntax='compact', load=False, dump=False, 
marshal=False, loader=default_loader, dumper=default_dumper):
+    def __init__(self, syntax='compact', load=False, dump=False, marshal=False,
+                 loader=default_loader, dumper=default_dumper, escape_str='$'):
         self.options = JsonDiffer.Options()
         self.options.syntax = builtin_syntaxes.get(syntax, syntax)
         self.options.load = load
@@ -362,8 +363,9 @@
         self.options.marshal = marshal
         self.options.loader = loader
         self.options.dumper = dumper
+        self.options.escape_str = escape_str
         self._symbol_map = {
-            '$' + symbol.label: symbol
+            escape_str + symbol.label: symbol
             for symbol in _all_symbols_
         }
 
@@ -555,7 +557,7 @@
             sym = self._symbol_map.get(x, None)
             if sym is not None:
                 return sym
-            if x.startswith('$'):
+            if x.startswith(self.options.escape_str):
                 return x[1:]
         return x
 
@@ -575,9 +577,9 @@
 
     def _escape(self, o):
         if type(o) is Symbol:
-            return "$" + o.label
-        if isinstance(o, string_types) and o.startswith('$'):
-            return "$" + o
+            return self.options.escape_str + o.label
+        if isinstance(o, string_types) and 
o.startswith(self.options.escape_str):
+            return self.options.escape_str + o
         return o
 
     def marshal(self, d):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsondiff-1.3.0/jsondiff/cli.py 
new/jsondiff-2.0.0/jsondiff/cli.py
--- old/jsondiff-1.3.0/jsondiff/cli.py  2021-04-19 21:51:14.000000000 +0200
+++ new/jsondiff-2.0.0/jsondiff/cli.py  2022-04-10 17:10:11.000000000 +0200
@@ -36,9 +36,6 @@
 
             json.dump(x, sys.stdout, indent=args.indent)
 
-def main_deprecated():
-    warnings.warn("jsondiff is deprecated. Use jdiff instead.", 
DeprecationWarning)
-    main()
 
 if __name__ == '__main__':
     main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsondiff-1.3.0/setup.py new/jsondiff-2.0.0/setup.py
--- old/jsondiff-1.3.0/setup.py 2021-04-19 21:51:14.000000000 +0200
+++ new/jsondiff-2.0.0/setup.py 2022-04-10 17:10:11.000000000 +0200
@@ -22,7 +22,6 @@
     ],
     entry_points={
         'console_scripts': [
-            'jsondiff=jsondiff.cli:main_deprecated',
             'jdiff=jsondiff.cli:main'
         ]
     }

Reply via email to