Hello community,
here is the log from the commit of package python-python-box for openSUSE:Factory checked in at 2019-09-11 10:36:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-box (Old)
and /work/SRC/openSUSE:Factory/.python-python-box.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-box"
Wed Sep 11 10:36:25 2019 rev:3 rq:729831 version:3.4.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-python-box/python-python-box.changes 2019-07-22 17:20:22.593894701 +0200
+++ /work/SRC/openSUSE:Factory/.python-python-box.new.7948/python-python-box.changes 2019-09-11 10:36:28.351277426 +0200
@@ -1,0 +2,9 @@
+Tue Sep 10 11:31:49 UTC 2019 - Tomáš Chvátal
+
+- Update to 3.4.3:
+ * Fixing propagation of box options when adding a new list via setdefault (thanks to Stretch)
+ * Fixing update does not keep box_intact_types (thanks to pwwang)
+ * Fixing update to operate the same way as a normal dictionary (thanks to Craig Quiter)
+ * Fixing deepcopy not copying box options (thanks to Nikolay Stanishev)
+
+-------------------------------------------------------------------
Old:
----
python-box-3.4.2.tar.gz
New:
----
python-box-3.4.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-box.spec ++++++
--- /var/tmp/diff_new_pack.4JqNqD/_old 2019-09-11 10:36:28.923277259 +0200
+++ /var/tmp/diff_new_pack.4JqNqD/_new 2019-09-11 10:36:28.927277258 +0200
@@ -18,16 +18,14 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-python-box
-Version: 3.4.2
+Version: 3.4.3
Release: 0
Summary: Advanced Python dictionaries with dot notation access
License: MIT
Group: Development/Languages/Python
URL: https://github.com/cdgriffith/Box
Source: https://files.pythonhosted.org/packages/source/p/python-box/python-box-%{version}.tar.gz
-BuildRequires: %{python_module devel}
BuildRequires: %{python_module pytest-runner}
-BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -48,6 +46,7 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
+# upstream does not distribute the data nor provides all tags
#%%pytest
%files %{python_files}
++++++ python-box-3.4.2.tar.gz -> python-box-3.4.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-box-3.4.2/AUTHORS.rst new/python-box-3.4.3/AUTHORS.rst
--- old/python-box-3.4.2/AUTHORS.rst 2019-06-06 17:42:05.000000000 +0200
+++ new/python-box-3.4.3/AUTHORS.rst 2019-08-19 17:47:33.000000000 +0200
@@ -14,6 +14,7 @@
- Martijn Pieters (mjpieters)
- (sdementen)
- Brandon Gomes (bhgomes)
+- Stretch (str3tch)
Suggestions and bug reporting:
@@ -41,3 +42,5 @@
- (ipcoder)
- (cebaa)
- (deluxghost)
+- Nikolay Stanishev (nikolaystanishev)
+- Craig Quiter (crizCraig)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-box-3.4.2/CHANGES.rst new/python-box-3.4.3/CHANGES.rst
--- old/python-box-3.4.2/CHANGES.rst 2019-07-05 16:46:59.000000000 +0200
+++ new/python-box-3.4.3/CHANGES.rst 2019-08-19 17:47:16.000000000 +0200
@@ -1,6 +1,14 @@
Changelog
---------
+Version 3.4.3
+~~~~~~~~~~~~~
+
+* Fixing propagation of box options when adding a new list via setdefault (thanks to Stretch)
+* Fixing update does not keep box_intact_types (thanks to pwwang)
+* Fixing update to operate the same way as a normal dictionary (thanks to Craig Quiter)
+* Fixing deepcopy not copying box options (thanks to Nikolay Stanishev)
+
Version 3.4.2
~~~~~~~~~~~~~
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-box-3.4.2/PKG-INFO new/python-box-3.4.3/PKG-INFO
--- old/python-box-3.4.2/PKG-INFO 2019-07-05 17:25:17.000000000 +0200
+++ new/python-box-3.4.3/PKG-INFO 2019-08-19 22:14:14.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: python-box
-Version: 3.4.2
+Version: 3.4.3
Summary: Advanced Python dictionaries with dot notation access
Home-page: https://github.com/cdgriffith/Box
Author: Chris Griffith
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-box-3.4.2/box.py new/python-box-3.4.3/box.py
--- old/python-box-3.4.2/box.py 2019-07-05 16:46:59.000000000 +0200
+++ new/python-box-3.4.3/box.py 2019-08-19 17:45:46.000000000 +0200
@@ -45,7 +45,7 @@
__all__ = ['Box', 'ConfigBox', 'BoxList', 'SBox',
'BoxError', 'BoxKeyError']
__author__ = 'Chris Griffith'
-__version__ = '3.4.2'
+__version__ = '3.4.3'
BOX_PARAMETERS = ('default_box', 'default_box_attr', 'conversion_box',
'frozen_box', 'camel_killer_box', 'box_it_up',
@@ -408,7 +408,7 @@
return Box(super(Box, self).copy())
def __deepcopy__(self, memodict=None):
- out = self.__class__()
+ out = self.__class__(**self.__box_config())
memodict = memodict or {}
memodict[id(self)] = out
for k, v in self.items():
@@ -643,33 +643,26 @@
out_dict[k] = v.to_list()
return out_dict
- def update(self, item=None, **kwargs):
- if not item:
- item = kwargs
- iter_over = item.items() if hasattr(item, 'items') else item
- for k, v in iter_over:
- if isinstance(v, dict):
- # Box objects must be created in case they are already
- # in the `converted` box_config set
- v = self.__class__(v)
- if k in self and isinstance(self[k], dict):
- self[k].update(v)
- continue
- if isinstance(v, list):
- v = BoxList(v)
- try:
- self.__setattr__(k, v)
- except (AttributeError, TypeError):
- self.__setitem__(k, v)
+ def update(self, E=None, **F):
+ if E:
+ if hasattr(E, 'keys'):
+ for k in E:
+ self[k] = self.__convert_and_store(k, E[k])
+ else:
+ for k, v in E:
+ self[k] = self.__convert_and_store(k, v)
+ for k in F:
+ self[k] = self.__convert_and_store(k, F[k])
def setdefault(self, item, default=None):
if item in self:
return self[item]
if isinstance(default, dict):
- default = self.__class__(default)
+ default = self.__class__(default, **self.__box_config())
if isinstance(default, list):
- default = BoxList(default)
+ default = BoxList(default,
+ box_class=self.__class__, **self.__box_config())
self[item] = default
return default
@@ -842,7 +835,7 @@
**self.box_options)
def __deepcopy__(self, memodict=None):
- out = self.__class__()
+ out = self.__class__(**self.box_options)
memodict = memodict or {}
memodict[id(self)] = out
for k in self:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-box-3.4.2/python_box.egg-info/PKG-INFO new/python-box-3.4.3/python_box.egg-info/PKG-INFO
--- old/python-box-3.4.2/python_box.egg-info/PKG-INFO 2019-07-05 17:25:17.000000000 +0200
+++ new/python-box-3.4.3/python_box.egg-info/PKG-INFO 2019-08-19 22:14:14.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: python-box
-Version: 3.4.2
+Version: 3.4.3
Summary: Advanced Python dictionaries with dot notation access
Home-page: https://github.com/cdgriffith/Box
Author: Chris Griffith
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-box-3.4.2/test/test_functional_box.py new/python-box-3.4.3/test/test_functional_box.py
--- old/python-box-3.4.2/test/test_functional_box.py 2019-07-05 17:18:06.000000000 +0200
+++ new/python-box-3.4.3/test/test_functional_box.py 2019-08-19 17:42:01.000000000 +0200
@@ -13,7 +13,7 @@
from .common import *
-class TestBoxFunctional:
+class TestBoxFunctional(unittest.TestCase):
@pytest.fixture(autouse=True)
def temp_dir_cleanup(self):
@@ -210,21 +210,31 @@
def test_update(self):
a = Box(test_dict)
+ a.grand = 1000
a.update({'key1': {'new': 5}, 'Key 2': {"add_key": 6},
'lister': ['a']})
a.update([('asdf', 'fdsa')])
a.update(testkey=66)
a.update({'items': 'test'})
+ assert a.grand == 1000
+ assert a['grand'] == 1000
assert a['items'] == 'test'
assert a.key1.new == 5
assert a['Key 2'].add_key == 6
- assert "Key5" in a['Key 2'].Key4
assert isinstance(a.key1, Box)
assert isinstance(a.lister, BoxList)
assert a.asdf == 'fdsa'
assert a.testkey == 66
+ c = Box(box_intact_types=[list])
+ c.a = [1, 2]
+ c.update({'b': [3, 4]})
+
+ assert c.a == [1, 2]
+ assert isinstance(c.b, list)
+ assert not isinstance(c.b, BoxList)
+
def test_auto_attr(self):
a = Box(test_dict, default_box=True)
assert a.a.a.a.a == Box()
@@ -243,6 +253,31 @@
assert a.key3.item == 2
assert a.lister[0].gah == 7
+ # default_box propagates after a setdefault and list object
+ a = Box(default_box=True)
+ a.b.c.setdefault('d', [])
+ a.b.c.d.append({})
+ a.b.c.d[0].e.f = 1
+
+ assert a.b.c.d[0].e.f == 1
+
+ # without default_box we would get an error
+ a = Box()
+ a.setdefault('b', [])
+ a.b.append({})
+ with self.assertRaises(BoxKeyError):
+ a.b[0].c.d = 1
+
+ a = Box()
+ a.setdefault('b', {})
+ with self.assertRaises(BoxKeyError):
+ a.b.c.d = 1
+
+ a = Box(default_box=True)
+ a.setdefault('b', {})
+ a.b.c.d.e.f = 1
+ assert a.b.c.d.e.f == 1
+
def test_from_json_file(self):
bx = Box.from_json(filename=data_json_file)
assert isinstance(bx, Box)
@@ -549,13 +584,15 @@
my_box['^a'] = 3
def test_copy(self):
- my_box = Box(movie_data)
+ my_box = Box(movie_data, camel_killer_box=True)
+ my_box.aB = 1
bb = my_box.copy()
assert my_box == bb
assert isinstance(bb, Box)
aa = copy.deepcopy(my_box)
assert my_box == aa
+ assert my_box.a_b == 1
assert isinstance(aa, Box)
cc = my_box.__copy__()