Skip to content

feat!: major v3 release - #1370

Merged
spydon merged 61 commits into
mainfrom
v3
Nov 3, 2026
Merged

spydon merged 61 commits into
mainfrom
v3

Conversation

@o-santi

@o-santi o-santi commented Feb 3, 2026 •

Copy link
Copy Markdown
Contributor

@coderabbitai

coderabbitai Bot commented Feb 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

Consolidates and reworks HTTP/client layers: adds a new supabase_utils package with typed request/response abstractions and executors; centralizes Functions and Storage clients into executor-backed implementations; removes many legacy async/sync modules and unasync scripts; updates packaging, Makefiles, tests, and CI (drops Python 3.9).

Changes

Cohort / File(s) Summary
CI
\.github/workflows/ci.yml
Removed Python 3.9 from CI matrix.
Top-level build & workspace
Makefile, pyproject.toml
Added utils package to PACKAGES and workspace members; added utils.% Make target.
New utils package
src/utils/Makefile, src/utils/pyproject.toml, src/utils/src/supabase_utils/*
Added supabase_utils: typed HTTP request/response dataclasses, ResponseHandler, Sync/Async executors, JSON type adapter, packaging and Make targets.
Functions — new central client
src/functions/src/supabase_functions/client.py, src/functions/src/supabase_functions/__init__.py
Introduced generic FunctionsClient with Async/Sync wrappers and create_client factory; moved request mapping and error dispatch to central module; re-exported create_client.
Functions — removals & build changes
src/functions/src/supabase_functions/_async/*, src/functions/src/supabase_functions/_sync/*, src/functions/run-unasync.py, src/functions/Makefile, src/functions/pyproject.toml, src/functions/tests/*
Deleted legacy per-runtime clients and run-unasync script; enabled mypy --strict; removed unasync/build-sync targets; added pydantic and supabase-utils deps; updated tests to new executor/client shapes and types.
Functions — errors & utils tweaks
src/functions/src/supabase_functions/errors.py, src/functions/src/supabase_functions/utils.py, _async/__init__.py, _sync/__init__.py
Added on_error_response and refined FunctionsRelayError; removed BASE64URL_REGEX/is_http_url; removed future annotations in two modules.
Storage — unified clients added
src/storage/src/storage3/client.py, src/storage/src/storage3/file_api.py, src/storage/src/storage3/vectors.py, src/storage/src/storage3/analytics.py, src/storage/src/storage3/types.py, src/storage/src/storage3/exceptions.py
Added unified executor-backed StorageClient, StorageFileApiClient, StorageVectorsClient, StorageAnalyticsClient, updated models and error parsing; integrated supabase_utils request/response tooling.
Storage — legacy removals
src/storage/src/storage3/_async/*, src/storage/src/storage3/_sync/*, src/storage/src/storage3/constants.py, src/storage/src/storage3/utils.py, src/storage/run-unasync.py
Removed many legacy async/sync modules (bucket, file_api, vectors, analytics, request builders), constants and deprecated SyncClient wrapper and run-unasync scripts.
Storage tests & fixtures
src/storage/tests/*, src/storage/tests/_async/*, src/storage/tests/_sync/*
Updated tests/fixtures to new StorageClient/StorageFileApiClient shapes, models (Bucket, MessageResponse), executor.session usage, and removed tests for deprecated utilities.
Supabase client adjustments
src/supabase/src/supabase/*, src/supabase/src/supabase/_async/client.py, src/supabase/src/supabase/_sync/client.py, src/supabase/src/supabase/lib/client_options.py
Made storage_client_timeout optional, pass http_client through, removed DEFAULT_TIMEOUT dependency, and changed import path to storage3.exceptions.StorageException.
Miscellaneous
src/realtime/*, small tests
Minor formatting, typing annotation, and attribute renames (url→base_url, internal _client → executor.session) across tests and small modules.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Client (Sync/Async)
    participant Functions as FunctionsClient
    participant Executor as SyncExecutor/AsyncExecutor
    participant Httpx as httpx.Client/AsyncClient
    participant Handler as ResponseHandler
    rect rgba(200,200,255,0.5)
    Caller->>Functions: invoke(function_name, body?, region?)
    Functions->>Functions: _invoke_options_to_request() -> ToHttpxRequest
    Functions->>Handler: build ResponseHandler(request, on_success, on_failure)
    Functions->>Executor: executor.communicate(request)
    Executor->>Httpx: send httpx.Request
    Httpx-->>Executor: httpx.Response
    Executor->>Handler: call on_success or on_failure (uses on_error_response)
    Handler-->>Caller: return parsed result or raise error
    end
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested reviewers

  • mandarini
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat!: major v3 release' accurately reflects the main change: a major version release (v3) with breaking changes, as evidenced by extensive API restructuring across storage, functions, and utils packages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@coveralls

coveralls commented Feb 3, 2026 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 21905305159

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 27 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+0.5%) to 91.775%

Files with Coverage Reduction New Missed Lines %
src/supabase_auth/_sync/gotrue_client.py 1 72.9%
src/supabase_auth/_async/gotrue_client.py 1 73.76%
src/postgrest/_sync/client.py 1 92.0%
src/storage3/exceptions.py 1 95.83%
src/realtime/_async/client.py 1 71.29%
src/postgrest/_async/client.py 1 92.0%
run-unasync.py 3 0.0%
src/storage3/init.py 3 70.0%
src/supabase/_async/client.py 5 95.31%
src/supabase/_sync/client.py 5 95.24%
Totals Coverage Status
Change from base Build 21866328687: 0.5%
Covered Lines: 8558
Relevant Lines: 9325

💛 - Coveralls

coderabbitai[bot]

This comment was marked as spam.

@timonrieger

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as spam.

this was likely a merge mishap when merging main into storage's branch
coderabbitai[bot]

This comment was marked as spam.

spydon added a commit that referenced this pull request Nov 6, 2026
…y rules (#2008)

## Summary

SDK-2910. The shared ruff config from #1887 (SDK-1689) was lost when v3
became `main` in #1370. Every package except `utils` had its own
`[tool.ruff.lint]` section again. Ruff does not merge those with the
root, so `auth`, `postgrest`, `storage`, `realtime` and `functions`
skipped the root's `B` and `ANN2` rules. That hid a regression of the
`text_search` mutable default that #1887 had fixed.

This restores the shared config, adds more rule families, and tightens
pyrefly now that the minimum is Python 3.12.

## Config

- Every package `pyproject.toml` uses `[tool.ruff] extend =
"../../pyproject.toml"` instead of its own rule list.
- The root config brings back `PLE`, `PLW`, `PIE`, `LOG`, `FLY` and
`YTT` from #1887, and adds `ASYNC`, `C4`, `RSE`, `SIM`, `RET`, `PYI`,
`PT`, `TC`, `PERF` and `RUF`. The full `PT` and `RUF` families replace
`PT014` and `RUF100`. `RUF006` and `ASYNC` also cover SDK-2832.
- `TC` treats `pydantic.BaseModel` subclasses and standard and pydantic
dataclasses as runtime-evaluated. The imports their fields need stay at
runtime, so pydantic validation and `typing.get_type_hints` on them
still work.
- `pyrefly.toml` pins `python-version = "3.12"`. Before, pyrefly used
whatever interpreter the virtual environment had. It also promotes
`unreachable`, `division-by-zero`, `no-any-return-explicit` and
`untyped-namedtuple` to errors. All four were clean.

## Library fixes

- **postgrest:** `text_search` no longer uses a mutable `{}` default
(`B006`). `APIError` raised after a failed response validation chains
the `ValidationError` (`B904`).
- **realtime:** `MaxRetriesExceeded` chains the last connection error
(`B904`). `RealtimePresence` no longer overwrites its loop variable
(`PLW2901`). `__aexit__` uses `contextlib.suppress` (`SIM105`).
- **storage:** The missing-trailing-slash warning now points at the code
that creates the client (`B028`).
- **All clients:** `__enter__` and `__aenter__` return `Self` instead of
the concrete class, so subclasses get the right type (`PYI034`).
- Imports used only in annotations moved under `TYPE_CHECKING` (`TC`).
`__all__` lists are sorted (`RUF022`).
- `auth`'s `AMREntry.method` and `Factor.factor_type` keep `Literal[...]
| str` with `# noqa: PYI051`, because the literals are there for editor
completion.

## Test fixes

- **realtime:** Tests keep a reference to the tasks they start with
`asyncio.create_task` and await them (`RUF006`). Nested `async with`
blocks are merged (`SIM117`).
- **storage:** Removed the unused `delete_left_buckets` fixture, along
with the global bucket list and finalizer helpers that only it used
(`PT021`, `PLW0602`).
- Fixtures that only returned a value no longer `yield` (`PT022`). Their
return types now match what they return, which pyrefly checks.
- Parametrize names are tuples (`PT006`). `pytest.raises` and
`pytest.warns` calls set `match` (`PT011`, `PT030`, `RUF043`). The
duplicate `sanitize_param` case is removed (`PT014`).
- The auth sync tests were regenerated with `make auth.build-sync`.

## Testing

- `make ruff` and `make pyrefly` pass on all packages.
- `functions`, `utils`, `supabase`, `postgrest`, `realtime` and
`storage` test suites pass locally.
- `auth`: the local runs failed with connection errors to the auth
server on `localhost:9998`, so CI is the check for it.
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.

6 participants