-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Improve pyright compatibility #916
Merged
FasterSpeeding
merged 13 commits into
hikari-py:master
from
FasterSpeeding:task/pyright
Dec 23, 2021
Merged
Improve pyright compatibility #916
FasterSpeeding
merged 13 commits into
hikari-py:master
from
FasterSpeeding:task/pyright
Dec 23, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FasterSpeeding
added
the
skip-fragment-check
Skip fragment checks for this PR as it doesnt need one
label
Nov 25, 2021
FasterSpeeding
added
devops
Changes to quality control processes, CI, release processes
and removed
skip-fragment-check
Skip fragment checks for this PR as it doesnt need one
labels
Nov 25, 2021
davfsa
reviewed
Nov 26, 2021
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.
Will check if sed will still work, but my idea is that it should
EDIT: It does :)
Co-authored-by: davfsa <davfsa@gmail.com>
davfsa
previously approved these changes
Dec 23, 2021
davfsa
approved these changes
Dec 23, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The main aim for this PR is (as the title says) to improve compatibility with pyright. While this PR doesn't go as far as to introduce pyright as an internally used static analyser (since there's just too many internal incompatibilities right now), it does introduce pyright's "verifytypes" check as a pipeline and nox task; verifytypes is a cli command used to verify the "type completeness" of a library's exported types (https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md probably gives some insight into that concept).
The main implication of pyright's type completeness is that public exported variables and attributes must be explicitly typed (likely to allow for static analysis with the lib without having to go deeper into the lib itself to infer types than just the actual interface) and, while this PR does introduce a couple of other pyright compatibility fixes, the majority of the pyright compatibility fixes are to appease this.
It's worth noting that this PR had to change the _about variables to be explicitly typed and the sed scripts used for bumping the version so @davfsa will want to check over that code to make sure I didn't break anything.
Checklist
nox
and all the pipelines have passed.Related issues