You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: remove unused imports, variables and star imports - #1970
Only realtime ignored F401 (unused import) and F841 (unused variable). The root pyproject.toml and every other package already enforced both. This removes the two ignores from src/realtime/pyproject.toml and cleans up the 82 violations they were hiding.
It also removes the F403 (star import) ignore from the root, supabase and realtime configs, and replaces the remaining star imports with explicit re-exports.
Removed 79 unused imports across realtime source and tests (json, re, sys, functools.wraps, urllib.parse helpers, yarl._query.get_str_query, legacy typing names like Optional and Union, and message/types names that were imported but never used).
Fixed the three unused variables in tests:
tests/test_presence.py: res = await chan.track(user1) became await chan.track(user1), keeping the call.
tests/test_reconnection.py: dropped as exc from except MaxRetriesExceeded and as channel from async with client.channel(...), keeping the context manager.
Public API
realtime/__init__.py already re-exports explicitly (import x as x) or through star imports, so ruff did not flag it. Nothing in sdk-compliance.yaml changed. The only visible effect is that the star imports of realtime.exceptions, realtime.message and realtime.types no longer leak a few third-party helpers that those modules imported without using them (Optional, Union, Any, Generic, Required, TypedDict and pydantic.Field). None of these were part of the realtime API.
Kept with noqa
None. No unused import or variable was a placeholder for unfinished work. The only TODO in realtime is about a payload type and is unrelated to these imports.
F403
Removed. The root, supabase and realtime configs no longer ignore it. The four star imports are replaced with explicit import X as X re-exports, in the style the __init__.py files already use:
realtime/__init__.py: from .exceptions import *, from .message import * and from .types import *.
supabase_auth/__init__.py: from .types import * # noqa: F403.
Each re-export list contains every public name the submodule defines (2 from realtime.exceptions, 25 from realtime.message, 37 from realtime.types and 95 from supabase_auth.types), and I checked that all of them are still importable from the package root. The only names that are no longer importable from the package roots are third-party helpers that the star imports leaked, such as BaseModel, Field, Literal, dataclass, datetime and override. Nothing in the repository imports them from there.
Checks
uv run --frozen ruff check and uv run --frozen ruff format --check pass from the repository root.
make <pkg>.pyrefly reports 0 errors for every package.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 70800f64-cbde-4ff4-9a28-454cb5d0fac3
Commits
Reviewing files that changed from the base of the PR and between 688ec1e and 1082f08.
Files selected for processing: 5
pyproject.toml
src/auth/src/supabase_auth/__init__.py
src/realtime/pyproject.toml
src/realtime/src/realtime/__init__.py
src/supabase/pyproject.toml
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Documentation
Updated package guidance to require Python 3.11 or later.
Refreshed installation instructions and issue-reporting links.
Chores
Updated development container setup and tooling across the workspace.
Modernized Python type annotations and expanded declared support through Python 3.14.
Updated package build configuration.
The pull request updates development-container configuration and package metadata across the repository. It raises documented and classified Python support to 3.11–3.14, updates build requirements and Ruff settings, and modernizes typing annotations in package source and tests. The summaries report no runtime behavior changes for the annotation updates.
Possibly related PRs
supabase/supabase-py#1968: Updates overlapping build, metadata, development-container, and typing areas.
supabase/supabase-py#1965: Raises the supported Python baseline to 3.11, which aligns with this pull request’s classifiers and typing changes.
supabase/supabase-py#1967: Adds Ruff CI checks for rules and formatting that this pull request updates and addresses.
Change: Refactor
Merge Risk: Minimal · previous review 688ec
This cleanup has no identified merge-blocking issue and is mergeable subject to normal checks.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 5ea4855e-d212-4d75-9194-523c9fcafbd0
Commits
Reviewing files that changed from the base of the PR and between f73c54d and 688ec1e.
Files selected for processing: 9
src/realtime/pyproject.toml
src/realtime/src/realtime/channel.py
src/realtime/src/realtime/client.py
src/realtime/src/realtime/message.py
src/realtime/src/realtime/presence.py
src/realtime/src/realtime/types.py
src/realtime/tests/test_connection.py
src/realtime/tests/test_presence.py
src/realtime/tests/test_reconnection.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.
Base automatically changed from
chore/align-outdated-tooling to
mainNovember 4, 2026 13:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves SDK-2757.
What
Only
realtimeignoredF401(unused import) andF841(unused variable). The rootpyproject.tomland every other package already enforced both. This removes the two ignores fromsrc/realtime/pyproject.tomland cleans up the 82 violations they were hiding.It also removes the
F403(star import) ignore from the root,supabaseandrealtimeconfigs, and replaces the remaining star imports with explicit re-exports.realtimesource and tests (json,re,sys,functools.wraps,urllib.parsehelpers,yarl._query.get_str_query, legacytypingnames likeOptionalandUnion, and message/types names that were imported but never used).tests/test_presence.py:res = await chan.track(user1)becameawait chan.track(user1), keeping the call.tests/test_reconnection.py: droppedas excfromexcept MaxRetriesExceededandas channelfromasync with client.channel(...), keeping the context manager.Public API
realtime/__init__.pyalready re-exports explicitly (import x as x) or through star imports, so ruff did not flag it. Nothing insdk-compliance.yamlchanged. The only visible effect is that the star imports ofrealtime.exceptions,realtime.messageandrealtime.typesno longer leak a few third-party helpers that those modules imported without using them (Optional,Union,Any,Generic,Required,TypedDictandpydantic.Field). None of these were part of the realtime API.Kept with
noqaNone. No unused import or variable was a placeholder for unfinished work. The only
TODOinrealtimeis about a payload type and is unrelated to these imports.F403Removed. The root,
supabaseandrealtimeconfigs no longer ignore it. The four star imports are replaced with explicitimport X as Xre-exports, in the style the__init__.pyfiles already use:realtime/__init__.py:from .exceptions import *,from .message import *andfrom .types import *.supabase_auth/__init__.py:from .types import * # noqa: F403.Each re-export list contains every public name the submodule defines (2 from
realtime.exceptions, 25 fromrealtime.message, 37 fromrealtime.typesand 95 fromsupabase_auth.types), and I checked that all of them are still importable from the package root. The only names that are no longer importable from the package roots are third-party helpers that the star imports leaked, such asBaseModel,Field,Literal,dataclass,datetimeandoverride. Nothing in the repository imports them from there.Checks
uv run --frozen ruff checkanduv run --frozen ruff format --checkpass from the repository root.make <pkg>.pyreflyreports 0 errors for every package.make realtime.tests: 43 passed.make auth.tests: 213 passed.make supabase.tests: 39 passed.