Skip to content

Run mypy on some test files, add iinfo/finfo annotations#38220

Closed
rgommers wants to merge 2 commits intopytorch:masterfrom
rgommers:mypy-on-tests
Closed

Run mypy on some test files, add iinfo/finfo annotations#38220
rgommers wants to merge 2 commits intopytorch:masterfrom
rgommers:mypy-on-tests

Conversation

@rgommers
Copy link
Copy Markdown
Collaborator

Most test files have a ton of errors; there's not much point adding ignores for them though. The way of working is simply to run mypy test/test_somefile.py, fix up the errors, then add that file to the files = list in mypy.ini.

Can't add all of test/* by default, because the JIT test files have (on purpose) syntax errors that are meant to exercise the robustness of the JIT to bad annotations. Leave those alone for now.

Depends on the ghstacked PRs in gh-38173, only the last 2 commits are new.

@rgommers rgommers added the module: typing Related to mypy type annotations label May 11, 2020
@rgommers rgommers requested review from albanD and apaszke as code owners May 11, 2020 10:26
@rgommers rgommers requested a review from ezyang May 11, 2020 10:27
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 11, 2020

💊 CI failures summary and remediations

As of commit 121a216 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker.

See how this bot performed.

This comment has been revised 4 times.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@ezyang merged this pull request in cebf5a8.

@rgommers rgommers deleted the mypy-on-tests branch May 12, 2020 08:09
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Most test files have a ton of errors; there's not much point adding ignores for them though. The way of working is simply to run `mypy test/test_somefile.py`, fix up the errors, then add that file to the `files =` list in `mypy.ini`.

Can't add all of `test/*` by default, because the JIT test files have (on purpose) syntax errors that are meant to exercise the robustness of the JIT to bad annotations. Leave those alone for now.

_Depends on the ghstacked PRs in pytorchgh-38173, only the last 2 commits are new._
Pull Request resolved: pytorch#38220

Differential Revision: D21503481

Pulled By: ezyang

fbshipit-source-id: 63026e73201c549d64647a03a20a4c6687720244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: typing Related to mypy type annotations open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants