Skip to content

Drop support for Python 3.9#3061

Merged
Kludex merged 4 commits intomainfrom
drop-3.9
Nov 1, 2025
Merged

Drop support for Python 3.9#3061
Kludex merged 4 commits intomainfrom
drop-3.9

Conversation

@Kludex
Copy link
Copy Markdown
Owner

@Kludex Kludex commented Nov 1, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 1, 2025 15:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the minimum Python version requirement from 3.9 to 3.10, enabling the use of newer Python syntax features. The changes modernize the codebase by:

  • Adopting PEP 604 union syntax (X | Y instead of Union[X, Y])
  • Moving Callable imports from typing to collections.abc (PEP 585)
  • Moving ParamSpec from typing_extensions to typing (available in Python 3.10+)
  • Removing Python 3.9-specific conditional imports and version checks
  • Removing Python 3.9 wheels and dependencies from lockfile

Reviewed Changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Updates minimum Python version to 3.10 and removes Python 3.9 classifier
.github/workflows/main.yml Removes Python 3.9 from CI test matrix
uv.lock Removes Python 3.9 wheel entries and simplifies dependency resolution markers
scripts/test Removes Python version conditional logic for coverage branching
starlette/*.py (multiple) Modernizes import statements: moves Callable to collections.abc, uses PEP 604 union syntax, removes version checks
tests/*.py (multiple) Modernizes import statements and type annotations consistent with source changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread starlette/schemas.py

for route in routes:
if isinstance(route, (Mount, Host)):
if isinstance(route, Mount | Host):
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isinstance() function expects a tuple of types, not a union type expression. This should be isinstance(route, (Mount, Host)) to work correctly.

Suggested change
if isinstance(route, Mount | Host):
if isinstance(route, (Mount, Host)):

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll disable you.

@Kludex Kludex enabled auto-merge (squash) November 1, 2025 15:15
@Kludex Kludex disabled auto-merge November 1, 2025 15:15
@Kludex Kludex enabled auto-merge (squash) November 1, 2025 15:15
@Kludex Kludex merged commit a0499f6 into main Nov 1, 2025
6 checks passed
@Kludex Kludex deleted the drop-3.9 branch November 1, 2025 15:16
nixroxursox pushed a commit to nixroxursox/starlette that referenced this pull request Nov 3, 2025
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.

2 participants