Bug 1706212 - python-pint FTBFS with Python 3.8
Summary: python-pint FTBFS with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pint
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Matthias Runge
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-05-03 19:47 UTC by Charalampos Stratakis
Modified: 2019-09-05 07:05 UTC (History)
3 users (show)

Fixed In Version: python-pint-0.9-5.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-05 07:05:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Full log from Copr (266.79 KB, text/plain)
2019-05-03 19:47 UTC, Charalampos Stratakis
no flags Details

Description Charalampos Stratakis 2019-05-03 19:47:19 UTC
Created attachment 1562703 [details]
Full log from Copr

python-pint-0.9-2 fails to build with Python 3.8:

======================================================================
ERROR: test_nonnumeric_magnitudes (test_quantity.TestQuantityToCompact)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Pint-0.9/pint/testsuite/test_quantity.py", line 419, in test_nonnumeric_magnitudes
    self.assertRaises(RuntimeError, self.compareQuantity_compact(x,x))
  File "/usr/lib64/python3.8/unittest/case.py", line 799, in assertRaises
    return context.handle('assertRaises', args, kwargs)
  File "/usr/lib64/python3.8/unittest/case.py", line 214, in handle
    callable_obj(*args, **kwargs)
TypeError: 'NoneType' object is not callable

Full log attached

Comment 1 Karthikeyan Singaravelan 2019-06-29 04:48:07 UTC
In 3.7 the tests were emitting a DeprecationWarning that callable cannot be None to assertRaises. Now in Python 3.8 it's an error with https://bugs.python.org/issue34318.

pytest -s pint/testsuite/test_quantity.py::TestQuantityToCompact::test_nonnumeric_magnitudes
======================================== test session starts ========================================
platform linux -- Python 3.7.0, pytest-4.0.0, py-1.7.0, pluggy-0.8.0
rootdir: /home/karthi/pint, inifile:
plugins: rerunfailures-7.0, repeat-0.8.0, cov-2.6.0, forked-0.2, xdist-1.25.0, httpbin-0.3.0, mock-1.10.0
collected 1 item

pint/testsuite/test_quantity.py None
.

========================================= warnings summary ==========================================
pint/testsuite/test_quantity.py::TestQuantityToCompact::test_nonnumeric_magnitudes
  /home/karthi/pint/pint/testsuite/test_quantity.py:403: RuntimeWarning: to_compact applied to non numerical types has an undefined behavior.
    self.assertQuantityAlmostIdentical(q.to_compact(unit=unit),
  /home/karthi/pint/pint/testsuite/test_quantity.py:458: DeprecationWarning: callable is None
    self.assertRaises(RuntimeError, self.compareQuantity_compact(x,x))

-- Docs: https://docs.pytest.org/en/latest/warnings.html

Comment 2 Karthikeyan Singaravelan 2019-06-29 05:03:26 UTC
Upstream PR to fix the tests and DeprecationWarning on 3.8 : https://github.com/hgrecco/pint/pull/824

Comment 3 Miro Hrončok 2019-07-10 11:11:36 UTC
Matthias, let's backport the fix?

Comment 4 Matthias Runge 2019-07-10 11:22:22 UTC
Yes, makes sense to me.

Comment 5 Miro Hrončok 2019-07-11 09:14:17 UTC
python-pint still fails to build with Python 3.8.0b2.


======================================================================
ERROR: test_nonnumeric_magnitudes (test_quantity.TestQuantityToCompact)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Pint-0.9/pint/testsuite/test_quantity.py", line 419, in test_nonnumeric_magnitudes
    self.assertRaises(RuntimeError, self.compareQuantity_compact(x,x))
  File "/usr/lib64/python3.8/unittest/case.py", line 811, in assertRaises
    return context.handle('assertRaises', args, kwargs)
  File "/usr/lib64/python3.8/unittest/case.py", line 197, in handle
    callable_obj(*args, **kwargs)
TypeError: 'NoneType' object is not callable

----------------------------------------------------------------------
Ran 799 tests in 23.263s

FAILED (errors=1, skipped=15, expected failures=14)


From a quick look at the spec, the patch doesn't seem to be applied.

Comment 6 Miro Hrončok 2019-07-11 09:15:50 UTC
But when applied, it fails:


Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Oxuw56
+ umask 022
+ cd /home/churchyard/rpmbuild/fedora-scm/python-pint
+ cd /home/churchyard/rpmbuild/fedora-scm/python-pint
+ rm -rf Pint-0.9
+ /usr/bin/gzip -dc /home/churchyard/rpmbuild/fedora-scm/python-pint/Pint-0.9.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd Pint-0.9
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/bin/cat /home/churchyard/rpmbuild/fedora-scm/python-pint/955102b318a4ecc34afd0f366e826ef174fe647b.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch
1 out of 2 hunks FAILED -- saving rejects to file pint/testsuite/test_quantity.py.rej
error: Bad exit status from /var/tmp/rpm-tmp.Oxuw56 (%prep)

Comment 7 Matthias Runge 2019-07-11 16:04:19 UTC
ugh, will have a look

Comment 8 Ben Cotton 2019-08-13 17:12:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 9 Ben Cotton 2019-08-13 19:03:17 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 10 Miro Hrončok 2019-08-14 22:24:20 UTC
The coordinated rebuild of Python 3.8 has started in the `f32-python` side tag.

If you figure out how to rebuild this package, please don't rebuild it in regular rawhide, but use the side tag instead:

    on branch master:
    $ fedpkg build --target=f32-python

To wait for a build to show up in the side tag, do:

    $ koji wait-repo f32-python --build=<nvr>

Where <nvr> is name-version-release of the source package, e.g. python-foo-1.1-2.fc32.

An updated mock config is posted at:
http://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Note that it will take a while before the essential packages are rebuilt, so don't expect all your dependencies to be available right away.

Thanks. Let us know if you need up to date info, or if you have any questions.



PS this message is mass posted to all the bugs that block the PYTHON38 bug. If this is also a Fedora 31 FTBFS bug and you manage to fix it, you can do a f31 build as usual:

    on branch f31:
    $ fedpkg build

Comment 11 Miro Hrončok 2019-08-21 16:34:34 UTC
The f32-python side tag has been merged. In order to rebuild the package, do it in regular rawhide, but please wait until python3-3.8 is tagged:

  $ koji wait-repo f32-build --build python3-3.8.0~b3-3.fc32


If your built already started in f32-python, after it is finished, please tag it to rawhide with:

  $ koji tag-build f32-pending <nvr>

For example:

  $ koji tag-build f32-pending libreoffice-6.3.0.4-3.fc32

Thanks!

(This comment is mass posted to all bugzillas blocking the PYTHON38 tracking bug.)

Comment 12 Miro Hrončok 2019-08-21 17:29:07 UTC
(Python 3.8 has landed in the rawhide buildroot.)


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