Update to version 2.9.0.post0 and revise patches

Resolves: RHEL-103664

Signed-off-by: Kseniia Nivnia <knivnia@redhat.com>
This commit is contained in:
Kseniia Nivnia 2025-07-15 14:11:54 +01:00
parent 20d2311525
commit 94f7756b49
No known key found for this signature in database
5 changed files with 60 additions and 131 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@
/python-dateutil-2.8.0.tar.gz /python-dateutil-2.8.0.tar.gz
/python-dateutil-2.8.1.tar.gz /python-dateutil-2.8.1.tar.gz
/python-dateutil-2.8.2.tar.gz /python-dateutil-2.8.2.tar.gz
/python-dateutil-2.9.0.post0.tar.gz

View File

@ -1,46 +0,0 @@
From 2bdd63158b7f981fc6d70a869680451bdfd8d848 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Kul=C3=ADk?= <kulikjak@gmail.com>
Date: Thu, 10 Feb 2022 10:28:42 +0100
Subject: [PATCH] Remove deprecated pytest.warns(None) from test_internals.py
---
tests/test_internals.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/test_internals.py b/tests/test_internals.py
index 530813147..b32e6723f 100644
--- a/tests/test_internals.py
+++ b/tests/test_internals.py
@@ -9,6 +9,7 @@
import sys
import pytest
+import warnings
from dateutil.parser._parser import _ymd
from dateutil import tz
@@ -65,18 +66,17 @@ def test_parser_parser_private_not_warns():
from dateutil.parser._parser import _timelex, _tzparser
from dateutil.parser._parser import _parsetz
- with pytest.warns(None) as recorder:
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
_tzparser()
- assert len(recorder) == 0
- with pytest.warns(None) as recorder:
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
_timelex('2014-03-03')
- assert len(recorder) == 0
-
- with pytest.warns(None) as recorder:
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
_parsetz('+05:00')
- assert len(recorder) == 0
@pytest.mark.tzstr

View File

@ -1,23 +0,0 @@
From f2293200747fb03d56c6c5997bfebeabe703576f Mon Sep 17 00:00:00 2001
From: Thomas Grainger <tagrain@gmail.com>
Date: Fri, 2 Jun 2023 14:06:41 +0100
Subject: [PATCH] avoid deprecated utcfromtimestamp
Fixes #1284
---
src/dateutil/tz/tz.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dateutil/tz/tz.py b/src/dateutil/tz/tz.py
index c67f56d46..617591446 100644
--- a/src/dateutil/tz/tz.py
+++ b/src/dateutil/tz/tz.py
@@ -34,7 +34,7 @@
from warnings import warn
ZERO = datetime.timedelta(0)
-EPOCH = datetime.datetime.utcfromtimestamp(0)
+EPOCH = datetime.datetime(1970, 1, 1, 0, 0)
EPOCHORDINAL = EPOCH.toordinal()

View File

