Bug 1958928

Summary: python-subprocess-tee fails to build with Python 3.10: DeprecationWarning: There is no current event loop (treated as error)
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-subprocess-teeAssignee: chedi toueiti <chedi.toueiti>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 35CC: awilliam, chedi.toueiti, mhroncok, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AcceptedFreezeException
Fixed In Version: python-subprocess-tee-0.3.2-1.fc35 python-subprocess-tee-0.3.2-1.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-07 19:06:56 UTC Type: Bug
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: 1890881, 1891954, 1927309, 1927313, 1992484    

Description Miro Hrončok 2021-05-10 12:44:16 UTC
python-subprocess-tee fails to build with Python 3.10.0b1:

...
lib/subprocess_tee/test/test_rich.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
args = 'echo 123', kwargs = {}, cmd = 'echo 123'
    def run(args: Union[str, List[str]], **kwargs: Any) -> CompletedProcess:
        """Drop-in replacement for subprocerss.run that behaves like tee.
    
        Extra arguments added by our version:
        echo: False - Prints command before executing it.
        quiet: False - Avoid printing output
        """
        if isinstance(args, str):
            cmd = args
        else:
            # run was called with a list instead of a single item but asyncio
            # create_subprocess_shell requires command as a single string, so
            # we need to convert it to string
            cmd = join(args)
    
        if kwargs.get("echo", False):
            print(f"COMMAND: {cmd}")
    
>       loop = asyncio.get_event_loop()
E       DeprecationWarning: There is no current event loop

...
FAILED lib/subprocess_tee/test/test_rich.py::test_rich_console_ex - Deprecati...
FAILED lib/subprocess_tee/test/test_rich.py::test_rich_console_ex_ansi - Depr...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_string - DeprecationWar...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_list - DeprecationWarni...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_echo - DeprecationWarni...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_with_env[auto] - Deprec...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_with_env[sh] - Deprecat...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_with_env[bash] - Deprec...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_with_env[zsh] - Depreca...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_shell - DeprecationWarn...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_shell_undefined - Depre...
FAILED lib/subprocess_tee/test/test_unit.py::test_run_cwd - DeprecationWarnin...
============================== 12 failed in 0.39s ==============================


https://docs.python.org/3.10/whatsnew/3.10.html#deprecated
"""
asyncio.get_event_loop() now emits a deprecation warning if there is no running event loop. In the future it will be an alias of get_running_loop(). asyncio functions which implicitly create a Future or Task objects now emit a deprecation warning if there is no running event loop and no explicit loop argument is passed: ensure_future(), wrap_future(), gather(), shield(), as_completed() and constructors of Future, Task, StreamReader, StreamReaderProtocol.
"""
https://bugs.python.org/issue39529

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

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

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 2021-06-04 20:14:53 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 2 Miro Hrončok 2021-06-07 22:59:25 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.

Comment 3 Miro Hrončok 2021-06-08 11:33:59 UTC
*** Bug 1969147 has been marked as a duplicate of this bug. ***

Comment 4 Miro Hrončok 2021-06-15 20:27:48 UTC
Hello,

This is the first reminder (step 3 from https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs).

If you know about this problem and are planning on fixing it, please acknowledge so by setting the bug status to ASSIGNED. If you don't have time to maintain this package, consider orphaning it, so maintainers of dependent packages realize the problem.

Comment 5 Ben Cotton 2021-08-10 13:01:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 6 Miro Hrončok 2021-08-23 11:52:51 UTC
Chedi, what is the status? Are you working on a fix? Was this reported upstream?

Comment 7 Miro Hrončok 2021-08-30 22:36:38 UTC
Friendly bump after a week.

Comment 8 Fedora Update System 2021-09-01 10:53:26 UTC
FEDORA-2021-403d61ff1b has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-403d61ff1b

Comment 9 Fedora Update System 2021-09-01 12:30:07 UTC
FEDORA-2021-8692fc5db3 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-8692fc5db3

Comment 10 Miro Hrončok 2021-09-01 14:07:29 UTC
Nominating for Beta Freeze Exception as the package does not even install without the fix.

Comment 11 Fedora Update System 2021-09-01 19:27:10 UTC
FEDORA-2021-8692fc5db3 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-8692fc5db3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-8692fc5db3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2021-09-01 20:20:19 UTC
FEDORA-2021-403d61ff1b has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-403d61ff1b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-403d61ff1b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Miro Hrončok 2021-09-02 09:31:15 UTC
Hello,

Please note that this comment was generated automatically. If you feel that this output has mistakes, please contact me via email (mhroncok).

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 36.

Thanks for taking care of it!

Comment 14 Adam Williamson 2021-09-06 15:10:51 UTC
+3 in https://pagure.io/fedora-qa/blocker-review/issue/424 , marking accepted.

Comment 15 Fedora Update System 2021-09-07 19:06:56 UTC
FEDORA-2021-8692fc5db3 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2021-09-09 17:31:54 UTC
FEDORA-2021-403d61ff1b has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.