Hello community,

here is the log from the commit of package python3-pyrsistent for 
openSUSE:Factory checked in at 2017-02-26 17:09:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-pyrsistent (Old)
 and      /work/SRC/openSUSE:Factory/.python3-pyrsistent.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-pyrsistent"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-pyrsistent/python3-pyrsistent.changes    
2016-06-02 09:36:12.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.python3-pyrsistent.new/python3-pyrsistent.changes   
    2017-02-26 17:09:03.281731608 +0100
@@ -1,0 +2,14 @@
+Wed Feb 22 22:04:57 UTC 2017 - [email protected]
+
+- specfile:
+  * update copyright year
+
+- update to version 0.12.0:
+  * Fix #87, add function get_in() for access to elements in deeply
+    nested structures.
+  * Fix #91, add method update() to pset and pbag.
+  * Fix #92, incorrect discard of elements in transform on pvector
+  * This is a release candidate for 1.0 as I now consider pyrsistent
+    fairly stable.
+
+-------------------------------------------------------------------
@@ -11 +24,0 @@
-

Old:
----
  pyrsistent-0.11.13.tar.gz

New:
----
  pyrsistent-0.12.0.tar.gz

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

Other differences:
------------------
++++++ python3-pyrsistent.spec ++++++
--- /var/tmp/diff_new_pack.NREtdG/_old  2017-02-26 17:09:03.589684871 +0100
+++ /var/tmp/diff_new_pack.NREtdG/_new  2017-02-26 17:09:03.593684264 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python3-pyrsistent
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           python3-pyrsistent
-Version:        0.11.13
+Version:        0.12.0
 Release:        0
 Summary:        Persistent/Functional/Immutable data structures
 License:        MIT

++++++ pyrsistent-0.11.13.tar.gz -> pyrsistent-0.12.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/CHANGES.txt 
new/pyrsistent-0.12.0/CHANGES.txt
--- old/pyrsistent-0.11.13/CHANGES.txt  2016-04-03 09:02:32.000000000 +0200
+++ new/pyrsistent-0.12.0/CHANGES.txt   2017-01-06 18:51:48.000000000 +0100
@@ -1,5 +1,11 @@
 Revision history
 ----------------
+v0.12.0, 2017-01-06
+ * Fix #87, add function get_in() for access to elements in deeply nested 
structures.
+ * Fix #91, add method update() to pset and pbag.
+ * Fix #92, incorrect discard of elements in transform on pvector
+ * This is a release candidate for 1.0 as I now consider pyrsistent fairly 
stable.
+
 v0.11.13, 2016-04-03
  * Fix #84, pvector segfault in CPython 3 when repr of contained object raises 
Exception.
  * Update README to cover for issue described in #83.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/LICENCE.mit 
new/pyrsistent-0.12.0/LICENCE.mit
--- old/pyrsistent-0.11.13/LICENCE.mit  2016-01-31 15:28:25.000000000 +0100
+++ new/pyrsistent-0.12.0/LICENCE.mit   2017-01-06 18:46:49.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright (c) 2016 Tobias Gustafsson
+Copyright (c) 2017 Tobias Gustafsson
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/PKG-INFO 
new/pyrsistent-0.12.0/PKG-INFO
--- old/pyrsistent-0.11.13/PKG-INFO     2016-04-03 09:03:47.000000000 +0200
+++ new/pyrsistent-0.12.0/PKG-INFO      2017-01-06 19:20:19.000000000 +0100
@@ -1,11 +1,11 @@
 Metadata-Version: 1.1
 Name: pyrsistent
-Version: 0.11.13
+Version: 0.12.0
 Summary: Persistent/Functional/Immutable data structures
 Home-page: http://github.com/tobgu/pyrsistent/
 Author: Tobias Gustafsson
 Author-email: [email protected]
-License: LICENSE.mit
+License: MIT
 Description: Pyrsistent
         ==========
         .. image:: https://travis-ci.org/tobgu/pyrsistent.png?branch=master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/_pyrsistent_version.py 
