Deprecation warnings with websockets imports
Describe the bug
The package gives deprecation warnings on import.
DeprecationWarning: websockets.client.connect is deprecated
DeprecationWarning: websockets.client.WebSocketClientProtocol is deprecated
To Reproduce
from polygon import RESTClient
Additional context
All packages installed with uv including websockets version 14.1
The warning comes from the following line in polygon/websocket/__init__.py:
from websockets.client import connect, WebSocketClientProtocol
websockets.client.connect has been deprecated. To be replaced I believe with websockets.connect. WebSocketClientProtocol has also been deprecated.
Hey, I'll check this out. Thanks for reporting. What OS/python version are you seeing this on? I'm just wondering since I don't see this on my end but after looking at the docs we can fix regardless.
Thanks. I am on MacOS (Apple Silicon), Python Version 3.10, using a uv managed environment. The warnings appear while running some tests with pytest.
Hey @furechan, this issue has been addressed in our latest release, v1.16.0. For full details on what's new, check out the release notes.
To upgrade and get the fix:
pip install -U polygon-api-client
I'm closing this issue for now, but feel free to reopen it if the problem persists or if you have more details!