Skip to content

Conversation

@zzstoatzz
Copy link
Contributor

@zzstoatzz zzstoatzz commented May 3, 2025

closes #581

this PR

As I can see v15 also gives breaking changes. For example, enables sending ping frames in sync client by default. I have to idea how the server will react to it because, right now, we do not send it

websockets 14.0+ (rightfully) dropped 3.8 support, so naively it seems like itd be a good time to drop it here too

This pull request updates the minimum supported Python version from 3.8 to 3.9 across the project and makes adjustments to dependencies and code to align with this change. It also updates the websockets library to version 15+ and modifies related code to accommodate new features and behaviors introduced in this version.

Python version upgrade:

  • Updated the minimum required Python version to 3.9 in all workflow files (.github/workflows/codegen.yml, .github/workflows/publish_release.yml, .github/workflows/ruff.yml, .github/workflows/test.yml, .github/workflows/update_lexicons.yml) and documentation (.readthedocs.yaml, README.md, docs/source/readme.content.md). [1] [2] [3] [4] [5] [6] [7] [8]
  • Removed Python 3.8-specific classifiers and updated the python dependency range in pyproject.toml. [1] [2]

Dependency updates:

  • Updated the websockets library dependency to >=15,<16 in pyproject.toml and adjusted related code to handle the new ping_interval parameter and maintain compatibility with the updated library. [1] [2] [3]
  • Adjusted pyproject.toml configurations to reflect the Python 3.9 target version for tools like mypy and ruff.

Code changes for compatibility:

  • Updated imports and type hints in packages/atproto_firehose/client.py to match the new websockets library structure and functionality. [1] [2]
  • Modified the _get_client and _get_async_client methods in packages/atproto_firehose/client.py to disable automatic pings for the sync client and explicitly set ping_interval for the async client.

tested with

uv run --no-project examples/firehose/process_commits.py

comment
@zzstoatzz zzstoatzz force-pushed the websocket-upgrade branch from 2c859f8 to 8dd370a Compare May 3, 2025 20:46
@zzstoatzz zzstoatzz changed the title upgrade websockets upgrade websockets and drop 3.8 May 3, 2025
@zzstoatzz zzstoatzz marked this pull request as ready for review May 4, 2025 21:21
@MarshalX
Copy link
Owner

MarshalX commented May 8, 2025

I remember overall problems with big payloads on new implementation of async. Do you own any custom feed btw? Could you please leave these firehose on for a few days to test the stability? The best way is to just run bluesky feed generator repo with atproto SDK from this PR

Repo: https://github.com/MarshalX/bluesky-feed-generator

@zzstoatzz
Copy link
Contributor Author

I remember overall problems with big payloads on new implementation of async. Do you own any custom feed btw? Could you please leave these firehose on for a few days to test the stability? The best way is to just run bluesky feed generator repo with atproto SDK from this PR

okay! sorry about delay but custom feed is now up!
image

will report in a couple days

@zzstoatzz
Copy link
Contributor Author

okay! i've had some troubles keeping the feed exactly up to date (its sitting about 1 day behind) but this has been the case regardless if my deployment uses atproto as published on pypi today or the version based on this PR (I think I have some db/cursor issue I haven't quite grokked yet semi-related to MarshalX/bluesky-feed-generator#36)

however, I have yet to encounter any evidence that the websocket changes are to blame here. I'm happy to detail more of what I've been seeing and why I don't suspect the websocket changes as the cause of my lagging feed.

im also happy to keep this on hold (keeping my feed alive) until I can resolve the late feed issue to prove to ourselves the websocket changes are unrelated - I just have not had the time to dig back in yet

@MarshalX
Copy link
Owner

Just a question. Do we really need to bump websockets so bad that we are gonna end support for 3.8? I mean i understand that it is EOL for almost a year, but looks like it is nothing to keep it supported for a bit more. I see the downloads from this version:

image

It is ~10% of all downloads

Source: https://pypistats.org/packages/atproto

@zzstoatzz
Copy link
Contributor Author

zzstoatzz commented Jun 22, 2025

Do we really need to bump websockets so bad that we are gonna end support for 3.8?

🤷 it seems like a judgement call but with my maintainer hat on i tend towards cutting the old as soon as possible, since in my experience, upper bound pins accommodating the slowest-updating percentile of users is a net burden on maintainers and bleeding edge users. because 3.8 is explicitly EoL, in my opinion its on that 10% to pin their stuff or upgrade

for example, I just tried to use atproto in a new project and got this

  ⎿  Error: × No solution found when resolving dependencies:
       ╰─▶ Because atproto-mcp depends on atproto>=0.0.55 and atproto>=0.0.55
           depends on websockets>=12,<14, we can conclude that all of:
               atproto<=0.0.55
               atproto==0.0.56
               atproto==0.0.57
               atproto==0.0.58
               atproto==0.0.59
               atproto==0.0.60
               atproto==0.0.61

so i'm going to have to pin to this branch

@MarshalX
Copy link
Owner

FYI I did the last release with Python 3.8 support today. We are gonna end support of it in the next release

@MarshalX MarshalX merged commit aabaa89 into MarshalX:main Oct 22, 2025
20 checks passed
@MarshalX
Copy link
Owner

you are hero! thank you!

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.

Any plans on updating websockets to version 15?

2 participants