new/pyrsistent-0.12.0/_pyrsistent_version.py
--- old/pyrsistent-0.11.13/_pyrsistent_version.py       2016-04-03 
09:00:06.000000000 +0200
+++ new/pyrsistent-0.12.0/_pyrsistent_version.py        2017-01-06 
18:52:29.000000000 +0100
@@ -1 +1 @@
-__version__ = '0.11.13'
+__version__ = '0.12.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/pyrsistent/__init__.py 
new/pyrsistent-0.12.0/pyrsistent/__init__.py
--- old/pyrsistent-0.11.13/pyrsistent/__init__.py       2015-09-29 
19:34:56.000000000 +0200
+++ new/pyrsistent-0.12.0/pyrsistent/__init__.py        2017-01-06 
18:39:17.000000000 +0100
@@ -29,6 +29,8 @@
 
 from pyrsistent._transformations import inc, discard, rex, ny
 
+from pyrsistent._toolz import get_in
+
 
 __all__ = ('pmap', 'm', 'PMap',
            'pvector', 'v', 'PVector',
@@ -41,4 +43,5 @@
            'PClass', 'PClassMeta',
            'immutable',
            'freeze', 'thaw', 'mutant',
+           'get_in',
            'inc', 'discard', 'rex', 'ny')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/pyrsistent/_pbag.py 
new/pyrsistent-0.12.0/pyrsistent/_pbag.py
--- old/pyrsistent-0.11.13/pyrsistent/_pbag.py  2015-09-30 20:51:54.000000000 
+0200
+++ new/pyrsistent-0.12.0/pyrsistent/_pbag.py   2017-01-06 18:15:04.000000000 
+0100
@@ -49,6 +49,19 @@
         """
         return PBag(_add_to_counters(self._counts, element))
 
+    def update(self, iterable):
+        """
+        Update bag with all elements in iterable.
+
+        >>> s = pbag([1])
+        >>> s.update([1, 2])
+        pbag([1, 1, 2])
+        """
+        if iterable:
+            return PBag(reduce(_add_to_counters, iterable, self._counts))
+
+        return self
+
     def remove(self, element):
         """
         Remove an element from the bag.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/pyrsistent/_pset.py 
new/pyrsistent-0.12.0/pyrsistent/_pset.py
--- old/pyrsistent-0.11.13/pyrsistent/_pset.py  2015-09-28 20:44:16.000000000 
+0200
+++ new/pyrsistent-0.12.0/pyrsistent/_pset.py   2017-01-06 18:04:25.000000000 
+0100
@@ -73,6 +73,20 @@
         """
         return self.evolver().add(element).persistent()
 
+    def update(self, iterable):
+        """
+        Return a new PSet with elements in iterable added
+
+        >>> s1 = s(1, 2)
+        >>> s1.update([3, 4, 4])
+        pset([1, 2, 3, 4])
+        """
+        e = self.evolver()
+        for element in iterable:
+            e.add(element)
+
+        return e.persistent()
+
     def remove(self, element):
         """
         Return a new PSet with element removed. Raises KeyError if element is 
