pypa / setuptools

Official project repository for the Setuptools build system
https://pypi.org/project/setuptools/
MIT License
2.36k stars 1.15k forks source link

Initial pyright config #4192

Open Avasam opened 4 months ago

Avasam commented 4 months ago

Summary of changes

Work towards step 2 of https://github.com/pypa/setuptools/issues/2345#issuecomment-1627561833 . Non-trivial fixes should go in a different PR. Merge https://github.com/pypa/setuptools/pull/3979 and #4257 first. npx -y pyright@latest . --pythonversion=3.8|3.11 --pythonplatform=Linux|Windows results: 0 errors, 418 warnings, 0 informations

Pull Request Checklist

[PR docs]: https://setuptools.pypa.io/en/latest/development/developer-guide.html#making-a-pull-request

Avasam commented 4 months ago

I understand that this is a [wip] but I left a few comments, hopefully that is fine with you.

Perfectly fine! I'm just waiting for a merge on #3979 (there's some overlap) before publishing the PR. I especially need guidance on running type-checkers (mypy/pyright) on the CI (tox/pytest setup) to prevent regressions.

Avasam commented 3 months ago

The hundreds (763) of information: Analysis of function "..." is skipped because it is unannotated are probably quite undesirable (we just started an error to remove spam in logs from EncodingWarning...) so I've opened https://github.com/microsoft/pyright/issues/7415

Edit: Looks like there's a lot less errors than when I initially tried this, so "analyzeUnannotatedFunctions": false wasn't really necessary.