@ -1,7 +1,7 @@
%global modname dateutil %global modname dateutil
Name: python-%{modname} Name: python-%{modname}
Version: 2.8.2 Version: 2.9.0.post0
Release: %autorelease Release: %autorelease
Epoch: 1 Epoch: 1
Summary: Powerful extensions to the standard datetime module Summary: Powerful extensions to the standard datetime module
@ -13,27 +13,27 @@ Summary: Powerful extensions to the standard datetime module
License: (Apache-2.0 AND BSD-3-Clause) OR BSD-3-Clause License: (Apache-2.0 AND BSD-3-Clause) OR BSD-3-Clause
URL: https://github.com/dateutil/dateutil URL: https://github.com/dateutil/dateutil
Source: %{pypi_source} Source: %{pypi_source python-dateutil}
# Remove deprecated pytest.warns(None) from test_internals.py
#
# Fixes:
# python-dateutil fails to build with pytest 7
# https://bugzilla.redhat.com/show_bug.cgi?id=2059950
Patch1: %{url}/commit/2bdd63158b7f981fc6d70a869680451bdfd8d848.patch
# Backport the replacement for the deprecated in Python 3.12
# datetime.datetime.utcfromtimestamp()
Patch2: %{url}/commit/f2293200747fb03d56c6c5997bfebeabe703576f.patch
# when bootstrapping dateutil-freezegun, we cannot run tests # when bootstrapping dateutil-freezegun, we cannot run tests
# on RHEL, we do not have or want all test dependencies # on RHEL, we do not have or want all test dependencies
%bcond tests %{undefined rhel} %bcond tests %{undefined rhel}
BuildArch: noarch BuildArch: noarch
BuildRequires: make BuildRequires: python3-devel
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx_rtd_theme # For docs
BuildRequires: make
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-rtd-theme)
# For tests
%if %{with tests}
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(freezegun)
BuildRequires: python3dist(hypothesis)
BuildRequires: python3dist(six)
%endif
%global _description \ %global _description \
The dateutil module provides powerful extensions to the standard datetime\ The dateutil module provides powerful extensions to the standard datetime\
@ -43,18 +43,7 @@ module available in Python.
%package -n python3-%{modname} %package -n python3-%{modname}
Summary: %summary Summary: %summary
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
# Runtime deps
BuildRequires: python3-six
%if %{with tests}
BuildRequires: python3-freezegun
BuildRequires: python3-hypothesis
BuildRequires: python3-pytest
%endif
Requires: tzdata Requires: tzdata
%{?python_provide:%python_provide python3-%{modname}}
%description -n python3-%{modname} %_description %description -n python3-%{modname} %_description
@ -64,39 +53,47 @@ Summary: API documentation for python-dateutil
This package contains %{summary}. This package contains %{summary}.
%prep %prep
%autosetup -N %autosetup -p1 -n %{name}-%{version}
# the tests were moved outside of %%{modname} directory upstream after 2.8.2
# so we apply the patch with new paths from within it
pushd %{modname}/test # Relax version requirements
%patch -P1 -p2 sed -i 's/setuptools_scm<8\.0/setuptools_scm/' pyproject.toml
popd # Fix sphinx import
%patch -P2 -p2 sed -i "s|os.path.abspath('../')|os.path.abspath('../src/')|" docs/conf.py
iconv --from=ISO-8859-1 --to=UTF-8 NEWS > NEWS.new iconv --from=ISO-8859-1 --to=UTF-8 NEWS > NEWS.new
mv NEWS.new NEWS mv NEWS.new NEWS
%generate_buildrequires
%pyproject_buildrequires
%build %build
%py3_build %pyproject_wheel
make -C docs html make -C docs html
%install %install
%py3_install %pyproject_install
%pyproject_save_files %{modname} -l
%check %check
%pyproject_check_import -e dateutil.tz.win -e dateutil.tzwin
%if %{with tests} %if %{with tests}
%{__python3} -m pytest -W ignore::pytest.PytestUnknownMarkWarning %pytest -W ignore::pytest.PytestUnknownMarkWarning
%else
%py3_check_import dateutil dateutil.easter dateutil.parser dateutil.relativedelta dateutil.rrule dateutil.tz dateutil.utils dateutil.zoneinfo
%endif %endif
%files -n python3-%{modname}
%license LICENSE %files -n python3-%{modname} -f %{pyproject_files}
%doc NEWS README.rst %doc NEWS README.rst
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/*.egg-info
%files doc %files doc
%license LICENSE %license LICENSE
%doc docs/_build/html %doc docs/_build/html
%changelog %changelog
%autochangelog %autochangelog

View File

@ -1 +1 @@
SHA512 (python-dateutil-2.8.2.tar.gz) = 6538858e4a3e2d1de1bf25b6d8b25e3a8d20bf60fb85e32d07ac491c90ce193e268bb5641371b8a79fb0f033a184bac9896b3bc643c1aca9ee9c6478286ac20c SHA512 (python-dateutil-2.9.0.post0.tar.gz) = f76522de0ff21547327eaf6966e80a15c57f8f92588d520eabd354a732e5c4b51d9c3ac5effd9eaa6dd451d1bce329a54a3f4c6bf4f1bd08ff06b0305c994e5a