not present.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/pyrsistent/_toolz.py 
new/pyrsistent-0.12.0/pyrsistent/_toolz.py
--- old/pyrsistent-0.11.13/pyrsistent/_toolz.py 1970-01-01 01:00:00.000000000 
+0100
+++ new/pyrsistent-0.12.0/pyrsistent/_toolz.py  2017-01-06 19:04:04.000000000 
+0100
@@ -0,0 +1,83 @@
+"""
+Functionality copied from the toolz package to avoid having
+to add toolz as a dependency.
+
+See https://github.com/pytoolz/toolz/.
+
+toolz is relased under BSD licence. Below is the licence text
+from toolz as it appeared when copying the code.
+
+--------------------------------------------------------------
+
+Copyright (c) 2013 Matthew Rocklin
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+  a. Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+  b. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+  c. Neither the name of toolz nor the names of its contributors
+     may be used to endorse or promote products derived from this software
+     without specific prior written permission.
+
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+"""
+import operator
+from six.moves import reduce
+
+
+def get_in(keys, coll, default=None, no_default=False):
+    """
+    NB: This is a straight copy of the get_in implementation found in
+        the toolz library (https://github.com/pytoolz/toolz/). It works
+        with persistent data structures as well as the corresponding
+        datastructures from the stdlib.
+
+    Returns coll[i0][i1]...[iX] where [i0, i1, ..., iX]==keys.
+
+    If coll[i0][i1]...[iX] cannot be found, returns ``default``, unless
+    ``no_default`` is specified, then it raises KeyError or IndexError.
+
+    ``get_in`` is a generalization of ``operator.getitem`` for nested data
+    structures such as dictionaries and lists.
+    >>> from pyrsistent import freeze
+    >>> transaction = freeze({'name': 'Alice',
+    ...                       'purchase': {'items': ['Apple', 'Orange'],
+    ...                                    'costs': [0.50, 1.25]},
+    ...                       'credit card': '5555-1234-1234-1234'})
+    >>> get_in(['purchase', 'items', 0], transaction)
+    'Apple'
+    >>> get_in(['name'], transaction)
+    'Alice'
+    >>> get_in(['purchase', 'total'], transaction)
+    >>> get_in(['purchase', 'items', 'apple'], transaction)
+    >>> get_in(['purchase', 'items', 10], transaction)
+    >>> get_in(['purchase', 'total'], transaction, 0)
+    0
+    >>> get_in(['y'], {}, no_default=True)
+    Traceback (most recent call last):
+        ...
+    KeyError: 'y'
+    """
+    try:
+        return reduce(operator.getitem, keys, coll)
+    except (KeyError, IndexError, TypeError):
+        if no_default:
+            raise
+        return default
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/pyrsistent/_transformations.py 
new/pyrsistent-0.12.0/pyrsistent/_transformations.py
--- old/pyrsistent-0.11.13/pyrsistent/_transformations.py       2015-12-27 
21:07:11.000000000 +0100
+++ new/pyrsistent-0.12.0/pyrsistent/_transformations.py        2017-01-06 
17:48:28.000000000 +0100
@@ -81,11 +81,14 @@
 
 def _update_structure(structure, kvs, path, command):
     e = structure.evolver()
-    for k, v in kvs:
-        if not path and command is discard:
+    if not path and command is discard:
+        # Do this in reverse to avoid index problems with vectors. See #92.
+        for k, v in reversed(kvs):
             discard(e, k)
-        else:
+    else:
+        for k, v in kvs:
             result = _do_to_path(v, path, command)
             if result is not v:
                 e[k] = result
-    return e.persistent()
\ No newline at end of file
+
+    return e.persistent()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/pyrsistent.egg-info/PKG-INFO 
new/pyrsistent-0.12.0/pyrsistent.egg-info/PKG-INFO
--- old/pyrsistent-0.11.13/pyrsistent.egg-info/PKG-INFO 2016-04-03 
09:03:47.000000000 +0200
+++ new/pyrsistent-0.12.0/pyrsistent.egg-info/PKG-INFO  2017-01-06 
19:20:11.000000000 +0100
@@ -1,11 +1,11 @@
 Metadata-Version: 1.1
 Name: pyrsistent
-Version: 0.11.13
+Version: 0.12.0
 Summary: Persistent/Functional/Immutable data structures
 Home-page: http://github.com/tobgu/pyrsistent/
 Author: Tobias Gustafsson
 Author-email: [email protected]
-License: LICENSE.mit
+License: MIT
 Description: Pyrsistent
         ==========
         .. image:: https://travis-ci.org/tobgu/pyrsistent.png?branch=master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/pyrsistent.egg-info/SOURCES.txt 
new/pyrsistent-0.12.0/pyrsistent.egg-info/SOURCES.txt
--- old/pyrsistent-0.11.13/pyrsistent.egg-info/SOURCES.txt      2016-04-03 
09:03:47.000000000 +0200
+++ new/pyrsistent-0.12.0/pyrsistent.egg-info/SOURCES.txt       2017-01-06 
19:20:11.000000000 +0100
@@ -19,6 +19,7 @@
 pyrsistent/_precord.py
 pyrsistent/_pset.py
 pyrsistent/_pvector.py
