Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.9 support #1966

Merged
merged 5 commits into from
Apr 4, 2024
Merged

Conversation

adamjstewart
Copy link
Collaborator

@adamjstewart adamjstewart commented Mar 27, 2024

It's that time of year again!

We've been following NEP 29 for a while now to decide when to drop support for older Python versions. However, NEP 29 is now superseded by SPEC 0. Although NEP 29 adopted a 3.5 year support strategy, SPEC 0 now adopts a shorter 3 year support strategy. Since a new Python minor release happens once a year, this means support for the 3 most recent Python minor versions. However, PyTorch is slow to adopt the latest Python version after it gets released, so I propose waiting until it is fully supported before dropping the oldest version.

The biggest change in Python 3.10 is support for X | Y as a replacement for typing.Union[X, Y] and X | None as a replacement for Optional[X]. This means that typing no longer needs to be imported by most files! It's also an excuse to bump the minimum supported version for many of our dependencies.

@adamjstewart adamjstewart added this to the 0.6.0 milestone Mar 27, 2024
@github-actions github-actions bot added documentation Improvements or additions to documentation testing Continuous integration testing dependencies Packaging and dependencies labels Mar 27, 2024
@github-actions github-actions bot added datasets Geospatial or benchmark datasets models Models and pretrained weights samplers Samplers for indexing datasets trainers PyTorch Lightning trainers transforms Data augmentation transforms datamodules PyTorch Lightning datamodules scripts Training and evaluation scripts labels Mar 27, 2024
@adamjstewart adamjstewart marked this pull request as ready for review March 28, 2024 09:32
@adamjstewart
Copy link
Collaborator Author

adamjstewart commented Apr 2, 2024

Can also use the new match-case statement introduced in 3.10 in places like DataModule.setup.

This is an if expression, not an elif expression. And Python match statements do not support fall-through.

Copy link
Collaborator

@isaaccorley isaaccorley left a comment

Choose a reason for hiding this comment

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

I double checked each change and looks good

@adamjstewart adamjstewart merged commit ea57469 into microsoft:main Apr 4, 2024
23 checks passed
@adamjstewart adamjstewart deleted the python/3.9 branch April 4, 2024 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datamodules PyTorch Lightning datamodules datasets Geospatial or benchmark datasets dependencies Packaging and dependencies documentation Improvements or additions to documentation models Models and pretrained weights samplers Samplers for indexing datasets scripts Training and evaluation scripts testing Continuous integration testing trainers PyTorch Lightning trainers transforms Data augmentation transforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants