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.8 support #1246

Merged
merged 14 commits into from
Apr 16, 2023
Merged

Drop Python 3.8 support #1246

merged 14 commits into from
Apr 16, 2023

Conversation

adamjstewart
Copy link
Collaborator

@adamjstewart adamjstewart commented Apr 14, 2023

NEP 29 has officially deprecated Python 3.8 support as of today. In the past we've been hesitant to follow NEP 29 because Google Colab was still running Python 3.7, but they've since upgraded to 3.9 already, so that isn't an issue anymore. PyTorch ostensibly follows NEP 29, and many of our other dependencies will soon drop support for 3.8 in their next release, complicating testing. Also, 3.9 and 3.10 introduce native support for type hints, meaning most of our from typing import * lines will be removed.

@adamjstewart adamjstewart added this to the 0.5.0 milestone Apr 14, 2023
@github-actions github-actions bot added dependencies Packaging and dependencies documentation Improvements or additions to documentation testing Continuous integration testing datamodules PyTorch Lightning datamodules datasets Geospatial or benchmark datasets models Models and pretrained weights samplers Samplers for indexing datasets scripts Training and evaluation scripts trainers PyTorch Lightning trainers transforms Data augmentation transforms labels Apr 14, 2023
@adamjstewart
Copy link
Collaborator Author

Discovered a bug in Sphinx in the process of upgrading: sphinx-doc/sphinx#11327

@@ -3,6 +3,9 @@

"""Common dataset utilities."""

# https://github.com/sphinx-doc/sphinx/issues/11327
from __future__ import annotations
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Had to use this hack to get our docs to build properly. This file gives a preview of what type hints will look like in Python 3.10 when Optional and Union become obsolete.

Copy link
Member

Choose a reason for hiding this comment

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

Looks cool!

@adamjstewart adamjstewart marked this pull request as ready for review April 14, 2023 22:19
calebrob6
calebrob6 previously approved these changes Apr 15, 2023
rootdir: ~/torchgeo, configfile: pyproject.toml
plugins: mock-1.11.1, anyio-3.2.1, cov-2.8.1, nbmake-0.5
collected 7 items

tests/datasets/test_foo.py ....... [100%]

---------- coverage: platform darwin, python 3.8.11-final-0 -----------
---------- coverage: platform darwin, python 3.10.11-final-0 -----------
Copy link
Member

Choose a reason for hiding this comment

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

Is this a find and replace artifact?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nah, just noticed it while grepping around and figured we should pretend it was run on a supported version of Python.

@@ -3,6 +3,9 @@

"""Common dataset utilities."""

# https://github.com/sphinx-doc/sphinx/issues/11327
from __future__ import annotations
Copy link
Member

Choose a reason for hiding this comment

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

Looks cool!

@calebrob6
Copy link
Member

Lol 130 files! I didn't check to see if you missed any "Tuple" --> "tuple", etc.

@calebrob6
Copy link
Member

image

@adamjstewart
Copy link
Collaborator Author

Lol 130 files! I didn't check to see if you missed any "Tuple" --> "tuple", etc.

pyupgrade did, this was mostly auto-generated. The only thing I had to do manually was non-Python files and removing imports we no longer use.

@adamjstewart adamjstewart merged commit e0f9ece into main Apr 16, 2023
@adamjstewart adamjstewart deleted the python/3.9 branch April 16, 2023 01:27
yichiac pushed a commit to yichiac/torchgeo that referenced this pull request Apr 29, 2023
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.

2 participants