-
Notifications
You must be signed in to change notification settings - Fork 141
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
[verify]: Conform to PEP 484 type hints #488
Conversation
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.
- Lint
mypy.ini
wants a new line at the end of the file - Seem we need to update the typing for Filter.filter or fix the bug on line 126
src/bandersnatch/verify.py:126: error: Too many arguments for "filter" of "Filter"
It's probably never been hit / tested correctly - Blame me - Feel free to #type: ignore
and open an issue and I'll look into it when I next get some time.
src/bandersnatch/verify.py
Outdated
config: ConfigParser, | ||
json_file: str, | ||
mirror_base_path: Path, | ||
all_package_files: List, |
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.
List can take the type in the list - List[Path]
- The more info you give typing the more it will help us spot bugs etc. :)
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.
Yup, thanks, I was a little confused on what the sub-type was!
Useful for generating stubs with monkeytype
Codecov Report
@@ Coverage Diff @@
## master #488 +/- ##
==========================================
+ Coverage 81.50% 81.51% +0.01%
==========================================
Files 10 10
Lines 1157 1158 +1
Branches 171 171
==========================================
+ Hits 943 944 +1
Misses 172 172
Partials 42 42
Continue to review full report at Codecov.
|
Thanks for the quick review, made some changes, opened the PR for review/merge. |
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.
Awesome. Thanks. Will merge.
- Don't care about the weird coverage reduction I don't get :|
if __name__ == "__main__": | ||
unittest.main() |
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.
We should pytest these one day to match all other unittests ...
|
||
|
||
if __name__ == "__main__": | ||
pytest.main(sys.argv) |
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 generally just run pytest src/bandersnatch/tests/test_verify.py
to run specific tests ...
Part of #15