Skip to content

fix: use stdlib asyncio.timeout instead of the deprecated async-timeout - #2163

Draft
aryansk wants to merge 1 commit into
apify:masterfrom
aryansk:fix/2052-stdlib-timeout
Draft

fix: use stdlib asyncio.timeout instead of the deprecated async-timeout#2163
aryansk wants to merge 1 commit into
apify:masterfrom
aryansk:fix/2052-stdlib-timeout

Conversation

@aryansk

@aryansk aryansk commented Aug 15, 2026

Copy link
Copy Markdown

Closes #2052

Summary

Drops the deprecated async-timeout dependency for Python 3.11+ and uses the stdlib equivalent, per #2052.

  • crawlee/_utils/time.py now imports asyncio.timeout / asyncio.Timeout on Python 3.11+ and falls back to the async-timeout backport only on 3.10 — the two APIs are drop-in identical for SharedTimeout.
  • async-timeout>=5.0.1 becomes an environment-marked dependency (python_version < '3.11'), so 3.11+ installs no longer pull the deprecated package (the issue's "effectively upstreamed into Python 3.11+" README note). Python 3.10 support is unchanged.
  • uv.lock regenerated for the marker.

Validation

  • tests/unit/_utils/ — 294 passed on Python 3.13 (stdlib path exercised, incl. test_shared_timeout.py).
  • test_shared_timeout.py — 4/4 passed on Python 3.10 (backport path).
  • Full tests/unit — 2166 passed; the 98 failures/26 errors are all in Playwright/stagehand browser tests that require the Playwright browser executable (not installed in this environment), unrelated to this change.
  • ruff check + ruff format --check clean on the changed file.

…ut (apify#2052)

- `crawlee/_utils/time.py` now imports `asyncio.timeout`/`asyncio.Timeout`
  on Python 3.11+ and falls back to the `async-timeout` backport only on
  3.10 (the API is identical).
- `async-timeout` is now an environment-marked dependency
  (`python_version < '3.11'`), so 3.11+ installs no longer pull the
  deprecated package.
- `uv.lock` regenerated for the marker.

Co-Authored-By: Codebuff <noreply@codebuff.com>
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