Skip to content

fix: correct WebSocket dependency compatibility - #10

Merged
harley-poly merged 2 commits into
mainfrom
harley/websocket-compatibility
Sep 23, 2026
Merged

harley-poly merged 2 commits into
mainfrom
harley/websocket-compatibility

Conversation

@harley-poly

@harley-poly harley-poly commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Changes

Use the explicit asyncio WebSocket connector and require websockets>=13.0. The previous dependency range allowed version 12, which cannot initialize the WebSocket clients, and version 13, whose top-level connector rejects the SDK's authentication headers.

Add real local connection tests for markets and private streams, including signed headers, heartbeat delivery and cleanup. Keep the existing Python 3.10–3.13 CI matrix and add a Python 3.10 job pinned to websockets 13.0. Set the package version to 1.0.1 for the existing publish workflow. Applications constrained to websockets 12 must upgrade that dependency.

Testing

  • pytest — 150 tests pass on Python 3.10–3.13 with current compatible dependencies, and on Python 3.10 with websockets 13.0. The two new connection cases fail against the original connector on 13.0.
  • ruff check ., ruff format --check . and mypy polymarket_us tests/types pass.
  • uv build passes; wheel and sdist metadata declare version 1.0.1, Python >=3.10 and websockets >=13.0.

Checklist

  • Tests pass (pytest)
  • Linting passes (ruff check .)
  • Types check (mypy polymarket_us)

Note

Medium Risk
Raises the minimum websockets version and changes how connections are established, which can break apps still on 12.x but reduces risk of broken or mis-authenticated live WebSocket sessions.

Overview
Fixes WebSocket client compatibility with websockets 13 by connecting through websockets.asyncio.client.connect instead of the top-level websockets.connect, so auth headers are passed correctly. The package now requires websockets>=13.0 (drops 12.x) and bumps the release to 1.0.1.

Adds local integration tests for markets and private streams that assert signed X-PM-* headers, heartbeat handling, and clean disconnect. CI gains a Python 3.10 job that pins websockets==13.0 and runs the full test suite to guard the minimum supported version.

Reviewed by Cursor Bugbot for commit d141027. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread .github/workflows/ci.yml Fixed
@harley-poly
harley-poly merged commit b44e4c8 into main Sep 23, 2026
11 checks passed
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

Successfully merging this pull request may close these issues.

3 participants