Skip to content

Integration branch for ably-pubsub-server v4 package - #693

Open
ttypic wants to merge 3 commits into
mainfrom
integration/v4
Open

ttypic wants to merge 3 commits into
mainfrom
integration/v4

Conversation

@ttypic

@ttypic ttypic commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Integration branch contains packages split, renaming and deletion of deprecated methods

ttypic and others added 3 commits September 18, 2026 13:53
Publish the SDK as `ably-pubsub-server` rather than `ably`, installing into
`ably/pubsub` so that further per-product distributions can share the `ably`
namespace. All existing code moves to `ably/pubsub` unchanged; the public API
is now reached through `ably.pubsub.server`.

Neither `ably` nor `ably.pubsub` carries an `__init__.py` — both are PEP 420
namespace packages. This matters for the next distribution: a regular package
wins outright over any namespace portion during import resolution, so an
`ably/pubsub/__init__.py` here would silently shadow an `ably/pubsub/client`
installed under a different sys.path entry, which is exactly what an editable
checkout of this repo alongside a released sibling looks like.

Consequences of having no package root to put things in:

- `api_version` and `lib_version` move to `ably/pubsub/version.py`, as
  `http/httputils.py` and `types/options.py` read them and core code must not
  depend on the server package.
- The NullHandler silencing the library's loggers moves to
  `ably/pubsub/util/__init__.py`, the one module every entry point imports.
- unasync writes the sync tree to `ably/pubsub/sync` and maps
  `ably.pubsub.server` onto the hand-written `ably.pubsub.server.sync`.

Also fix `HttpUtils.default_headers()`, which read `api_version` and
`lib_version` off the `ably` namespace and so raised AttributeError. Only the
integration tests cover the Ably-Agent header, so the unit suite was silent
on it.

Tests import from `ably.pubsub.server`; UPDATING.md covers the 4.0.0 migration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Expose create_http_client() and create_realtime_client() as the only way to build
a client, so that the package a client comes from names the side the application
runs on. AblyRest and AblyRealtime are no longer exported from ably.pubsub.server
and raise TypeError when constructed directly, naming the factory to reach for
instead; a ContextVar opened by the factories is what separates a permitted
construction from a direct one.

Callers who annotated against the client classes should use the prototypes the
factories return. ably/pubsub/prototypes.py declares RestClient and RealtimeClient
as typing.Protocol definitions of the client surface, which the concrete classes
satisfy structurally. They are called prototypes because "protocol" already means
the Ably wire protocol here.

- typing.Protocol makes 3.8 the minimum supported Python, which the CI matrix and
  README already assumed. requires-python and the classifiers now say so, which in
  turn retires two dead sys.version_info blocks in the tests.
- Expand the factory docstrings to cover every client option, grouped by concern
  and derived from Options and AuthOptions rather than copied from the
  constructors.
- Drop `keep_alive` from the AblyRest docstring. It has been documented since the
  constructor was written, but no option of that name exists and passing it raises
  TypeError.

test/unit/pubsub_server_test.py covers the factories, the guard — including that
permission does not leak past a factory call — the classes being unexported, and
the concrete clients satisfying their prototypes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The distribution was renamed to ably-pubsub-server, so the agent header
should no longer identify the library as ably-python. Report the SDK as
ably-pubsub-python and add a versionless ably-pubsub-server agent entry
so requests are attributable to the server package.

Update the Ably-Agent assertion in the REST HTTP tests to match the new
header format.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 109 files, which is 9 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0c0db5e6-97da-4826-b305-272a9221fc36

📥 Commits

