Skip to content

Add pyright to test suite, pyrightconfig.json - #5059

Merged
srittau merged 12 commits into
python:masterfrom
jakebailey:pyright-1
Feb 23, 2021
Merged

srittau merged 12 commits into
python:masterfrom
jakebailey:pyright-1

Conversation

@jakebailey

@jakebailey jakebailey commented Feb 23, 2021 •

Copy link
Copy Markdown
Contributor

Fixes #5048.

Building on #5051, with some modifications.

@jakebailey jakebailey mentioned this pull request Feb 23, 2021
@srittau

srittau commented Feb 23, 2021

Copy link
Copy Markdown
Collaborator

I have merged the warning fixes to master now.

@jakebailey

Copy link
Copy Markdown
Contributor Author

Still a couple of errors, it seems.

/home/runner/work/typeshed/typeshed/stdlib/fractions.pyi
  123:9 - error: Overload 1 for "__pow__" overlaps overload 2 and returns an incompatible type (reportGeneralTypeIssues)
/home/runner/work/typeshed/typeshed/stdlib/functools.pyi
  94:9 - error: Overload 1 for "register" overlaps overload 2 and returns an incompatible type (reportGeneralTypeIssues)
  113:13 - error: Overload 1 for "register" overlaps overload 2 and returns an incompatible type (reportGeneralTypeIssues)
/home/runner/work/typeshed/typeshed/stdlib/tempfile.pyi
  329:5 - error: Overload 1 for "mkdtemp" overlaps overload 2 and returns an incompatible type (reportGeneralTypeIssues)
/home/runner/work/typeshed/typeshed/stdlib/asyncio/tasks.pyi
  54:5 - error: Overload 1 for "gather" overlaps overload 7 and returns an incompatible type (reportGeneralTypeIssues)
  58:5 - error: Overload 2 for "gather" overlaps overload 8 and returns an incompatible type (reportGeneralTypeIssues)
  66:5 - error: Overload 3 for "gather" overlaps overload 9 and returns an incompatible type (reportGeneralTypeIssues)
  75:5 - error: Overload 4 for "gather" overlaps overload 10 and returns an incompatible type (reportGeneralTypeIssues)
  85:5 - error: Overload 5 for "gather" overlaps overload 11 and returns an incompatible type (reportGeneralTypeIssues)
/home/runner/work/typeshed/typeshed/stubs/pkg_resources/pkg_resources/__init__.pyi
  57:9 - error: Overload 1 for "best_match" overlaps overload 2 and returns an incompatible type (reportGeneralTypeIssues)
  61:9 - error: Overload 1 for "obtain" overlaps overload 2 and returns an incompatible type (reportGeneralTypeIssues)
11 errors, 0 warnings, 0 infos

@erictraut

Copy link
Copy Markdown
Contributor

Oh, I moved those errors to a new diagnostic rule. I'll need to publish a new version of pyright (1.1.114) before you can complete this. I'll do this in the next few hours.

@jakebailey
jakebailey marked this pull request as ready for review February 23, 2021 20:32
@jakebailey

jakebailey commented Feb 23, 2021 •

Copy link
Copy Markdown
Contributor Author

Pyright is now passing. The only things that are missing are changes to pyright to allow externally setting the Python version and sys.platform so that a matrix test can be run like mypy.

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🎉

@hauntsaninja

Copy link
Copy Markdown
Collaborator

Thanks all for getting this in place! Would be nice to get to not having any stdlib stubs in the exclude list.

@erictraut

Copy link
Copy Markdown
Contributor

Yeah, I agree. "tkinter" is going to require a lot of work. The others less so.

Some of the third-party stubs in the exclude list are also very close to passing and could get there with relatively little effort.

Comment thread pyrightconfig.json Outdated
@srittau
srittau merged commit c00c725 into python:master Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pyright to tests

4 participants