Hello community,

here is the log from the commit of package python-marshmallow for 
openSUSE:Factory checked in at 2019-07-28 10:19:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-marshmallow (Old)
 and      /work/SRC/openSUSE:Factory/.python-marshmallow.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-marshmallow"

Sun Jul 28 10:19:43 2019 rev:7 rq:718109 version:2.19.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-marshmallow/python-marshmallow.changes    
2019-06-12 13:01:50.717293389 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-marshmallow.new.4126/python-marshmallow.changes
  2019-07-28 10:19:44.684601598 +0200
@@ -1,0 +2,8 @@
+Wed Jul 24 07:53:46 UTC 2019 - Tomáš Chvátal <tchva...@suse.com>
+
+- Update to 2.19.5:
+  * Fix deserializing ISO8601-formatted datetimes with less than 6-digit 
miroseconds (:issue:`1251`). Thanks :user:`diego-plan9` for reporting.
+  * Microseconds no longer gets lost when deserializing datetimes without 
dateutil installed (:issue:`1147`).
+  * Fix bug where nested fields in Meta.exclude would not work on multiple 
instantiations (:issue:`1212`). Thanks :user:`MHannila` for reporting.
+
+-------------------------------------------------------------------

Old:
----
  marshmallow-2.19.2.tar.gz

New:
----
  marshmallow-2.19.5.tar.gz

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

Other differences:
------------------
++++++ python-marshmallow.spec ++++++
--- /var/tmp/diff_new_pack.M7NV88/_old  2019-07-28 10:19:45.348601599 +0200
+++ /var/tmp/diff_new_pack.M7NV88/_new  2019-07-28 10:19:45.352601599 +0200
@@ -17,14 +17,13 @@
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%{!?license: %global license %doc}
 Name:           python-marshmallow
-Version:        2.19.2
+Version:        2.19.5
 Release:        0
 Summary:        ORM/ODM/framework-agnostic library to convert datatypes 
from/to Python types
 License:        MIT AND BSD-3-Clause
 Group:          Development/Languages/Python
-Url:            http://marshmallow.readthedocs.io/
+URL:            https://marshmallow.readthedocs.io/
 Source:         
https://files.pythonhosted.org/packages/source/m/marshmallow/marshmallow-%{version}.tar.gz
 # https://github.com/humitos/sphinx-version-warning/issues/22
 Patch0:         python-marshmallow-no-version-warning.patch
@@ -32,6 +31,10 @@
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+Suggests:       %{name}-docs
+Suggests:       python-python-dateutil
+Suggests:       python-simplejson
+BuildArch:      noarch
 # SECTION doc build requirements
 BuildRequires:  python3-Sphinx
 BuildRequires:  python3-sphinx-issues
@@ -39,36 +42,34 @@
 # /SECTION
 # SECTION test requirements
 BuildRequires:  %{python_module pytest}
+BuildRequires:  %{python_module python-dateutil}
 BuildRequires:  %{python_module pytz}
 BuildRequires:  %{python_module simplejson}
 # /SECTION
-Suggests:       python-python-dateutil
-Suggests:       python-simplejson
-Suggests:       %{name}-docs
-BuildArch:      noarch
-
 %python_subpackages
 
 %package -n %{name}-docs
-Summary:        Documentation files for %name
+Summary:        Documentation files for %{name}
 Group:          Documentation/Other
 
 %description
 marshmallow is an ORM/ODM/framework-agnostic library for converting complex
 datatypes, such as objects, to and from native Python datatypes.
 
-%description -n %name-docs
-HTML Documentation and examples for %name.
+%description -n %{name}-docs
+HTML Documentation and examples for %{name}.
 
 %prep
 %setup -q -n marshmallow-%{version}
 %patch0 -p1
 %patch1 -p1
+# remove py3 only tests
+rm -r tests/test_py3
 
 %build
 %python_build
 pushd docs
-make html
+make %{?_smp_mflags} html
 rm _build/html/.buildinfo
 popd
 
@@ -77,7 +78,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-%python_exec setup.py test
+%pytest
 
 %files %{python_files}
 %doc AUTHORS.rst CHANGELOG.rst README.rst

++++++ marshmallow-2.19.2.tar.gz -> marshmallow-2.19.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/CHANGELOG.rst 
new/marshmallow-2.19.5/CHANGELOG.rst
--- old/marshmallow-2.19.2/CHANGELOG.rst        2019-03-30 17:19:20.000000000 
+0100
+++ new/marshmallow-2.19.5/CHANGELOG.rst        2019-06-18 14:58:46.000000000 
+0200
@@ -1,6 +1,31 @@
 Changelog
 ---------
 
