Skip to content
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

Dependency on websockets #72

Open
Flix6x opened this issue Jan 14, 2025 · 2 comments
Open

Dependency on websockets #72

Flix6x opened this issue Jan 14, 2025 · 2 comments

Comments

@Flix6x
Copy link
Collaborator

Flix6x commented Jan 14, 2025

#43 first introduced websockets as a dependency, but the message classes in the s2-python package should also be usable outside of a WebSocket implementation, right?

Might I suggest making it into an optional subpackage?1 So users could then choose between:2

pip install s2-python  # install S2 messages as Python classes
pip install s2-python[ws]  # include support for WebSockets

Notes:

Footnotes

  1. This concerns s2_connection.py and associated examples.

  2. I imagine future extensions like pip install s2-python[mqtt]

@wcoenraads
Copy link
Collaborator

I like this suggestion! It would be nice to have a clean split between types that are useful for any S2 implementation, and tooling that makes it easy to work with a specific format/protocol (ws/JSON in our case).

Is this common enough in the Python world that users will know to enable the subpackage? Or is there a way to make it enabled by default, but possible to disable for those who don't want websockets/JSON?

@Flix6x
Copy link
Collaborator Author

Flix6x commented Jan 14, 2025

Is this common enough in the Python world that users will know to enable the subpackage?

I believe it is. For instance, Pandas uses it (pip install pandas[excel]). We've used it, too.

Or is there a way to make it enabled by default, but possible to disable for those who don't want websockets/JSON?

This is not an approach I've seen before with pip (nor after a few minutes of research). Of course, any installation instructions would deserve a prominent place in the documentation for this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants