8000 [BE][Easy] enable postponed annotations in `torchgen` by XuehaiPan · Pull Request #129376 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[BE][Easy] enable postponed annotations in torchgen #129376

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
wants to merge 20 commits into from

Conversation

[ghstack-poisoned]
Copy link
pytorch-bot bot commented Jun 24, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/129376

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit daa098e with merge base 065c386 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Jun 24, 2024
@XuehaiPan XuehaiPan added module: typing Related to mypy type annotations module: lint Issues related to our Python/C++ lint rules (run by Travis) better-engineering Relatively self-contained tasks for better engineering contributors labels Jun 24, 2024
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jun 24, 2024
ghstack-source-id: f81903d
Pull Request resolved: #129376
@Skylion007
Copy link
Collaborator

Postponed annotations are actually being deprecated in the most recent version of python so I'd rather not enable them for no reason. In fact, I'd rather we disable them everywhere we can. I'm working on adding a ruff rule to enable this.

@Skylion007
Copy link
Collaborator

See #117449

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jun 27, 2024
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jun 27, 2024
Copy link
Contributor
@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

okey dokey

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Jun 28, 2024
…ub files (#129419)

------

- [Generic TypeAlias (PEP 585)](https://peps.python.org/pep-0585): e.g. `typing.List[T] -> list[T]`, `typing.Dict[KT, VT] -> dict[KT, VT]`, `typing.Type[T] -> type[T]`.
- [Union Type (PEP 604)](https://peps.python.org/pep-0604): e.g. `Union[X, Y] -> X | Y`, `Optional[X] -> X | None`, `Optional[Union[X, Y]] -> X | Y | None`.

Note that in `.pyi` stub files, we do not need `from __future__ import annotations`. So this PR does not violate issue #117449:

- #117449

Pull Request resolved: #129419
Approved by: https://github.com/ezyang
ghstack dependencies: #129375, #129376
pytorchmergebot added a commit 8000 that referenced this pull request Jun 29, 2024
This reverts commit 494057d.

Reverted #129376 on behalf of https://github.com/huydhn due to Sorry for reverting your change but I need to revert to cleanly revert #129374, please do a rebase and reland this ([comment](#129375 (comment)))
@pytorchmergebot
Copy link
Collaborator

@XuehaiPan your PR has been successfully reverted.

[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jun 29, 2024
pytorchmergebot pushed a commit that referenced this pull request Jun 29, 2024
…ub files (#129419)

------

- [Generic TypeAlias (PEP 585)](https://peps.python.org/pep-0585): e.g. `typing.List[T] -> list[T]`, `typing.Dict[KT, VT] -> dict[KT, VT]`, `typing.Type[T] -> type[T]`.
- [Union Type (PEP 604)](https://peps.python.org/pep-0604): e.g. `Union[X, Y] -> X | Y`, `Optional[X] -> X | None`, `Optional[Union[X, Y]] -> X | Y | None`.

Note that in `.pyi` stub files, we do not need `from __future__ import annotations`. So this PR does not violate issue #117449:

- #117449

Pull Request resolved: #129419
Approved by: https://github.com/ezyang
ghstack dependencies: #129375, #129376
@github-actions github-actions bot deleted the gh/XuehaiPan/69/head branch July 31, 2024 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better-engineering Relatively self-contained tasks for better engineering contributors Merged module: lint Issues related to our Python/C++ lint rules (run by Travis) module: typing Related to mypy type annotations open source Reverted skip-pr-sanity-checks suppress-bc-linter Suppresses the failures of API backward-compatibility linter (Lint/bc_linter) topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0