diff --git a/.python-isodate.metadata b/.python-isodate.metadata index ed58c19..cc064ae 100644 --- a/.python-isodate.metadata +++ b/.python-isodate.metadata @@ -1 +1 @@ -40ccf07a8e46284a79cfc4d41e151f71ae63f535 SOURCES/isodate-0.5.4.tar.gz +2c69e08c9894a9cd96c627146463260f5731df62 SOURCES/isodate-0.6.0.tar.gz diff --git a/SOURCES/0001-Fix-interpret-decimal-object-as-an-integer.patch b/SOURCES/0001-Fix-interpret-decimal-object-as-an-integer.patch new file mode 100644 index 0000000..1eac205 --- /dev/null +++ b/SOURCES/0001-Fix-interpret-decimal-object-as-an-integer.patch @@ -0,0 +1,67 @@ +From 03e2d16f3306e3450da0e69ae47c427d715457a9 Mon Sep 17 00:00:00 2001 +From: Tomas Hrnciar +Date: Fri, 30 Oct 2020 10:01:24 +0100 +Subject: [PATCH] Fix interpret decimal.Decimal object as an integer + +Ref: https://docs.python.org/3.8/whatsnew/3.8.html + +Many builtin and extension functions that take integer arguments will +now emit a deprecation warning for Decimals, Fractions and any other +objects that can be converted to integers only with a loss (e.g. that +have the `__int__()` method but do not have the `__index__()` method). +In future version they will be errors. (Contributed by Serhiy +Storchaka in bpo-36048.) + +--- + src/isodate/duration.py | 6 ++++-- + src/isodate/tests/__init__.py | 3 +++ + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/isodate/duration.py b/src/isodate/duration.py +index 6d1848c..96127ab 100644 +--- a/src/isodate/duration.py ++++ b/src/isodate/duration.py +@@ -180,7 +180,8 @@ class Duration(object): + newday = maxdays + else: + newday = other.day +- newdt = other.replace(year=newyear, month=newmonth, day=newday) ++ newdt = other.replace( ++ year=int(newyear), month=int(newmonth), day=newday) + # does a timedelta + date/datetime + return self.tdelta + newdt + except AttributeError: +@@ -264,7 +265,8 @@ class Duration(object): + newday = maxdays + else: + newday = other.day +- newdt = other.replace(year=newyear, month=newmonth, day=newday) ++ newdt = other.replace( ++ year=int(newyear), month=int(newmonth), day=newday) + return newdt - self.tdelta + except AttributeError: + # other probably was not compatible with data/datetime +diff --git a/src/isodate/tests/__init__.py b/src/isodate/tests/__init__.py +index b1d46bd..7208cbd 100644 +--- a/src/isodate/tests/__init__.py ++++ b/src/isodate/tests/__init__.py +@@ -29,6 +29,7 @@ Collect all test suites into one TestSuite instance. + ''' + + import unittest ++import warnings + from isodate.tests import (test_date, test_time, test_datetime, test_duration, + test_strf, test_pickle) + +@@ -37,6 +38,8 @@ def test_suite(): + ''' + Return a new TestSuite instance consisting of all available TestSuites. + ''' ++ warnings.filterwarnings("error", module=r"isodate(\..)*") ++ + return unittest.TestSuite([ + test_date.test_suite(), + test_time.test_suite(), +-- +2.26.2 + diff --git a/SPECS/python-isodate.spec b/SPECS/python-isodate.spec index 75b7376..7a579a2 100644 --- a/SPECS/python-isodate.spec +++ b/SPECS/python-isodate.spec @@ -1,138 +1,120 @@ -%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) -%{!?python2_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%endif +%global srcname isodate -%global modulename isodate -%global with_python3 0 - -Name: python-%{modulename} -Version: 0.5.4 +Name: python-%{srcname} +Version: 0.6.0 Release: 8%{?dist} Summary: An ISO 8601 date/time/duration parser and formatter -Group: Development/Languages License: BSD -URL: http://pypi.python.org/pypi/%{modulename} -Source0: %{modulename}-%{version}.tar.gz +URL: https://pypi.org/project/isodate/ +Source0: %pypi_source +# Python3.10 cannot interpret decimal.Decimal object as an integer. +# This patch fixes it until PR is not merged in upstream. +# https://github.com/gweis/isodate/issues/58 +Patch1: 0001-Fix-interpret-decimal-object-as-an-integer.patch BuildArch: noarch -BuildRequires: python-devel -BuildRequires: python-setuptools -%if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools -%endif # if with_python3 +BuildRequires: python3-six + + +%global _description This module implements ISO 8601 date, time and duration \ +parsing. The implementation follows ISO8601:2004 standard, and implements only \ +date/time\ representations mentioned in the standard. If something is not \ +mentioned there, then it is treated as non existent, and not as an allowed \ +option.\ +\ +For instance, ISO8601:2004 never mentions 2 digit years. So, it is not intended\ +by this module to support 2 digit years. (while it may still be valid as ISO\ +date, because it is not explicitly forbidden.) Another example is, when no time\ +zone information is given for a time, then it should be interpreted as local\ +time, and not UTC.\ +\ +As this module maps ISO 8601 dates/times to standard Python data types, like\ +date, time, datetime and timedelta, it is not possible to convert all possible\ +ISO 8601 dates/times. For instance, dates before 0001-01-01 are not allowed by\ +the Python date and datetime classes. Additionally fractional seconds are\ +limited to microseconds. That means if the parser finds for instance\ +nanoseconds it will round it to microseconds. %description -This module implements ISO 8601 date, time and duration parsing. The -implementation follows ISO8601:2004 standard, and implements only date/time -representations mentioned in the standard. If something is not mentioned there, -then it is treated as non existent, and not as an allowed option. - -For instance, ISO8601:2004 never mentions 2 digit years. So, it is not intended -by this module to support 2 digit years. (while it may still be valid as ISO -date, because it is not explicitly forbidden.) Another example is, when no time -zone information is given for a time, then it should be interpreted as local -time, and not UTC. - -As this module maps ISO 8601 dates/times to standard Python data types, like -date, time, datetime and timedelta, it is not possible to convert all possible -ISO 8601 dates/times. For instance, dates before 0001-01-01 are not allowed by -the Python date and datetime classes. Additionally fractional seconds are -limited to microseconds. That means if the parser finds for instance -nanoseconds it will round it to microseconds. +%{_description} + +%package -n python3-%{srcname} +Summary: %summary +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +%{_description} -%if 0%{?with_python3} -%package -n python3-%{modulename} -Summary: An ISO 8601 date/time/duration parser and formatter -Group: Development/Languages - -%description -n python3-%{modulename} -This module implements ISO 8601 date, time and duration parsing. The -implementation follows ISO8601:2004 standard, and implements only date/time -representations mentioned in the standard. If something is not mentioned there, -then it is treated as non existent, and not as an allowed option. - -For instance, ISO8601:2004 never mentions 2 digit years. So, it is not intended -by this module to support 2 digit years. (while it may still be valid as ISO -date, because it is not explicitly forbidden.) Another example is, when no time -zone information is given for a time, then it should be interpreted as local -time, and not UTC. - -As this module maps ISO 8601 dates/times to standard Python data types, like -date, time, datetime and timedelta, it is not possible to convert all possible -ISO 8601 dates/times. For instance, dates before 0001-01-01 are not allowed by -the Python date and datetime classes. Additionally fractional seconds are -limited to microseconds. That means if the parser finds for instance -nanoseconds it will round it to microseconds. -%endif %prep -%setup -qn %{modulename}-%{version} +%autosetup -n %{srcname}-%{version} -p1 -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif %build -%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6 -%{__python2} setup.py build -%else -CFLAGS="%{optflags}" %{__python2} -c 'import setuptools; execfile("setup.py")' build -%endif - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd -%endif +%py3_build %install -rm -rf %{buildroot} - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install -O1 --skip-build --root %{buildroot} -popd -%endif - -%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6 -%{__python2} setup.py install -O1 --skip-build --root %{buildroot} -%else -%{__python2} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot} -%endif +%py3_install -%clean -rm -rf %{buildroot} %check -%{__python2} setup.py test - -%if 0%{?with_python3} -pushd %{py3dir} %{__python3} setup.py test -popd -%endif -%files -%defattr(-,root,root,-) +%files -n python3-%{srcname} %doc CHANGES.txt README.rst TODO.txt -%{python2_sitelib}/%{modulename}*.egg-info -%{python2_sitelib}/%{modulename} +%{python3_sitelib}/%{srcname}-*.egg-info/ +%{python3_sitelib}/%{srcname}/ -%if 0%{?with_python3} -%files -n python3-%{modulename} -%doc CHANGES.txt README.rst TODO.txt -%{python3_sitelib}/%{modulename}-*.egg-info -%{python3_sitelib}/%{modulename} -%endif %changelog -* Tue Dec 5 2017 Oyvind Albrigtsen - 0.5.4-8 -- Initial build for RHEL7 +* Wed Jan 27 2021 Fedora Release Engineering - 0.6.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 0.6.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sat May 23 2020 Miro Hrončok - 0.6.0-6 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.6.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Sep 23 2019 Miro Hrončok - 0.6.0-4 +- Subpackage python2-isodate has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Fri Aug 16 2019 Miro Hrončok - 0.6.0-3 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 0.6.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Apr 24 2019 Jeremy Cline - 0.6.0-1 +- Modernize specfile +- Update to 0.6.0 + +* Sat Feb 02 2019 Fedora Release Engineering - 0.5.4-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 0.5.4-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Sat Jun 16 2018 Miro Hrončok - 0.5.4-10 +- Rebuilt for Python 3.7 + +* Mon Feb 12 2018 Iryna Shcherbina - 0.5.4-9 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Fri Feb 09 2018 Fedora Release Engineering - 0.5.4-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Resolves: rhbz#1511223 +* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 0.5.4-7 +- Python 2 binary package renamed to python2-isodate + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 * Thu Jul 27 2017 Fedora Release Engineering - 0.5.4-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild