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

Typecheck typeshed's code with pyright #9793

Merged
merged 14 commits into from
Feb 22, 2023

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Feb 21, 2023

When it comes to typeshed's own code, it is tested with mypy but not with pyright. A bit odd given how strictly the stubs are tested against pyright. Making typeshed, imo, a bit of a "poorly shod shoemaker" on that aspect.
Pyright specifically complements mypy's missing features well.

But this is not just about typeshed itself. As it is a pillar in Python's typing ecosystem, problems caught by it, and improvements made thanks to it (especially those pushing the limitations of the current type system) have bigger repercussions on the ecosystem as a whole.

Tangible improvements:
All of the PRs and issues mentioned here are directly related, and opened due, to me trying to run pyright on typeshed's own code and working on this PR:

(I waited until most of these got resolved before bringing this PR)

@github-actions

This comment has been minimized.

stubs/setuptools/pkg_resources/__init__.pyi Outdated Show resolved Hide resolved
tests/check_consistent.py Outdated Show resolved Hide resolved
tests/mypy_test.py Outdated Show resolved Hide resolved
tests/utils.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

I agree with everything Jelle said; here's a few more pieces of feedback

scripts/stubsabot.py Outdated Show resolved Hide resolved
scripts/stubsabot.py Outdated Show resolved Hide resolved
tests/check_new_syntax.py Outdated Show resolved Hide resolved
tests/mypy_test.py Outdated Show resolved Hide resolved
tests/parse_metadata.py Outdated Show resolved Hide resolved
tests/parse_metadata.py Outdated Show resolved Hide resolved
tests/pytype_test.py Outdated Show resolved Hide resolved
tests/mypy_test.py Outdated Show resolved Hide resolved
tests/mypy_test.py Outdated Show resolved Hide resolved
@Avasam
Copy link
Collaborator Author

Avasam commented Feb 22, 2023

Thanks for the reviews and patience! This started absolutely huge that I split off in its own chunks over time. And there was some artefacts of that leftover.
I self-reviewed initially, but I guess I should've done it a few more times along the way. 😅

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.

3 participants