+2.19.5 (2019-06-18)
++++++++++++++++++++
+
+Bug fixes:
+
+- Fix deserializing ISO8601-formatted datetimes with less than 6-digit
+  miroseconds (:issue:`1251`). Thanks :user:`diego-plan9` for reporting.
+
+2.19.4 (2019-06-16)
++++++++++++++++++++
+
+Bug fixes:
+
+- Microseconds no longer gets lost when deserializing datetimes without 
dateutil
+  installed (:issue:`1147`).
+
+2.19.3 (2019-06-15)
++++++++++++++++++++
+
+Bug fixes:
+
+- Fix bug where nested fields in ``Meta.exclude`` would not work on
+  multiple instantiations (:issue:`1212`). Thanks :user:`MHannila` for
+  reporting.
+
 2.19.2 (2019-03-30)
 +++++++++++++++++++
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/PKG-INFO 
new/marshmallow-2.19.5/PKG-INFO
--- old/marshmallow-2.19.2/PKG-INFO     2019-03-30 17:19:49.000000000 +0100
+++ new/marshmallow-2.19.5/PKG-INFO     2019-06-18 14:59:09.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: marshmallow
-Version: 2.19.2
+Version: 2.19.5
 Summary: A lightweight library for converting complex datatypes to and from 
native Python datatypes.
 Home-page: https://github.com/marshmallow-code/marshmallow
 Author: Steven Loria
@@ -180,6 +180,6 @@
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
 Provides-Extra: reco
-Provides-Extra: dev
 Provides-Extra: lint
 Provides-Extra: tests
+Provides-Extra: dev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/src/marshmallow/__init__.py 
new/marshmallow-2.19.5/src/marshmallow/__init__.py
--- old/marshmallow-2.19.2/src/marshmallow/__init__.py  2019-03-30 
17:19:20.000000000 +0100
+++ new/marshmallow-2.19.5/src/marshmallow/__init__.py  2019-06-18 
14:58:46.000000000 +0200
@@ -15,7 +15,7 @@
 from marshmallow.exceptions import ValidationError
 from distutils.version import LooseVersion
 
-__version__ = '2.19.2'
+__version__ = '2.19.5'
 __version_info__ = tuple(LooseVersion(__version__).version)
 __author__ = 'Steven Loria'
 __all__ = [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/src/marshmallow/schema.py 
new/marshmallow-2.19.5/src/marshmallow/schema.py
--- old/marshmallow-2.19.2/src/marshmallow/schema.py    2019-03-30 
17:19:20.000000000 +0100
+++ new/marshmallow-2.19.5/src/marshmallow/schema.py    2019-06-18 
14:58:46.000000000 +0200
@@ -346,7 +346,7 @@
         self.declared_fields = copy.deepcopy(self._declared_fields)
         self.many = many
         self.only = only
-        self.exclude = exclude
+        self.exclude = set(self.opts.exclude) | set(exclude)
         if prefix:
             warnings.warn(
                 'The `prefix` argument is deprecated. Use a post_dump '
@@ -719,19 +719,15 @@
             self.__apply_nested_option('only', self.only, 'intersection')
             # Remove the child field names from the only option.
             self.only = self.set_class(
-                [field.split('.', 1)[0] for field in self.only])
-        excludes = set(self.opts.exclude) | set(self.exclude)
-        if excludes:
-            # Apply the exclude option to nested fields.
-            self.__apply_nested_option('exclude', excludes, 'union')
+                [field.split('.', 1)[0] for field in self.only],
+            )
         if self.exclude:
+            # Apply the exclude option to nested fields.
+            self.__apply_nested_option('exclude', self.exclude, 'union')
             # Remove the parent field names from the exclude option.
             self.exclude = self.set_class(
-                [field for field in self.exclude if '.' not in field])
-        if self.opts.exclude:
-            # Remove the parent field names from the meta exclude option.
-            self.opts.exclude = self.set_class(
-                [field for field in self.opts.exclude if '.' not in field])
+                [field for field in self.exclude if '.' not in field],
+            )
 
     def __apply_nested_option(self, option_name, field_names, set_operation):
         """Apply nested options to nested fields"""
@@ -771,9 +767,7 @@
             field_names = self.set_class(self.declared_fields.keys())
 
         # If "exclude" option or param is specified, remove those fields
-        excludes = set(self.opts.exclude) | set(self.exclude)
-        if excludes:
-            field_names = field_names - excludes
+        field_names -= self.exclude
         ret = self.__filter_fields(field_names, obj, many=many)
         # Set parents
         self.__set_field_attrs(ret)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/src/marshmallow/utils.py 
new/marshmallow-2.19.5/src/marshmallow/utils.py
--- old/marshmallow-2.19.2/src/marshmallow/utils.py     2019-03-30 
17:19:20.000000000 +0100
+++ new/marshmallow-2.19.5/src/marshmallow/utils.py     2019-06-18 
14:58:46.000000000 +0200
@@ -283,6 +283,12 @@
         return parser.parse(datestring)
     else:
         # Strip off timezone info.
+        if '.' in datestring:
+            # datestring contains microseconds
+            (dt_nomstz, mstz) = datestring.split('.')
+            ms_notz = mstz[:len(mstz) - len(mstz.lstrip('0123456789'))]
+            datestring = '.'.join((dt_nomstz, ms_notz))
+            return datetime.datetime.strptime(datestring[:26], 
'%Y-%m-%dT%H:%M:%S.%f')
         return datetime.datetime.strptime(datestring[:19], '%Y-%m-%dT%H:%M:%S')
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/src/marshmallow.egg-info/PKG-INFO 
new/marshmallow-2.19.5/src/marshmallow.egg-info/PKG-INFO
--- old/marshmallow-2.19.2/src/marshmallow.egg-info/PKG-INFO    2019-03-30 
17:19:48.000000000 +0100
+++ new/marshmallow-2.19.5/src/marshmallow.egg-info/PKG-INFO    2019-06-18 
14:59:09.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: marshmallow
-Version: 2.19.2
+Version: 2.19.5
 Summary: A lightweight library for converting complex datatypes to and from 
native Python datatypes.
 Home-page: https://github.com/marshmallow-code/marshmallow
 Author: Steven Loria
@@ -180,6 +180,6 @@
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
 Provides-Extra: reco
-Provides-Extra: dev
 Provides-Extra: lint
 Provides-Extra: tests
+Provides-Extra: dev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/tests/base.py 
new/marshmallow-2.19.5/tests/base.py
--- old/marshmallow-2.19.2/tests/base.py        2019-03-30 17:19:20.000000000 
+0100
+++ new/marshmallow-2.19.5/tests/base.py        2019-06-18 14:58:46.000000000 
+0200
@@ -49,14 +49,15 @@
     assert_date_equal(dt1, dt2)
     assert dt1.hour == dt2.hour
     assert dt1.minute == dt2.minute
+    assert dt1.second == dt2.second
+    assert dt1.microsecond == dt2.microsecond
 
 
-def assert_time_equal(t1, t2, microseconds=True):
+def assert_time_equal(t1, t2):
     assert t1.hour == t2.hour
     assert t1.minute == t2.minute
     assert t1.second == t2.second
-    if microseconds:
-        assert t1.microsecond == t2.microsecond
+    assert t1.microsecond == t2.microsecond
 
 
 ##### Models #####
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/tests/test_deserialization.py 
new/marshmallow-2.19.5/tests/test_deserialization.py
--- old/marshmallow-2.19.2/tests/test_deserialization.py        2019-03-30 
17:19:20.000000000 +0100
+++ new/marshmallow-2.19.5/tests/test_deserialization.py        2019-06-18 
14:58:46.000000000 +0200
@@ -324,15 +324,15 @@
     def test_custom_date_format_datetime_field_deserialization(self):
 
         dtime = dt.datetime.now()
-        datestring = dtime.strftime('%H:%M:%S %Y-%m-%d')
+        datestring = dtime.strftime('%H:%M:%S.%f %Y-%m-%d')
 
         field = fields.DateTime(format='%d-%m-%Y %H:%M:%S')
         #deserialization should fail when datestring is not of same format
         with pytest.raises(ValidationError) as excinfo:
             field.deserialize(datestring)
-        msg = 'Not a valid datetime.'.format(datestring)
+        msg = 'Not a valid datetime.'
         assert msg in str(excinfo)
-        field = fields.DateTime(format='%H:%M:%S %Y-%m-%d')
+        field = fields.DateTime(format='%H:%M:%S.%f %Y-%m-%d')
         assert_datetime_equal(field.deserialize(datestring), dtime)
 
         field = fields.DateTime()
@@ -340,7 +340,7 @@
 
     @pytest.mark.parametrize('fmt', ['rfc', 'rfc822'])
     def test_rfc_datetime_field_deserialization(self, fmt):
-        dtime = dt.datetime.now()
+        dtime = dt.datetime.now().replace(microsecond=0)
         datestring = utils.rfcformat(dtime)
         field = fields.DateTime(format=fmt)
         assert_datetime_equal(field.deserialize(datestring), dtime)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/tests/test_schema.py 
new/marshmallow-2.19.5/tests/test_schema.py
--- old/marshmallow-2.19.2/tests/test_schema.py 2019-03-30 17:19:20.000000000 
+0100
+++ new/marshmallow-2.19.5/tests/test_schema.py 2019-06-18 14:58:46.000000000 
+0200
@@ -938,8 +938,22 @@
         blubb = fields.Nested(ChildSchema)
         class Meta:
             exclude = ('blubb.foo',)
-    sch = ParentSchema()
+
     data = dict(bla=1, bli=2, blubb=dict(foo=42, bar=24, baz=242))
+
+    sch = ParentSchema()
+    result = sch.dump(data)
+    assert 'bla' in result.data
+    assert 'blubb' in result.data
+    assert 'bli' in result.data
+    child = result.data['blubb']
+    assert 'foo' not in child
+    assert 'bar' in child
+    assert 'baz' in child
+
+    # Test fields with dot notations in Meta.exclude on multiple instantiations
+    # Regression test for 
https://github.com/marshmallow-code/marshmallow/issues/1212
+    sch = ParentSchema()
     result = sch.dump(data)
     assert 'bla' in result.data
     assert 'blubb' in result.data
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/marshmallow-2.19.2/tests/test_utils.py 
new/marshmallow-2.19.5/tests/test_utils.py
--- old/marshmallow-2.19.2/tests/test_utils.py  2019-03-30 17:19:20.000000000 
+0100
+++ new/marshmallow-2.19.5/tests/test_utils.py  2019-06-18 14:58:46.000000000 
+0200
@@ -185,20 +185,30 @@
 
 @pytest.mark.parametrize('use_dateutil', [True, False])
 def test_from_rfc(use_dateutil):
-    d = dt.datetime.now()
+    d = dt.datetime.now().replace(microsecond=0)
     rfc = utils.rfcformat(d)
     result = utils.from_rfc(rfc, use_dateutil=use_dateutil)
     assert type(result) == dt.datetime
     assert_datetime_equal(result, d)
 
 @pytest.mark.parametrize('use_dateutil', [True, False])
-def test_from_iso(use_dateutil):
-    d = dt.datetime.now()
+@pytest.mark.parametrize('timezone', [None, central])
+def test_from_iso_datetime(use_dateutil, timezone):
+    d = dt.datetime.now(tz=timezone)
     formatted = d.isoformat()
     result = utils.from_iso(formatted, use_dateutil=use_dateutil)
     assert type(result) == dt.datetime
     assert_datetime_equal(result, d)
 
+    # Test with 3-digit only microseconds
+    # Regression test for 
https://github.com/marshmallow-code/marshmallow/issues/1251
+    d = dt.datetime.now(tz=timezone).replace(microsecond=123000)
+    formatted = d.isoformat()
+    formatted = formatted[:23] + formatted[26:]
+    result = utils.from_iso(formatted, use_dateutil=use_dateutil)
+    assert type(result) == dt.datetime
+    assert_datetime_equal(result, d)
+
 def test_from_iso_with_tz():
     d = central.localize(dt.datetime.now())
     formatted = d.isoformat()
@@ -215,7 +225,7 @@
     formatted = t.isoformat()
     result = utils.from_iso_time(formatted, use_dateutil=use_dateutil)
     assert type(result) == dt.time
-    assert_time_equal(result, t, microseconds=True)
+    assert_time_equal(result, t)
 
 @pytest.mark.parametrize('use_dateutil', [True, False])
 def test_from_iso_time_without_microseconds(use_dateutil):
@@ -223,7 +233,7 @@
     formatted = t.isoformat()
     result = utils.from_iso_time(formatted, use_dateutil=use_dateutil)
     assert type(result) == dt.time
-    assert_time_equal(result, t, microseconds=True)
+    assert_time_equal(result, t)
 
 @pytest.mark.parametrize('use_dateutil', [True, False])
 def test_from_iso_date(use_dateutil):


Reply via email to