-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
I'm working on adding engineio to typeshed, and in its source code there is a file which imports from eventlet without a guard - https://github.com/miguelgrinberg/python-engineio/blob/main/src/engineio/async_drivers/eventlet.py#L1-L3.
the guard is in another part of the code - https://github.com/miguelgrinberg/python-engineio/blob/main/src/engineio/base_server.py#L82-L92
eventlet isn't even an optional dependency of engineio, but if it's installed and configured properly then the user's code can use engineio's eventlet driver
how should I approach this in the stub file of engineio/async_drivers/eventlet.pyi? I can't import from eventlet since it's not a dependency, but I also can't define the class WebSocketWSGI which inherits from the import eventlet.websocket.WebSocketWSGI
one possibility I've though of is to write a protocol which behaves like eventlet.websocket.WebSocketWSGI but that doesn't seem like the best approach...