-
Notifications
You must be signed in to change notification settings - Fork 14
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
Include py.typed file & fix and/or add missing/wrong type hints in stub files #50
Include py.typed file & fix and/or add missing/wrong type hints in stub files #50
Conversation
Did you check whether the file is actually included in the wheel? You might need to add it to the |
Yes, when I checked, it was both in the I'll rebase this as soon as I opened another PR, I noticed that unfortunately a bunch of the type hints that were introduced are slightly wrong and/or missing. |
f751ee0
to
04e3438
Compare
Hey @phoerious , unfortunately, adding and/or fixing wrong or missing type hints took longer than initially thought. Patching a The most central change of this PR is that places that accepted purely an Current state of type checking of tests: In general, I have to say that the state of the current tests is really not ideal to debug these kinds of things. It's practically entirely untyped code which creates a lot of noise for
Implementation changes that could be nice for the future: Another, relatively central issue is that
Note that this is about implementing just a method interface, the actual non-abstract classes can raise a Also, for actually implementing
TL;DR But nevertheless, I think this current state should already fix most issues that users have with this library in the wild. Let me know what you think about it. |
Slight correction: Since All python objects that implement necessary methods are now allowed in especially This maps nicely to what the Cython code actually does low-level, i.e. checking for methods |
You can add the missing methods if you want, but they would all raise exceptions, unless you implement all the logic needed. I'm not sure whether this is actually useful. The IOStream classes are not drop-in replacements for their Python equivalents.
I added explicit |
I'm still trying to figure out how to make the tokenless Codecov upload work on pull requests from forks. 🤔 |
I don't see that it's that clear that they couldn't do that. Properly implementing some centrally, well-known interfaces is always a plus in my book. But this was rather about removing that the stub files wrongly assume that these interfaces were properly implemented, leading to
Ah, nice! Will do. |
I've updated the workflow file a bit. Please rebase again, so we can see whether the Codecov upload now works. |
4bcbf72
to
622c166
Compare
Rebased on |
Damn. I pretty much did everything exactly as in the upstream GitHub action. Unfortunately, I cannot use the action directly, since it requires a newer Glibc version than the one in the manylinux image. |
622c166
to
7f1e49f
Compare
Removed the unnecessary |
Now that PR #44 is in, to make this package actually work in a
mypy
context, we'd need to include apy.typed
marker file.Otherwise you'd see this error message:
Including this file makes this package properly PEP 561 compliant.
I'm sorry that this is something I forgot when participating in #44.