Fedora Account System
Red Hat Associate
Red Hat Customer
python-pyglet fails to build with Python 3.11.0a7. =================================== FAILURES =================================== _________________________ test_push_handlers_instance __________________________ dispatcher = <pyglet.event.EventDispatcher object at 0x7fecc7738d90> mock_instance_handler = <Mock id='140654356780816'> def test_push_handlers_instance(dispatcher, mock_instance_handler): dispatcher.push_handlers(mock_instance_handler) > result = dispatcher.dispatch_event('mock_event') tests/unit/test_events.py:81: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyglet/event.py:404: in dispatch_event handler = handler() /usr/lib64/python3.11/weakref.py:73: in __call__ return self._meth_type(func, obj) /usr/lib64/python3.11/unittest/mock.py:1090: in __init__ _safe_super(CallableMixin, self).__init__( /usr/lib64/python3.11/unittest/mock.py:442: in __init__ self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[AttributeError('_mock_methods') raised in repr()] Mock object at 0x7feca5010cd0> spec = <Mock name='mock.mock_event.__func__' id='140654357321744'> spec_set = None, _spec_as_instance = False, _eat_self = False def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False, _eat_self=False): if _is_instance_mock(spec): > raise InvalidSpecError(f'Cannot spec a Mock object. [object={spec!r}]') E unittest.mock.InvalidSpecError: Cannot spec a Mock object. [object=<Mock name='mock.mock_event.__func__' id='140654357321744'>] /usr/lib64/python3.11/unittest/mock.py:493: InvalidSpecError bpo-43478: Mocks can no longer be provided as the specs for other Mocks. As a result, an already-mocked object cannot be passed to mock.Mock(). This can uncover bugs in tests since these Mock-derived Mocks will always pass certain tests (e.g. isinstance) and builtin assert functions (e.g. assert_called_once_with) will unconditionally pass. https://bugs.python.org/issue?@action=redirect&bpo=43478 https://docs.python.org/3.11/whatsnew/3.11.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/04369678-python-pyglet/ For all our attempts to build python-pyglet with Python 3.11, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-pyglet/ 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.11: https://copr.fedorainfracloud.org/coprs/g/python/python3.11/ Let us know here if you have any questions. Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11. 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.
Since this is a test issue (with mocking) I've skipped the test for now. Can be eventually fixed upstream.