-
Notifications
You must be signed in to change notification settings - Fork 19
Include type checker versions in long description #96
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
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.
Generally I like the idea, but I have one comment and I think it may be worth writing few unit tests for _read_requirements()
.
stub_uploader/ts_data.py
Outdated
line = line.split(";")[0] # strip extras | ||
if not line.strip(): # skip empty lines | ||
continue | ||
if "==" in line: |
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.
What if at some point in future someone will (accidentally) write e.g. mypy>=1.5.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.
Stub-uploader already has packaging
as a requirement, so we could use the packaging.requirements.Requirement
class to parse each line (once it's been stripped of comments), rather than doing our own parsing. That would simplify this code and also be more robust/better tested.
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.
Edit: The build will fail. I see that as a feature. Using a non-pinned version in typeshed would make tests non-reproducible. Although maybe we could reorganize requirements-tests.txt a bit and add a comment to that effect?
Edit: I will make the fails explicit tomorrow + unit tests.
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 agree that most of our test dependencies (and definitely our type-checker dependencies) in typeshed should be pinned. But if we want to test that, I feel like we should have a dedicated test (or lint) for it, rather than having some unrelated code in stub-uploader inexplicably fail when that rule is broken.
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 run stub_uploader tests in typeshed, so if you have an integration test that makes sure this works, we should get failures at typeshed PR time)
Good idea, I will do so tomorrow. |
typeshed is prepared now. I will add tests and switch to use packaging tomorrow. |
Also, |
Co-authored-by: Alex Waygood <[email protected]>
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.
This looks great to me, and I think will be really useful. Thanks @srittau!
Cf. python/typeshed#6843