Conversation
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>
|
Important Review skippedToo 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (109)
You can disable this status message by setting the 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. Comment |
Integration branch contains packages split, renaming and deletion of deprecated methods