+pyrsistent/_toolz.py
 pyrsistent/_transformations.py
 pyrsistent.egg-info/PKG-INFO
 pyrsistent.egg-info/SOURCES.txt
@@ -40,5 +41,6 @@
 tests/record_test.py
 tests/regression_test.py
 tests/set_test.py
+tests/toolz_test.py
 tests/transform_test.py
 tests/vector_test.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/setup.py 
new/pyrsistent-0.12.0/setup.py
--- old/pyrsistent-0.11.13/setup.py     2016-02-06 14:34:59.000000000 +0100
+++ new/pyrsistent-0.12.0/setup.py      2017-01-06 19:17:38.000000000 +0100
@@ -65,7 +65,7 @@
     author='Tobias Gustafsson',
     author_email='[email protected]',
     url='http://github.com/tobgu/pyrsistent/',
-    license='LICENSE.mit',
+    license='MIT',
     py_modules=['_pyrsistent_version'],
     classifiers=[
         'Intended Audience :: Developers',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/tests/bag_test.py 
new/pyrsistent-0.12.0/tests/bag_test.py
--- old/pyrsistent-0.11.13/tests/bag_test.py    2015-09-30 20:51:54.000000000 
+0200
+++ new/pyrsistent-0.12.0/tests/bag_test.py     2017-01-06 18:12:59.000000000 
+0100
@@ -131,3 +131,12 @@
 def test_supports_weakref():
     import weakref
     weakref.ref(b(1))
+
+
+def test_update():
+    assert pbag([1, 2, 2]).update([3, 3, 4]) == pbag([1, 2, 2, 3, 3, 4])
+
+
+def test_update_no_elements():
+    b = pbag([1, 2, 2])
+    assert b.update([]) is b
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/tests/set_test.py 
new/pyrsistent-0.12.0/tests/set_test.py
--- old/pyrsistent-0.11.13/tests/set_test.py    2015-09-28 20:43:42.000000000 
+0200
+++ new/pyrsistent-0.12.0/tests/set_test.py     2017-01-06 18:16:36.000000000 
+0100
@@ -158,4 +158,13 @@
 
 def test_supports_weakref():
     import weakref
-    weakref.ref(s(1))
\ No newline at end of file
+    weakref.ref(s(1))
+
+
+def test_update():
+    assert s(1, 2, 3).update([3, 4, 4, 5]) == s(1, 2, 3, 4, 5)
+
+
+def test_update_no_elements():
+    s1 = s(1, 2)
+    assert s1.update([]) is s1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/tests/toolz_test.py 
new/pyrsistent-0.12.0/tests/toolz_test.py
--- old/pyrsistent-0.11.13/tests/toolz_test.py  1970-01-01 01:00:00.000000000 
+0100
+++ new/pyrsistent-0.12.0/tests/toolz_test.py   2017-01-06 18:41:23.000000000 
+0100
@@ -0,0 +1,6 @@
+from pyrsistent import get_in, m, v
+
+
+def test_get_in():
+    # This is not an extensive test. The doctest covers that fairly good 
though.
+    get_in(m(a=v(1, 2, 3)), ['m', 1]) == 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrsistent-0.11.13/tests/transform_test.py 
new/pyrsistent-0.12.0/tests/transform_test.py
--- old/pyrsistent-0.11.13/tests/transform_test.py      2015-12-27 
21:09:42.000000000 +0100
+++ new/pyrsistent-0.12.0/tests/transform_test.py       2017-01-06 
17:42:34.000000000 +0100
@@ -80,3 +80,7 @@
 def test_no_transformation_returns_the_same_structure():
     v = freeze([{'foo': 1}, {'bar': 2}])
     assert v.transform([ny, ny], lambda x: x) is v
+
+
+def test_discard_multiple_elements_in_pvector():
+    assert freeze([0, 1, 2, 3, 4]).transform([lambda i: i % 2], discard) == 
freeze([0, 2, 4])


Reply via email to