Bug 2346504 - python-hamcrest fails to build with Python 3.14: RuntimeError: There is no current event loop in thread 'MainThread'.
Summary: python-hamcrest fails to build with Python 3.14: RuntimeError: There is no cu...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-hamcrest
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ali Erdinc Koroglu
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2025-02-19 09:21 UTC by Karolina Surma
Modified: 2025-02-19 09:21 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2025-02-19 09:21:20 UTC
python-hamcrest fails to build with Python 3.14.0a5.

____ FutureExceptionTest.testMatchesRegularExpressionToStringifiedException ____

self = <hamcrest_unit_test.core.future_test.FutureExceptionTest testMethod=testMatchesRegularExpressionToStringifiedException>

    def testMatchesRegularExpressionToStringifiedException(self):
        async def test():
            self.assert_matches(
                "Regex",
                future_raising(AssertionError, "(3, 1, 4)"),
                await resolved(raise_exception(3, 1, 4)),
            )
    
            self.assert_matches(
                "Regex",
                future_raising(AssertionError, r"([\d, ]+)"),
                await resolved(raise_exception(3, 1, 4)),
            )
    
>       asyncio.get_event_loop().run_until_complete(test())

tests/hamcrest_unit_test/core/future_test.py:140: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <asyncio.unix_events._UnixDefaultEventLoopPolicy object at 0x7ff9a5a62a50>

    def get_event_loop(self):
        """Get the event loop for the current context.
    
        Returns an instance of EventLoop or raises an exception.
        """
        if self._local._loop is None:
>           raise RuntimeError('There is no current event loop in thread %r.'
                               % threading.current_thread().name)
E           RuntimeError: There is no current event loop in thread 'MainThread'.

According to https://docs.python.org/dev/whatsnew/3.14.html#id3

Removed implicit creation of event loop by asyncio.get_event_loop(). It now raises a RuntimeError if there is no current event loop. (Contributed by Kumar Aditya in gh-126353.)


https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08662951-python-hamcrest/

For all our attempts to build python-hamcrest with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-hamcrest/

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.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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.


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