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:
parent
20d2311525
commit
94f7756b49
1
.gitignore
vendored
1
.gitignore
vendored
@ -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
|
||||
|
@ -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
|
@ -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()
|
||||
|
||||
|
@ -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
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (python-dateutil-2.8.2.tar.gz) = 6538858e4a3e2d1de1bf25b6d8b25e3a8d20bf60fb85e32d07ac491c90ce193e268bb5641371b8a79fb0f033a184bac9896b3bc643c1aca9ee9c6478286ac20c
|
||||
SHA512 (python-dateutil-2.9.0.post0.tar.gz) = f76522de0ff21547327eaf6966e80a15c57f8f92588d520eabd354a732e5c4b51d9c3ac5effd9eaa6dd451d1bce329a54a3f4c6bf4f1bd08ff06b0305c994e5a
|
||||
|
Loading…
Reference in New Issue
Block a user