Skip to content
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
merged 13 commits into from
Dec 23, 2021

Conversation

FasterSpeeding
Copy link
Collaborator

@FasterSpeeding FasterSpeeding commented Nov 25, 2021

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

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Related issues

@FasterSpeeding FasterSpeeding added the skip-fragment-check Skip fragment checks for this PR as it doesnt need one label Nov 25, 2021
@FasterSpeeding 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
Copy link
Member

@davfsa davfsa left a 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 :)

hikari/internal/ux.py Show resolved Hide resolved
hikari/iterators.py Outdated Show resolved Hide resolved
davfsa
davfsa previously approved these changes Dec 23, 2021
@FasterSpeeding FasterSpeeding merged commit 798a039 into hikari-py:master Dec 23, 2021
@FasterSpeeding FasterSpeeding deleted the task/pyright branch December 23, 2021 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Changes to quality control processes, CI, release processes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants