-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add setup.py to selfcheck #18609
base: master
Are you sure you want to change the base?
Add setup.py to selfcheck #18609
Conversation
This comment has been minimized.
This comment has been minimized.
runtests.py
Outdated
"-c", | ||
"from mypy.main import main as mypy; " | ||
"mypy(args=['--config-file', 'mypy_self_check.ini', '-p', 'mypy', '-p', 'mypyc']); " | ||
"mypy(args=['--config-file', 'mypy_self_check.ini', 'setup.py'])", |
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.
maybe we should have two different type checks, self
(which checks mypy) and self-packaging
(which checks setup.py
)?
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 also thought about splitting them, but then I saw the comment at https://github.com/python/mypy/pull/18609/files/72e1ff81760a6e50a2acba2d2a262ad409afdc25#diff-17019d8813f584a97bc5531faa1df3f1a590413d61a77d7d93db76df66163b63R53-R54
Each run should have tests that each take a roughly similar time to run.
To me, the check of just setup.py
feels too short to have its own run.
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'm happy to take this PR in whatever direction the reviewers / mergers / maintainers wish, of course :-)
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 think that's a comment on the runtime of different pytest runs. Locally, I see:
(.venv) PS C:\Users\A5rocks\Documents\mypy> Measure-Command { python runtests.py self }
Days : 0
Hours : 0
Minutes : 1
Seconds : 42
Milliseconds : 497
Ticks : 1024979731
TotalDays : 0.00118631913310185
TotalHours : 0.0284716591944444
TotalMinutes : 1.70829955166667
TotalSeconds : 102.4979731
TotalMilliseconds : 102497.9731
(.venv) PS C:\Users\A5rocks\Documents\mypy> Measure-Command { python runtests.py pytest-fast }
Days : 0
Hours : 0
Minutes : 3
Seconds : 38
Milliseconds : 93
Ticks : 2180936287
TotalDays : 0.00252423181365741
TotalHours : 0.0605815635277778
TotalMinutes : 3.63489381166667
TotalSeconds : 218.0936287
TotalMilliseconds : 218093.6287
(and that's on a system with 6 cores/12 threads, meaning pytest is running in parallel and mypy isn't.)
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.
Fixed. Shall I squash+rebase and force push?
This comment has been minimized.
This comment has been minimized.
Enhance the setup.py types. mypy's setup.py is used as inspiration for other setuptools using Python projects that want to produce mypyc compiled binary wheels. Therefore it should also be typechecked and held to a higher standard.
for more information, see https://pre-commit.ci
f8f77b8
to
b580485
Compare
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Enhance the setup.py types.
mypy's setup.py is used as inspiration for other Setuptools-using projects that want to produce mypyc compiled binary wheels. Therefore it should also be typechecked and held to a higher standard.