From Fedora Project Wiki

Deprecate python-async-timeout

Summary

The python-async-timeout (python3-async-timeout) package will be deprecated in Fedora 43. The package provides timeout utilities for asyncio, but as of Python 3.11, its functionality has been integrated into the standard library. Fedora packages should use asyncio.Timeout instead. Many still depend on async-timeout, so we cannot remove it yet. Packagers are encouraged to work with upstream to switch to asyncio.Timeout if possible. A simple try-import mechanism can be applied as a temporary (or even permanent) downstream solution.

Owner

Current status

Detailed Description

The python-async-timeout package provides timeout utilities for applications using asyncio module. However, starting from Python 3.11, the core functionality of this package has been integrated into the standard library, and:

  • Version 5.0+ of async-timeout provides dual-mode execution on Python 3.11+, where asyncio_timeout.Timeout is fully compatible with asyncio.Timeout. Update to 5.0.1 in rawhide is in progress.
  • The library is no longer actively supported upstream and exists primarily for backward compatibility and easing migration.

Given that Fedora ships with modern Python versions, using this library as a separate package is redundant. We'd like to encourage both downstream packages and upstream projects to switch to asyncio.Timeout instead. Eventually, we aim to remove python-async-timeout from Fedora entirely. Before attempting removal, we need to prevent new packages from depending on it, hence the deprecation.

Affected packages

As of now (March 2025), there are 29 packages in rawhide depending on python3-async-timeout:

$ dnf repoquery --repo=rawhide,rawhide-source --whatrequires python3-async-timeout
gns3-server-0:2.2.53-3.fc43.noarch
python-aioesphomeapi-0:15.0.0-4.fc42.src
python-aiokafka-0:0.12.0-2.fc42.src
python-async-upnp-client-0:0.14.15-16.fc42.src
python-enturclient-0:0.2.1-16.fc42.src
python-httpx-socks-0:0.10.0-1.fc43.src
python-pycomfoair-0:0.0.4-15.fc42.src
python-pygmtools-0:0.5.3-4.fc42.src
python-pysqueezebox-0:0.5.5-17.fc42.src
python-socks-0:2.7.1-1.fc43.src
python3-aioesphomeapi-0:15.0.0-4.fc42.noarch
python3-aiokafka-0:0.12.0-2.fc42.x86_64
python3-aiopg-0:1.3.4-10.fc42.noarch
python3-async-upnp-client-0:0.14.15-16.fc42.noarch
python3-dingz-0:0.5.0-10.fc42.noarch
python3-enturclient-0:0.2.1-16.fc42.noarch
python3-epson-projector-0:0.2.3-15.fc42.noarch
python3-glances-api-0:0.2.0-23.fc42.noarch
python3-hole-0:0.7.0-9.fc42.noarch
python3-httpx-socks+asyncio-0:0.10.0-1.fc43.noarch
python3-metno-0:0.8.1-15.fc42.noarch
python3-netdata-0:0.2.0-17.fc42.noarch
python3-opensensemap-api-0:0.1.5-23.fc42.noarch
python3-pycomfoair-0:0.0.4-15.fc42.noarch
python3-pygmtools-0:0.5.3-4.fc42.noarch
python3-pysqueezebox-0:0.5.5-17.fc42.noarch
python3-volkszaehler-0:0.2.1-15.fc42.noarch
python3-waqiasync-0:1.0.0-15.fc42.noarch
python3-webthing-ws-0:0.1.0-19.fc42.noarch

How to migrate to asyncio.Timeout

For projects that need to maintain compatibility with both old and new Python versions, performing the following conditional import should be enough:

import sys
if sys.version_info >= (3, 11):
    from asyncio import timeout, timeout_at
else:
    from async_timeout import timeout, timeout_at

Upstream projects should also depend on async-timeout only for Python releases older than 3.11:

"async-timeout; python_version < '3.11'"

Benefit to Fedora

Eventually, we might be able to eliminate the need to maintain a separate timeout library for asyncio, reducing redundancy and improving compatibility with upstream Python.

Scope

  • Proposal owners: Deprecate python3-async-timeout and update its package description. Provide migration assistance to other packagers if needed.
  • Other developers: No immediate action required, but developers are encouraged to transition their packages to asyncio.Timeout where possible.
  • Release engineering: No impact on Release Engineering is anticipated.
  • Policies and guidelines: N/A (not a System Wide Change).
  • Trademark approval: N/A (not needed for this Change).
  • Alignment with Objectives: N/A (not needed for this Change).

Upgrade/compatibility impact

The package will remain available in Fedora for now, but new packages should not depend on it. Eventually, when it is retired, we do not plan to obsolete/provide python3-async-timeout from python3-libs, since its import name differs. The package will eventually be obsoleted by fedora-obsolete-packages.

How To Test

 $ repoquery --repo=rawhide --provides python3-async-timeout
 ...
 deprecated()
 ...

User Experience

No immediate changes for end users. Developers should transition to asyncio.Timeout as their codebases update to Python 3.11+.

Dependencies

N/A (not a System Wide Change).

Contingency Plan

  • Contingency mechanism: N/A (not a System Wide Change).
  • Contingency deadline: N/A (not a System Wide Change).
  • Blocks release? No.

Documentation

Python asyncio.timeout documentation

Release Notes

The python-async-timeout package has been deprecated in Fedora. Developers are encouraged to migrate to asyncio.Timeout in Python 3.11+ for improved compatibility with the standard library.