Skip to content

chore: drop support for Python 3.9#641

Merged
bhimrazy merged 4 commits intoLightning-AI:mainfrom
bhimrazy:drop-py39-support
Dec 11, 2025
Merged

chore: drop support for Python 3.9#641
bhimrazy merged 4 commits intoLightning-AI:mainfrom
bhimrazy:drop-py39-support

Conversation

@bhimrazy
Copy link
Collaborator

@bhimrazy bhimrazy commented Dec 3, 2025

What does this PR do?

Drops support for Python 3.9 and updates the minimum required Python version to 3.10.

Python 3.9 reached status end-of-life as of oct. 25 so lets remove support for it. ref: https://devguide.python.org/versions/


Follow-ups

  • Re-enable UP045 (non-pep604-annotation-optional) and UP007 (non-pep604-annotation-union) lint rules to upgrade to Python 3.10+ syntax (X | None, X | Y)
  • Add Python 3.12 and newer to CI matrix (currently commented as TODO)

PR review

Anyone in the community is free to review the PR once the tests have passed.

Did you have fun?

Make sure you had fun coding 🙃

- Update requires-python to >=3.10
- Remove Python 3.9 classifier
- Update CI to test Python 3.10+ only
- Update ruff target-version to py310
- Remove version checks for 3.9 in tests
- Update imports to use collections.abc.Callable
- Ignore UP045/UP007 for now with TODO to revisit separately
Copy link
Contributor

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 drops support for Python 3.9 and sets the minimum required Python version to 3.10, aligning with Python 3.9's end-of-life status (October 25, 2024).

Key Changes:

  • Updated minimum Python version requirement from 3.9 to 3.10
  • Migrated Callable imports from typing to collections.abc (Python 3.10+ best practice)
  • Removed Python 3.9-specific test skips and version checks

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Updated requires-python to >=3.10, removed Python 3.8/3.9 classifiers, updated ruff target version to py310, and added temporary ignores for PEP 604 annotation rules
.github/workflows/ci-testing.yml Removed Python 3.9 from test matrix, updated oldest supported version test to use Python 3.10
tests/unit/test_mcp.py Removed Python < 3.10 version check that previously skipped the entire module
tests/unit/test_cli.py Updated test skip decorators to only skip on Python 3.10 (removed 3.9 from conditions)
src/litserve/specs/base.py Migrated Callable import from typing to collections.abc
src/litserve/server.py Migrated Callable import from typing to collections.abc
src/litserve/api.py Migrated Callable import from typing to collections.abc

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

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85%. Comparing base (d1c4492) to head (985adc5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #641   +/-   ##
===================================
- Coverage    85%    85%   -0%     
===================================
  Files        39     39           
  Lines      3189   3189           
===================================
- Hits       2700   2696    -4     
- Misses      489    493    +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@aniketmaurya aniketmaurya left a comment

Choose a reason for hiding this comment

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

I would suggest to drop the tests but allow the package installation for 3.9.

I know some companies have constraints on upgrading Python versions etc. so essentially we will be stooping them from using the latest version of LitServe. And this way we can say that, you can try it but not tested so better upgrade.

For example, FastAPI is still to drop Python 3.8 support even after 1 year of EOL.

I'd invite maintainers to chime in and put their opinion.

@andyland
Copy link
Collaborator

I would suggest to drop the tests but allow the package installation for 3.9.

I know some companies have constraints on upgrading Python versions etc. so essentially we will be stooping them from using the latest version of LitServe. And this way we can say that, you can try it but not tested so better upgrade.

For example, FastAPI is still to drop Python 3.8 support even after 1 year of EOL.

I'd invite maintainers to chime in and put their opinion.

I don't think we want to suggest compatibility with something we don't test and explicitly don't support

@bhimrazy bhimrazy merged commit 274018e into Lightning-AI:main Dec 11, 2025
20 checks passed
@bhimrazy bhimrazy deleted the drop-py39-support branch December 11, 2025 20:01
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.

5 participants