From 94f7756b494b4b19758f939078ac7fdb5325cf46 Mon Sep 17 00:00:00 2001 From: Kseniia Nivnia Date: Tue, 15 Jul 2025 14:11:54 +0100 Subject: [PATCH] Update to version 2.9.0.post0 and revise patches Resolves: RHEL-103664 Signed-off-by: Kseniia Nivnia --- .gitignore | 1 + ...63158b7f981fc6d70a869680451bdfd8d848.patch | 46 ------- ...3200747fb03d56c6c5997bfebeabe703576f.patch | 23 ---- python-dateutil.spec | 119 +++++++++--------- sources | 2 +- 5 files changed, 60 insertions(+), 131 deletions(-) delete mode 100644 2bdd63158b7f981fc6d70a869680451bdfd8d848.patch delete mode 100644 f2293200747fb03d56c6c5997bfebeabe703576f.patch diff --git a/.gitignore b/.gitignore index 4d69752..9e42f0e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /python-dateutil-2.8.0.tar.gz /python-dateutil-2.8.1.tar.gz /python-dateutil-2.8.2.tar.gz +/python-dateutil-2.9.0.post0.tar.gz diff --git a/2bdd63158b7f981fc6d70a869680451bdfd8d848.patch b/2bdd63158b7f981fc6d70a869680451bdfd8d848.patch deleted file mode 100644 index c7a078c..0000000 --- a/2bdd63158b7f981fc6d70a869680451bdfd8d848.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 2bdd63158b7f981fc6d70a869680451bdfd8d848 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jakub=20Kul=C3=ADk?= -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 diff --git a/f2293200747fb03d56c6c5997bfebeabe703576f.patch b/f2293200747fb03d56c6c5997bfebeabe703576f.patch deleted file mode 100644 index c4ebe23..0000000 --- a/f2293200747fb03d56c6c5997bfebeabe703576f.patch +++ /dev/null @@ -1,23 +0,0 @@ -From f2293200747fb03d56c6c5997bfebeabe703576f Mon Sep 17 00:00:00 2001 -From: Thomas Grainger -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() - - diff --git a/python-dateutil.spec b/python-dateutil.spec index 2dbfbce..40e83bd 100644 --- a/python-dateutil.spec +++ b/python-dateutil.spec @@ -1,102 +1,99 @@ %global modname dateutil - + Name: python-%{modname} -Version: 2.8.2 +Version: 2.9.0.post0 Release: %autorelease Epoch: 1 Summary: Powerful extensions to the standard datetime module - + # According to the LICENSE file: # - Apache-2.0 applies to all contributions after 2017-12-01, as well as # all contributions that have been re-licensed. # - BSD-3-Clause applies to all code, even that also covered by Apache-2.0 License: (Apache-2.0 AND BSD-3-Clause) OR BSD-3-Clause - + URL: https://github.com/dateutil/dateutil -Source: %{pypi_source} - -# 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 - +Source: %{pypi_source python-dateutil} + # when bootstrapping dateutil-freezegun, we cannot run tests # on RHEL, we do not have or want all test dependencies %bcond tests %{undefined rhel} - + BuildArch: noarch -BuildRequires: make -BuildRequires: python3-sphinx -BuildRequires: python3-sphinx_rtd_theme - +BuildRequires: python3-devel + +# 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 \ The dateutil module provides powerful extensions to the standard datetime\ module available in Python. - + %description %_description - + %package -n python3-%{modname} 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 -%{?python_provide:%python_provide python3-%{modname}} - + %description -n python3-%{modname} %_description - + %package doc Summary: API documentation for python-dateutil %description doc This package contains %{summary}. - + %prep -%autosetup -N -# 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 -%patch -P1 -p2 -popd -%patch -P2 -p2 +%autosetup -p1 -n %{name}-%{version} + + +# Relax version requirements +sed -i 's/setuptools_scm<8\.0/setuptools_scm/' pyproject.toml +# Fix sphinx import +sed -i "s|os.path.abspath('../')|os.path.abspath('../src/')|" docs/conf.py + iconv --from=ISO-8859-1 --to=UTF-8 NEWS > NEWS.new mv NEWS.new NEWS - + + +%generate_buildrequires +%pyproject_buildrequires + %build -%py3_build +%pyproject_wheel make -C docs html - + + %install -%py3_install - +%pyproject_install +%pyproject_save_files %{modname} -l + + %check +%pyproject_check_import -e dateutil.tz.win -e dateutil.tzwin + %if %{with tests} -%{__python3} -m pytest -W ignore::pytest.PytestUnknownMarkWarning -%else -%py3_check_import dateutil dateutil.easter dateutil.parser dateutil.relativedelta dateutil.rrule dateutil.tz dateutil.utils dateutil.zoneinfo +%pytest -W ignore::pytest.PytestUnknownMarkWarning %endif - -%files -n python3-%{modname} -%license LICENSE + + +%files -n python3-%{modname} -f %{pyproject_files} %doc NEWS README.rst -%{python3_sitelib}/%{modname}/ -%{python3_sitelib}/*.egg-info - + + %files doc %license LICENSE %doc docs/_build/html - + + %changelog -%autochangelog +%autochangelog \ No newline at end of file diff --git a/sources b/sources index d452812..06ceb36 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (python-dateutil-2.8.2.tar.gz) = 6538858e4a3e2d1de1bf25b6d8b25e3a8d20bf60fb85e32d07ac491c90ce193e268bb5641371b8a79fb0f033a184bac9896b3bc643c1aca9ee9c6478286ac20c +SHA512 (python-dateutil-2.9.0.post0.tar.gz) = f76522de0ff21547327eaf6966e80a15c57f8f92588d520eabd354a732e5c4b51d9c3ac5effd9eaa6dd451d1bce329a54a3f4c6bf4f1bd08ff06b0305c994e5a