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
Initial pyright config #4192
base: main
Are you sure you want to change the base?
Initial pyright config #4192
Conversation
6450313
to
e7c0804
Compare
@@ -138,3 +143,4 @@ def get_output_mapping(self) -> Dict[str, str]: | |||
Destination files should be strings in the form of | |||
``"{build_lib}/destination/file/path"``. | |||
""" | |||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer to microsoft/pyright#6487
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python should not require ellipsis when the docstring is provided. I am not 100% inline with the comment of the pyright maintainer... The reason why the linters don't complain about it, is because there is nothing wrong 😅
Does mypy also complains about it?
Should we just stick with mypy for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the problem here is because we are talking specifically about prototypes, and the spec says:
Bodies of protocol methods are type checked.
That is a bit disappointing... These pesky ellipsis can be annoying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Avasam , thank you very much for the efforts in this field. I understand that this is a wipe, but I left a few comments, hopefully that is fine with you.
@@ -138,3 +143,4 @@ def get_output_mapping(self) -> Dict[str, str]: | |||
Destination files should be strings in the form of | |||
``"{build_lib}/destination/file/path"``. | |||
""" | |||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python should not require ellipsis when the docstring is provided. I am not 100% inline with the comment of the pyright maintainer... The reason why the linters don't complain about it, is because there is nothing wrong 😅
Does mypy also complains about it?
Should we just stick with mypy for now?
Perfectly fine! I'm just waiting for a merge on #3979 (there's some overlap) before publishing the PR. |
bbb379f
to
d9f74a7
Compare
872fc45
to
257efa3
Compare
The hundreds (763) of Edit: Looks like there's a lot less errors than when I initially tried this, so |
257efa3
to
6519c8d
Compare
// Dynamically defined module-level variables declared as None in pkg_resources lead to a lot of false-positives | ||
// TODO: Fix how these variables are typed | ||
"reportOptionalCall": "warning", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following PRs work towards this:
Summary of changes
Work towards step 2 of #2345 (comment) . Non-trivial fixes should go in a different PR.
Merge #3979 and #4257 first.
npx -y pyright@1.1.359 . --pythonversion=3.8|3.11 --pythonplatform=Linux|Windows
results:0 errors, 387 warnings, 0 informations
Pull Request Checklist
newsfragments/
.(See documentation for details)