8000 Drop Python 3.8 and 3.9 support (following NEP 29) · Issue #129805 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Drop Python 3.8 and 3.9 support (following NEP 29) #129805

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

Closed
isuruf opened this issue Jun 29, 2024 · 4 comments
Closed

Drop Python 3.8 and 3.9 support (following NEP 29) #129805

isuruf opened this issue Jun 29, 2024 · 4 comments
Labels
module: python frontend For issues relating to PyTorch's Python frontend oncall: releng In support of CI and Release Engineering release notes: releng release notes category tracker A tracking issue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@isuruf
Copy link
Collaborator
isuruf commented Jun 29, 2024

#74203 adopted NEP29 and the schedule says that Python 3.8 was dropped on Apr 14, 2023, and Python 3.9 a week ago
on Jun 22, 2024.

Is there any issue with dropping these Python versions?

This can also help with unifying numpy versions in #128860.


This can also help with the type annotation issue for #117449.

  1. When we drop Python 3.8, we can use generic type-alias which are added in Python 3.9.

    This allows us to remove lots of imports from typing and also resolve an issue commented on Use Generic TypeAlias (PEP 585) and Union Type (PEP 604) in generated .pyi stub files #129420 (comment).

    This migration is auto-fixable by ruff rule non-pep585-annotation (UP006) when we set target-version to py39.

  2. When we drop Python 3.9, we can use union-type which is added in Python 3.10.

    • Union Type (PEP 604): e.g. Union[X, Y] -> X | Y, Optional[X] -> X | None, Optional[Union[X, Y]] -> X | Y | None.

    This allows us to remove the import of typing.Union and typing.Optional and completely remove from __future__ import annotations.

    This migration is auto-fixable by ruff rule non-pep604-annotation (UP007) when we set target-version to py310.


### Tasks
- [ ] https://github.com/pytorch/pytorch/issues/128860
- [ ] https://github.com/pytorch/pytorch/issues/117449
- [ ] https://github.com/pytorch/pytorch/pull/129420
- [ ] https://github.com/pytorch/pytorch/pull/129419
- [ ] https://github.com/pytorch/pytorch/pull/129375
- [ ] https://github.com/pytorch/pytorch/pull/129376

cc @albanD @malfet

@XuehaiPan XuehaiPan added release notes: releng release notes category oncall: releng In support of CI and Release Engineering labels Jun 30, 2024
@XuehaiPan XuehaiPan pinned this issue Jun 30, 2024
@XuehaiPan XuehaiPan added the module: python frontend For issues relating to PyTorch's Python frontend label Jun 30, 2024
@XuehaiPan
Copy link
Collaborator

Tweaked the issue comment for better readability.

@XuehaiPan XuehaiPan added the tracker A tracking issue label Jun 30, 2024
@soulitzer soulitzer added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jul 2, 2024
@albanD albanD unpinned this issue Jul 8, 2024
@albanD
Copy link
Collaborator
albanD commented Jul 8, 2024

Hey!
I would be curious if you have any comment on pytorch/rfcs#65 ?
This would delay the removal of 3.9 and for sure prevent dropping 3.10 later this year.

In this case, I don't think typing improvement is a big enough win for us to potentially break quite a lot of users based on https://pypistats.org/packages/torch

@clee2000
Copy link
Contributor
clee2000 commented Jul 9, 2024

Just adding that the RFC for dropping 3.8 #120718

@clee2000 clee2000 moved this to Cold Storage in PyTorch OSS Dev Infra Jul 9, 2024
@albanD
Copy link
Collaborator
albanD commented Jul 17, 2024

The policy change in the RFC was accepted so I'm going to close this issue for now as we can use #120718 for the 3.8 deprecation coming soon and we have a whole year for 3.9

@isuruf could you comment on that issue with the points above about improvements we can make once 3.8 is dropped?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: python frontend For issues relating to PyTorch's Python frontend oncall: releng In support of CI and Release Engineering release notes: releng release notes category tracker A tracking issue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Archived in project
Development

No branches or pull requests

6 participants
@isuruf @albanD @soulitzer @XuehaiPan @clee2000 and others
0