Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-python-dateutil for 
openSUSE:Factory checked in at 2023-09-22 21:46:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-dateutil (Old)
 and      /work/SRC/openSUSE:Factory/.python-python-dateutil.new.1770 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-python-dateutil"

Fri Sep 22 21:46:42 2023 rev:13 rq:1111822 version:2.8.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-python-dateutil/python-python-dateutil.changes
    2023-04-22 21:58:26.656493216 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-python-dateutil.new.1770/python-python-dateutil.changes
  2023-09-22 21:46:59.643945411 +0200
@@ -1,0 +2,7 @@
+Mon Sep 18 04:39:14 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com>
+
+- Add patch no-utcfromtimestamp.patch, stop using a deprecated function.
+- Switch to pyproject and autosetup macros.
+- Stop using greedy globs in %files.
+
+-------------------------------------------------------------------

New:
----
  no-utcfromtimestamp.patch

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

Other differences:
------------------
++++++ python-python-dateutil.spec ++++++
--- /var/tmp/diff_new_pack.974p3D/_old  2023-09-22 21:47:00.675982877 +0200
+++ /var/tmp/diff_new_pack.974p3D/_new  2023-09-22 21:47:00.675982877 +0200
@@ -16,7 +16,6 @@
 #
 
 
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define oldpython python
 %global flavor @BUILD_FLAVOR@%{nil}
 %if "%{flavor}" == "test"
@@ -34,9 +33,12 @@
 License:        Apache-2.0 OR BSD-3-Clause
 URL:            https://dateutil.readthedocs.org/en/latest/
 Source0:        
https://files.pythonhosted.org/packages/source/p/python-dateutil/python-dateutil-%{version}.tar.gz
+Patch0:         no-utcfromtimestamp.patch
+BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module setuptools >= 24.3}
 BuildRequires:  %{python_module setuptools_scm}
 BuildRequires:  %{python_module six >= 1.5}
+BuildRequires:  %{python_module wheel}
 BuildRequires:  dos2unix
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -86,16 +88,16 @@
 Orthodox or Julian algorithms.
 
 %prep
-%setup -q -n python-dateutil-%{version}
+%autosetup -p1 -n python-dateutil-%{version}
 #cleanup and MSdos style end of line separators
 dos2unix LICENSE NEWS PKG-INFO README.rst
 
 %build
-%python_build
+%pyproject_wheel
 
 %install
 %if !%{with test}
-%python_install
+%pyproject_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 %endif
 
@@ -110,6 +112,7 @@
 %files %{python_files}
 %doc NEWS PKG-INFO README.rst
 %license LICENSE
-%{python_sitelib}/*
+%{python_sitelib}/dateutil
+%{python_sitelib}/python_dateutil-%{version}.dist-info
 %endif
 

++++++ no-utcfromtimestamp.patch ++++++
Index: python-dateutil-2.8.2/dateutil/tz/tz.py
===================================================================
--- python-dateutil-2.8.2.orig/dateutil/tz/tz.py
+++ python-dateutil-2.8.2/dateutil/tz/tz.py
@@ -34,7 +34,7 @@ except ImportError:
 from warnings import warn
 
 ZERO = datetime.timedelta(0)
-EPOCH = datetime.datetime.utcfromtimestamp(0)
+EPOCH = datetime.datetime.fromtimestamp(0, tz=datetime.timezone.utc)
 EPOCHORDINAL = EPOCH.toordinal()
 
 
@@ -1809,9 +1809,9 @@ def resolve_imaginary(dt):
 def _datetime_to_timestamp(dt):
     """
     Convert a :class:`datetime.datetime` object to an epoch timestamp in
-    seconds since January 1, 1970, ignoring the time zone.
+    seconds since January 1, 1970, forcing to UTC.
     """
-    return (dt.replace(tzinfo=None) - EPOCH).total_seconds()
+    return (dt.replace(tzinfo=datetime.timezone.utc) - EPOCH).total_seconds()
 
 
 if sys.version_info >= (3, 6):
Index: python-dateutil-2.8.2/dateutil/test/test_tz.py
===================================================================
--- python-dateutil-2.8.2.orig/dateutil/test/test_tz.py
+++ python-dateutil-2.8.2/dateutil/test/test_tz.py
@@ -10,6 +10,7 @@ from datetime import tzinfo
 from six import PY2
 from io import BytesIO, StringIO
 import unittest
+import warnings
 
 import sys
 import base64
@@ -2809,3 +2810,10 @@ def test_resolve_imaginary(tzi, dt, dt_e
     assert dt_r == dt_exp
     assert dt_r.tzname() == dt_exp.tzname()
     assert dt_r.utcoffset() == dt_exp.utcoffset()
+
+
+def test_epoch():
+    # We're really try to see that no warnings are raised
+    with warnings.catch_warnings():
+        warnings.simplefilter("error")
+        assert tz.EPOCH - tz.EPOCH == timedelta(0)

Reply via email to