Skip to content

debt: remove async-timeout in favor of asyncio.timeout - #2120

Open
RohithPariki wants to merge 1 commit into
apify:masterfrom
RohithPariki:issue-2052
Open

debt: remove async-timeout in favor of asyncio.timeout#2120
RohithPariki wants to merge 1 commit into
apify:masterfrom
RohithPariki:issue-2052

Conversation

@RohithPariki

Copy link
Copy Markdown

Fixes #2052

Description

This PR drops the deprecated async-timeout dependency in favor of the standard library's asyncio.timeout, as the functionality was upstreamed into Python 3.11+.

As discussed in the issue (and targeting the 2.0 milestone), this PR drops support for Python 3.10 to allow for the clean path of using the standard library directly without version-guarded imports.

Changes Made

  • pyproject.toml: Removed async-timeout from dependencies and bumped requires-python (and related classifiers) to >=3.11.
  • src/crawlee/_utils/time.py: Replaced async_timeout.timeout with asyncio.timeout inside the SharedTimeout class. Retained the existing context manager logic as asyncio.timeout also serves as a drop-in async context manager in Python 3.11+.

Verification

  • Verified that SharedTimeout successfully catches operations exceeding the budget and properly propagates TimeoutError.
  • Ran ruff to ensure formatting and linting rules are upheld.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove async-timeout dependency in favor of stdlib asyncio.timeout

2 participants