-
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
Type annotate bandersnatch plugins #561
Conversation
Codecov Report
@@ Coverage Diff @@
## master #561 +/- ##
==========================================
+ Coverage 78.77% 78.89% +0.12%
==========================================
Files 13 13
Lines 2035 2033 -2
Branches 289 289
==========================================
+ Hits 1603 1604 +1
+ Misses 326 324 -2
+ Partials 106 105 -1
Continue to review full report at Codecov.
|
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 - Looks legit ... TIL ignore[override] ...
Can you please unblacklist the plugins directory on pre-commit here now please to get MyPy testing it: https://github.com/pypa/bandersnatch/blob/master/.pre-commit-config.yaml#L33 on CI
I also learned |
And I appreciate it. As someone who’s typed a lot of old code, I appreciate the difficulties. Typing code changes how you code moving forward. For the better I believe :) |
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.
CI agrees and Thankyou very much :)
""" | ||
Remove all release versions that match any of the specified patterns. | ||
""" | ||
releases = metadata["releases"] | ||
for version in list(releases.keys()): | ||
if any(pattern.match(version) for pattern in self.patterns): | ||
if any(pattern.match(version) for pattern in self.patterns): # type: ignore |
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.
Will be interested to see what the error is here.
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.
prerelease_name.py:41: error: Item "None" of "Optional[List[Pattern[str]]]" has no attribute "__iter__" (not iterable)
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.
Ahh - makes sense.
Yeah, here we just need to add another check for a None object and handle it. I’ll go back and look at type ignores before closing the issue and see if we can get rid of a few more.
Related: #15.
Type annotate the bandersnatch plugins.
@techalchemy, it would be nice if you could review this PR since you know these plugins the best. (Only if you have the time though)