Reviewing files that changed from the base of the PR and between 63b7812 and cd950e1.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (109)
  • .claude/skills/release/SKILL.md
  • .github/workflows/release.yml
  • .gitignore
  • CONTRIBUTING.md
  • LONG_DESCRIPTION.rst
  • README.md
  • UPDATING.md
  • ably/__init__.py
  • ably/pubsub/http/__init__.py
  • ably/pubsub/http/http.py
  • ably/pubsub/http/httputils.py
  • ably/pubsub/http/paginatedresult.py
  • ably/pubsub/prototypes.py
  • ably/pubsub/realtime/__init__.py
  • ably/pubsub/realtime/annotations.py
  • ably/pubsub/realtime/channel.py
  • ably/pubsub/realtime/connection.py
  • ably/pubsub/realtime/connectionmanager.py
  • ably/pubsub/realtime/presence.py
  • ably/pubsub/realtime/presencemap.py
  • ably/pubsub/realtime/realtime.py
  • ably/pubsub/rest/__init__.py
  • ably/pubsub/rest/annotations.py
  • ably/pubsub/rest/auth.py
  • ably/pubsub/rest/channel.py
  • ably/pubsub/rest/push.py
  • ably/pubsub/rest/rest.py
  • ably/pubsub/scripts/__init__.py
  • ably/pubsub/scripts/unasync.py
  • ably/pubsub/server/__init__.py
  • ably/pubsub/server/sync.py
  • ably/pubsub/transport/__init__.py
  • ably/pubsub/transport/defaults.py
  • ably/pubsub/transport/websockettransport.py
  • ably/pubsub/types/__init__.py
  • ably/pubsub/types/annotation.py
  • ably/pubsub/types/authoptions.py
  • ably/pubsub/types/capability.py
  • ably/pubsub/types/channeldetails.py
  • ably/pubsub/types/channelmode.py
  • ably/pubsub/types/channeloptions.py
  • ably/pubsub/types/channelstate.py
  • ably/pubsub/types/channelsubscription.py
  • ably/pubsub/types/connectiondetails.py
  • ably/pubsub/types/connectionerrors.py
  • ably/pubsub/types/connectionstate.py
  • ably/pubsub/types/device.py
  • ably/pubsub/types/flags.py
  • ably/pubsub/types/message.py
  • ably/pubsub/types/mixins.py
  • ably/pubsub/types/operations.py
  • ably/pubsub/types/options.py
  • ably/pubsub/types/presence.py
  • ably/pubsub/types/stats.py
  • ably/pubsub/types/tokendetails.py
  • ably/pubsub/types/tokenrequest.py
  • ably/pubsub/types/typedbuffer.py
  • ably/pubsub/util/__init__.py
  • ably/pubsub/util/case.py
  • ably/pubsub/util/construction.py
  • ably/pubsub/util/crypto.py
  • ably/pubsub/util/encoding.py
  • ably/pubsub/util/eventemitter.py
  • ably/pubsub/util/exceptions.py
  • ably/pubsub/util/helper.py
  • ably/pubsub/util/nocrypto.py
  • ably/pubsub/vcdiff/__init__.py
  • ably/pubsub/vcdiff/defaultvcdiffdecoder.py
  • ably/pubsub/version.py
  • ably/vcdiff/__init__.py
  • pyproject.toml
  • test/ably/realtime/eventemitter_test.py
  • test/ably/realtime/presencemap_test.py
  • test/ably/realtime/realtimeannotations_test.py
  • test/ably/realtime/realtimeauth_test.py
  • test/ably/realtime/realtimechannel_publish_test.py
  • test/ably/realtime/realtimechannel_test.py
  • test/ably/realtime/realtimechannel_vcdiff_test.py
  • test/ably/realtime/realtimechannelmutablemessages_test.py
  • test/ably/realtime/realtimeconnection_test.py
  • test/ably/realtime/realtimeinit_test.py
  • test/ably/realtime/realtimepresence_test.py
  • test/ably/realtime/realtimeresume_test.py
  • test/ably/rest/encoders_test.py
  • test/ably/rest/restannotations_test.py
  • test/ably/rest/restauth_test.py
  • test/ably/rest/restcapability_test.py
  • test/ably/rest/restchannelhistory_test.py
  • test/ably/rest/restchannelmutablemessages_test.py
  • test/ably/rest/restchannelpublish_test.py
  • test/ably/rest/restchannels_test.py
  • test/ably/rest/restcrypto_test.py
  • test/ably/rest/resthttp_test.py
  • test/ably/rest/restinit_test.py
  • test/ably/rest/restpaginatedresult_test.py
  • test/ably/rest/restpresence_test.py
  • test/ably/rest/restpush_test.py
  • test/ably/rest/restrequest_test.py
  • test/ably/rest/reststats_test.py
  • test/ably/rest/resttime_test.py
  • test/ably/rest/resttoken_test.py
  • test/ably/testapp.py
  • test/ably/utils.py
  • test/unit/annotation_test.py
  • test/unit/http_test.py
  • test/unit/message_test.py
  • test/unit/mutable_message_test.py
  • test/unit/options_test.py
  • test/unit/pubsub_server_test.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant