Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-jsondate for openSUSE:Factory
checked in at 2021-06-01 10:35:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jsondate (Old)
and /work/SRC/openSUSE:Factory/.python-jsondate.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jsondate"
Tue Jun 1 10:35:22 2021 rev:3 rq:895295 version:0.1.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jsondate/python-jsondate.changes
2018-12-24 11:38:44.817592935 +0100
+++
/work/SRC/openSUSE:Factory/.python-jsondate.new.1898/python-jsondate.changes
2021-06-01 10:35:56.340657497 +0200
@@ -1,0 +2,12 @@
+Tue May 25 08:09:20 UTC 2021 - Sebastian Wagner <[email protected]>
+
+- update python3-fixes-pr-6.patch to fix python2 tests
+
+-------------------------------------------------------------------
+Tue May 25 07:27:31 UTC 2021 - [email protected]
+
+- %check: use %pyunittest macro for testing the package
+- modified patches
+ % python3-fixes-pr-6.patch (removed test broken in python3)
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-jsondate.spec ++++++
--- /var/tmp/diff_new_pack.z7xT3O/_old 2021-06-01 10:35:56.748658192 +0200
+++ /var/tmp/diff_new_pack.z7xT3O/_new 2021-06-01 10:35:56.748658192 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-jsondate
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# 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
@@ -23,7 +23,7 @@
Summary: JSON with datetime support
License: MIT
Group: Development/Languages/Python
-Url: https://github.com/rconradharris/jsondate
+URL: https://github.com/rconradharris/jsondate
Source:
https://files.pythonhosted.org/packages/source/j/jsondate/jsondate-%{version}.tar.gz
# PATCH-FIX-UPSTREAM: python3-fixes-pr-6.patch
# From
https://github.com/rconradharris/jsondate/pull/6.patch#/python3-fixes-pr-6.patch
with removed .gitignore file
@@ -55,8 +55,8 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
# Tests are broken upstream and need work to get fixed for 2 and 3
-#%%check
-#%%python_exec setup.py test
+%check
+%pyunittest discover -v tests/
%files %{python_files}
%doc README.rst
++++++ python3-fixes-pr-6.patch ++++++
--- /var/tmp/diff_new_pack.z7xT3O/_old 2021-06-01 10:35:56.772658233 +0200
+++ /var/tmp/diff_new_pack.z7xT3O/_new 2021-06-01 10:35:56.776658240 +0200
@@ -11,10 +11,10 @@
3 files changed, 7 insertions(+), 10 deletions(-)
create mode 100644 test-requirements.txt
-diff --git a/jsondate/__init__.py b/jsondate/__init__.py
-index 4486574..4cc10f1 100644
---- a/jsondate/__init__.py
-+++ b/jsondate/__init__.py
+Index: jsondate-0.1.2/jsondate/__init__.py
+===================================================================
+--- jsondate-0.1.2.orig/jsondate/__init__.py 2012-11-09 17:44:19.000000000
+0100
++++ jsondate-0.1.2/jsondate/__init__.py 2021-05-25 09:24:54.519218741
+0200
@@ -15,14 +15,7 @@ def _datetime_encoder(obj):
@@ -31,35 +31,58 @@
try:
datetime_obj = datetime.datetime.strptime(value, ISO8601_FMT)
dict_[key] = datetime_obj
-diff --git a/test-requirements.txt b/test-requirements.txt
-new file mode 100644
-index 0000000..ff3197f
---- /dev/null
-+++ b/test-requirements.txt
+Index: jsondate-0.1.2/test-requirements.txt
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ jsondate-0.1.2/test-requirements.txt 2021-05-25 09:24:54.519218741
+0200
@@ -0,0 +1,4 @@
+# Only needed for running the tests.
+
+pytest
+jsonschema
-diff --git a/tests/test_jsondate.py b/tests/test_jsondate.py
-index 78e08bf..04610ff 100644
---- a/tests/test_jsondate.py
-+++ b/tests/test_jsondate.py
-@@ -1,7 +1,7 @@
+Index: jsondate-0.1.2/tests/test_jsondate.py
+===================================================================
+--- jsondate-0.1.2.orig/tests/test_jsondate.py 2012-11-09 17:42:31.000000000
+0100
++++ jsondate-0.1.2/tests/test_jsondate.py 2021-05-25 09:26:14.231638295
+0200
+@@ -1,7 +1,8 @@
import datetime
import json
import unittest
-import StringIO
-+from io import StringIO
++import sys
++from io import BytesIO, StringIO
import jsondate
-@@ -57,7 +57,7 @@ def test_dumps_datelike_string_does_not_roundtrip(self):
+@@ -19,19 +20,6 @@
+ orig_dict = dict(foo='bar')
+ self.assertEqual(orig_dict, jsondate.loads(jsondate.dumps(orig_dict)))
+
+- def test_dump_unicode_roundtrips(self):
+- orig_dict = {u'foo': u'bar', 'empty': u''}
+-
+- # json module broken: unicode objects, empty-string objects are str
+- result = json.loads(json.dumps(orig_dict))
+- self.assertTypeAndValue(unicode, u'bar', result[u'foo'])
+- self.assertTypeAndValue(str, '', result[u'empty'])
+-
+- # jsondate fix: always return unicode objects
+- result = jsondate.loads(jsondate.dumps(orig_dict))
+- self.assertTypeAndValue(unicode, u'bar', result[u'foo'])
+- self.assertTypeAndValue(unicode, u'', result[u'empty'])
+-
+ def test_dumps_none_roundtrips(self):
+ # Generates a TypeError from _datetime_object_hook
+ orig_dict = dict(foo=None)
+@@ -57,7 +45,10 @@
def test_dump_datetime_roundtrips(self):
orig_dict = dict(created_at=datetime.date(2011, 1, 1))
- fileobj = StringIO.StringIO()
-+ fileobj = StringIO()
++ if sys.version_info[0] == 2:
++ fileobj = BytesIO()
++ elif sys.version_info[0] == 3:
++ fileobj = StringIO()
jsondate.dump(orig_dict, fileobj)
fileobj.seek(0)
self.assertEqual(orig_dict, jsondate.load(fileobj))