Bug 1890444 - python-isodate fails to build with Python 3.10: Tries to use Decimal as an integer
Summary: python-isodate fails to build with Python 3.10: Tries to use Decimal as an in...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-isodate
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: James Laska
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-10-22 08:51 UTC by Tomáš Hrnčiar
Modified: 2021-06-14 09:50 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-14 09:50:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-10-22 08:51:16 UTC
python-isodate fails to build with Python 3.10.0a1.

======================================================================
ERROR: test_totimedelta (isodate.tests.test_duration.DurationTest)
Test conversion form Duration to timedelta.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/isodate-0.6.0/src/isodate/tests/test_duration.py", line 400, in test_totimedelta
    self.assertEqual(dur.totimedelta(datetime(1998, 2, 25)),
  File "/builddir/build/BUILD/isodate-0.6.0/src/isodate/duration.py", line 320, in totimedelta
    return (start + self) - start
  File "/builddir/build/BUILD/isodate-0.6.0/src/isodate/duration.py", line 183, in __add__
    newdt = other.replace(year=newyear, month=newmonth, day=newday)
TypeError: 'decimal.Decimal' object cannot be interpreted as an integer

----------------------------------------------------------------------
Ran 278 tests in 0.070s

FAILED (errors=45)
Test failed: <unittest.runner.TextTestResult run=278 errors=45 failures=0>

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01715721-python-isodate/

For all our attempts to build python-isodate with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-isodate/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2020-10-22 11:53:37 UTC
https://docs.python.org/3.10/whatsnew/3.10.html#other-language-changes

Builtin and extension functions that take integer arguments no longer accept Decimals, Fractions and 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). https://bugs.python.org/issue37999

Comment 2 Miro Hrončok 2020-10-22 11:55:04 UTC
With Python 3.9 (current rawhide) I see the DeprecationWarning about this in build.log: https://koji.fedoraproject.org/koji/buildinfo?buildID=1565949

Comment 3 Dan Scott 2020-10-22 12:27:24 UTC
Looks like we'll need to pull in https://github.com/gweis/isodate/issues/58 ?

Comment 4 Dan Scott 2020-10-22 12:29:00 UTC
Err, the direct link to the pull request is https://github.com/gweis/isodate/pull/60

Upstream has been inactive for over two years.

Comment 5 Tomáš Hrnčiar 2020-10-30 10:26:24 UTC
I have backported upstream PR, see: https://src.fedoraproject.org/rpms/python-isodate/pull-request/4
Builds alright in Copr with Python3.10a1 https://copr.fedorainfracloud.org/coprs/g/python/python3.10/build/1728227/

Comment 6 Miro Hrončok 2021-02-02 16:49:26 UTC
Permission to merge?

Comment 7 Ben Cotton 2021-02-09 15:20:59 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 8 Dan Scott 2021-02-16 04:16:54 UTC
Looks good to me. Thanks Tomáš and Miro!

Comment 9 Miro Hrončok 2021-06-04 20:16:01 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 10 Miro Hrončok 2021-06-07 23:00:21 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.


Note You need to log in before you can comment on or make changes to this bug.