Skip to content

refactor: declare __all__ in every package and export the service errors - #1979

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2725-exports-add-all-to-every-package
Nov 4, 2026
Merged

spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2725-exports-add-all-to-every-package

Conversation

@spydon

@spydon spydon commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

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

Change: Refactor

Merge Risk: Minimal · up to 41390

The package exports are consistent with the declared dependencies. No actionable merge-blocking issue remains; merge after normal checks pass.

- [ ] 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.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • 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.

@spydon
spydon merged commit efad263 into main Nov 4, 2026
57 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-2725-exports-add-all-to-every-package branch November 4, 2026 15:24
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.

1 participant