Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1717665
Summary: | python-pika fails to build with Python 3.8 | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Miro Hrončok <mhroncok> |
Component: | python-pika | Assignee: | Ilia Cheishvili <ilia.cheishvili> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | urgent | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | ilia.cheishvili, jcline, jeremy, projects.rg |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/python-pika/ | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-06-20 07:02:28 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1686977 |
Description
Miro Hrončok
2019-06-05 21:44:54 UTC
======================================================================
FAIL: test_send_method (tests.unit.channel_tests.ChannelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/pika-1.0.1/tests/unit/channel_tests.py", line 1662, in test_send_method
send_method.assert_called_once_with(
File "/usr/lib64/python3.8/unittest/mock.py", line 881, in assert_called_once_with
raise AssertionError(msg)
AssertionError: Expected '_send_method' to be called once. Called 0 times.
>> raise AssertionError("Expected '_send_method' to be called once. Called 0 times.")
This issue is blocking the Python 3.8 rebuilds. If this package won't build with 3.8, it won't be installable, along with all its dependent packages, after the side tag is merged. Furthermore, as it fails to install, its dependent packages will fail to install and/or build as well. The fix should be pushed on the master branch and no release bump is required. 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.8: https://copr.fedorainfracloud.org/coprs/g/python/python3.8/ This issue needs to be resolved by next week, if other rebuilds of Python 3.8 beta 1 go well. If this is unrealistic for you, let us know how much time you need. If you don't have free cycles to dedicate fixing your package, notify us and we'll try to provide some pointers. Let us know if we can push a fix directly without a pull request, in the case we happen to have one before you do. We recommend always consulting with upstream, chances are this is already fixed there. I poked at this a little bit (I'll look more tomorrow), but it seems like the test is failing because the _mock_call changed from CallableMixin._mock_call to AsyncMockMixin._mock_call. If that rings any bells, great, otherwise I'll need to go investigate what changed in 3.8 and what exactly pika is doing in this set of tests. I suspect that can be related to https://bugs.python.org/issue26467 and https://github.com/python/cpython/pull/9296 Okay I've done more poking. It looks like the underlying issue is "import inspect; from unittest import mock; inspect.iscoroutinefunction(mock.MagicMock(spec=lambda x: x))" is True. Creating a mock with a function spec leads to f.__code__ to be defined (as a MagicMock), which in turn is used to determine if the function is async in the mock module by ANDing CO_COROUTINE on the mock object, which of course is a truthy (MagicMock) object. A (maybe) minimal reproducer would be: from unittest import mock mock_obj = mock.MagicMock() mock_obj.mock_func = mock.MagicMock(spec=lambda x: x) with mock.patch.object(mock_obj, "mock_func") as nested: print(type(nested)) I think a fix needs to go into Python's mock to take into account this edge case. Of course, pika shouldn't be mocking out a mock anyway so that should also be fixed. I'm sending a fix to upstream pika now and then I'll see about getting a fix into Python. Okay, I've filed a PR, https://github.com/pika/pika/pull/1225, and added the patch to dist-git, it's python-pika-1.0.1-3 and built in Rawhide. I also left a comment on the PR regarding the Python side of things since I'm not sure how folks might want to fix that. Thanks. The 3.8 rebuild is now blocked by tornado. builds. |