-
Notifications
You must be signed in to change notification settings - Fork 134
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
Switch from ws4py
to websockets
#626
Open
hamistao
wants to merge
12
commits into
canonical:main
Choose a base branch
from
hamistao:update_weblocket_lib
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+323
−134
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hamistao
force-pushed
the
update_weblocket_lib
branch
10 times, most recently
from
January 14, 2025 09:56
064c6f2
to
1d9eebc
Compare
@simondeziel To my surprise, the 3.8 tests ran indefinetely here. But before (potentially) wasting time looking for the cause, I am now thinking if it isn't time to drop support for Python 3.8 and include 3.13 in our tests. 3.8 reached EOL in October 7, 2024. Feel free to review this either way and I can address either the failing tests or the version update along with your requested changes. |
hamistao
force-pushed
the
update_weblocket_lib
branch
from
January 14, 2025 10:38
1d9eebc
to
0183a6c
Compare
This keeps `ws4py` as an optional dependency for tests, since we use it to tests backwards compatibility with user provided `ws4py` client objects. Signed-off-by: hamistao <[email protected]>
…ckets` Signed-off-by: hamistao <[email protected]>
Making `payload` as part of `kwargs` is important to use payload as an additional argument in `create_client_connection`. Also I took the liberty of improving the old log message. Signed-off-by: hamistao <[email protected]>
This creates the three clients (for stdin, stdout and stderr) using `create_client_connection`, same as in `events`. And creates a thread for each one using the module `threading`. The logic for closing the output sockets is kept similar to how it was. Signed-off-by: hamistao <[email protected]>
Now `create_client_connection` connects to the server on client initialization so these tests are now broken. Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
This function is responsible for creating a `websockets.sync.ClientConnection` client object. Signed-off-by: hamistao <[email protected]>
This handles the new default `_WebsocketClient` appropriately and accepts a custom `ClientConnection` as an argument. If provided client is a `ws4py` client instead, fallback on handling it as such for backwards compatibility. Signed-off-by: hamistao <[email protected]>
Now the default events websocket client connects to the server on initialization, so integration tests make more sense and we shall add them to substitute the unit tests Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
hamistao
force-pushed
the
update_weblocket_lib
branch
from
January 14, 2025 14:31
0183a6c
to
579d064
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This aims to remove
ws4py
as a required dependency for pylxd (although keeping it as an extra dependency for tests so we can test for backwards compat), and instead use thewebsockets
library.This addresses the problems reported in #615 and #585