Skip to content

Drop Python 3.9 and 3.10 support - #423

Merged
alessio-locatelli merged 1 commit into
requests-cache:mainfrom
alessio-locatelli:drop_python_39_and_310
Oct 7, 2026
Merged

alessio-locatelli merged 1 commit into
requests-cache:mainfrom
alessio-locatelli:drop_python_39_and_310

Conversation

@alessio-locatelli

Copy link
Copy Markdown
Collaborator

No description provided.

Both versions have reached end-of-life, so the minimum supported
version is now 3.11.

That makes the remaining compatibility code unnecessary:

- `Self` and `Unpack` come from `typing`, so the `typing-extensions`
  dependency is gone.
- `contextlib.nullcontext` is used directly instead of an async
  fallback class.
- `parse_http_date()` no longer catches `TypeError`, which only
  `parsedate_to_datetime()` before Python 3.10 raised for unparseable
  strings.
- Tests use `asyncio.timeout()` instead of the `async-timeout` dev
  dependency.
- The docs dependency group no longer needs its `python_version>='3.11'`
  markers.

Raising ruff's target to py311 also rewrites `Union`/`Optional`
aliases to `X | Y`, `typing.Callable` to `collections.abc.Callable`,
and `timezone.utc` to `datetime.UTC`.
@alessio-locatelli
alessio-locatelli marked this pull request as ready for review October 7, 2026 05:04
@alessio-locatelli
alessio-locatelli merged commit abc3ba6 into requests-cache:main Oct 7, 2026
8 checks passed
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.

1 participant