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: declare __all__ in every package and export the service errors - #1979
Resolves SDK-2725. Continues the work from #1950 (SDK-2694).
What changed
Every package now declares __all__, and every service's public error classes can be imported from the package itself and from supabase.
Package
Change
supabase_auth
Replaced the X as X re-exports with grouped imports and __all__. Now exports the error classes from errors.py and ErrorCode.
realtime
Replaced the X as X re-exports with grouped imports and __all__. Dropped the internal T_ParamSpec and T_Retval type variables from the package.
storage3
Exports StorageException, StorageApiError, StorageApiErrorMessage and VectorBucketException.
supabase_functions
Exports FunctionsError, FunctionsHttpError, FunctionsRelayError, FunctionsApiErrorDict and __version__.
supabase_utils
Declares an empty __all__. Its public API lives in the http and types submodules.
supabase
Turns __all__ into a list. Adds StorageApiError, VectorBucketException, AuthInvalidJwtError, CustomAuthError and UserDoesntExist. Imports them from the package roots.
supabase.client
Keeps the same error exports as supabase.
Breaking changes
realtime.T_ParamSpec and realtime.T_Retval are no longer importable from realtime. They are still available from realtime.types.
Tests
src/supabase/tests/test_exports.py checks that every package declares __all__, that each listed name exists, and that the error classes are the same objects in the package, in supabase and in supabase.client.
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Improvements
Made authentication, storage, and functions errors accessible through the relevant package exports, including the main Supabase package.
Clarified which names are publicly exported across several packages.
Tests
Added checks that public exports are consistent, unique, and reference the expected objects.
Package initializers now declare public exports and expose selected authentication, functions, and storage errors at package roots. The Supabase package imports selected errors through those roots and adds them to its own exports. Realtime no longer imports or exports T_ParamSpec and T_Retval. New tests check declared exports, duplicate names, and object identity across package roots.
Possibly related PRs
supabase/supabase-py#1963: Changes auth and realtime package re-exports, which this pull request also updates.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 49f17b1e-17ef-412d-a48f-f80b740128a9
Commits
Reviewing files that changed from the base of the PR and between a5dca02 and 4139057.
Files selected for processing: 7
src/auth/src/supabase_auth/__init__.py
src/functions/src/supabase_functions/__init__.py
src/realtime/src/realtime/__init__.py
src/storage/src/storage3/__init__.py
src/supabase/src/supabase/__init__.py
src/supabase/tests/test_exports.py
src/utils/src/supabase_utils/__init__.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.
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-2725. Continues the work from #1950 (SDK-2694).
What changed
Every package now declares
__all__, and every service's public error classes can be imported from the package itself and fromsupabase.supabase_authX as Xre-exports with grouped imports and__all__. Now exports the error classes fromerrors.pyandErrorCode.realtimeX as Xre-exports with grouped imports and__all__. Dropped the internalT_ParamSpecandT_Retvaltype variables from the package.storage3StorageException,StorageApiError,StorageApiErrorMessageandVectorBucketException.supabase_functionsFunctionsError,FunctionsHttpError,FunctionsRelayError,FunctionsApiErrorDictand__version__.supabase_utils__all__. Its public API lives in thehttpandtypessubmodules.supabase__all__into a list. AddsStorageApiError,VectorBucketException,AuthInvalidJwtError,CustomAuthErrorandUserDoesntExist. Imports them from the package roots.supabase.clientsupabase.Breaking changes
realtime.T_ParamSpecandrealtime.T_Retvalare no longer importable fromrealtime. They are still available fromrealtime.types.Tests
src/supabase/tests/test_exports.pychecks that every package declares__all__, that each listed name exists, and that the error classes are the same objects in the package, insupabaseand insupabase.client.