-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
type sparse.py
, enable mypy in CI
#773
Conversation
hello! thanks. Why the pyproject.toml? and why type hint sparse? also, could you check #755 as this was the current work for the type hinting. |
Hello! I have added By introducing this check, we ensure that future files are mypy'd from the start, and give ourselves a nice way to ratchet up the type coverage - you can do smaller PRs which remove one or two files from I did notice #755
|
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.
Thanks, I've left a couple more comments and we should merge afterwards.
requirements-dev.txt
Outdated
black==23.3.0 | ||
mypy==1.4.1 |
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.
please leave the versions open. That is:
black
mypy
@@ -0,0 +1,70 @@ | |||
[tool.mypy] |
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.
Can you just add a directory instead of each file? something like seems to work according to https://stackoverflow.com/a/78480102/6508131:
exclude = [
"examples/",
"doc",
"pulp/apis",
"pulp/solverdir",
]
Thanks for merging! FYI the disadvantage of blacklisting folders is that new files added in these folders will be blacklisted be default. Another option if you don't like the long list is to just add ignore comments to the tops of all the existing files. I'm happy to implement either of these as a separate PR if you're interested. |
This is on top of #772 - the diff will be a little cleaner once that is merged.
This PR:
sparse.py
. I have made no functional changes, only types.pyproject.toml
which blacklists all files which don't currently pass mypy (this is most of them).github/workflows/pythonpackage.yml
to run mypy.travis.yml
config