-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use of twisted in pika #9494
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
Use of twisted in pika #9494
Conversation
This comment has been minimized.
This comment has been minimized.
I don't think there's enough of a win here for this to be worth it. Just because we can have non-types dependencies now doesn't mean we should add them everywhere. We should still strive for stubs packages to have minimal dependencies, and present minimal security risks, wherever possible. |
So it's an optional dependency just like Qt is to Pillow.
So would |
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I appreciate the work here but I'm wary of adding so much code that we can't validate with stubtest or other automatic tools. It might make sense to import the types from Twisted without declaring an explicit dependency on Twisted for the stubs package. Users who use the Twisted backend presumably will also have Twisted installed in their venv, so they will get precise types. If they don't, type checkers will just fall back to Any. |
That's something I've suggested a few times for different stubs with similar issues. (the idea of "optional" or "test only" dependencies). The issue with the current setup is that we can do that for stubtest, but not for every other tests like mypy, pyright, pytype, flake8, ... Especially with Pyright you can end up with unknowns that bubble up and you have to I'll see what I can do for Twisted in Pika, it's been a while I haven't touched this PR. |
Alright, this is what it looks like in pika. Not too bad given that usage of |
…into twisted-in-pika
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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.
It's not exactly pretty, but I'm on board with this new approach!
Fixes 2 Any subclassing issues
This would require the stub_uploader to allow twistedThe twisted types have been replicated.
I've completed as many things referencing twisted as I could find.
Ref: #9491