Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: ci, default, clean, start-infra, stop-infra

PACKAGES := functions realtime storage auth postgrest supabase
PACKAGES := utils functions realtime storage auth postgrest supabase
FORALL_PKGS = $(foreach pkg, $(PACKAGES), $(pkg).$(1))

help::
Expand Down Expand Up @@ -58,6 +58,9 @@ help::
realtime.%:
@$(MAKE) -C src/realtime $*

utils.%:
@$(MAKE) -C src/utils $*

functions.%:
@$(MAKE) -C src/functions $*

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ members = [
"src/supabase",
"src/storage",
"src/postgrest",
"src/auth"
"src/auth",
"src/utils",
]

[tool.uv.sources]
Expand Down
12 changes: 0 additions & 12 deletions src/functions/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ mypy:
help::
@echo " mypy -- run mypy on supabase_functions package"

unasync:
uv run --package supabase_functions run-unasync.py
help::
@echo " unasync -- invoke run-unasync.py helper"

build-sync: unasync
sed -i '0,/SyncMock, /{s/SyncMock, //}' tests/_sync/test_function_client.py
sed -i 's/SyncMock/Mock/g' tests/_sync/test_function_client.py
sed -i 's/SyncClient/Client/g' src/supabase_functions/_sync/functions_client.py tests/_sync/test_function_client.py
help::
@echo " build-sync -- generate _sync from _async implementation"

clean:
rm -rf htmlcov .pytest_cache .mypy_cache .ruff_cache
rm -f .coverage coverage.xml
Expand Down
4 changes: 4 additions & 0 deletions src/functions/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ requires-python = ">=3.9"
dependencies = [
"httpx[http2] >=0.26,<0.29",
"strenum >=0.4.15",
"supabase-utils==0.26.1",
"yarl>=1.20.1",
]

Expand Down Expand Up @@ -43,6 +44,9 @@ dev = [{ include-group = "lints" }, {include-group = "tests" }]
[tool.uv]
default-groups = [ "dev" ]

[tool.uv.sources]
supabase-utils = { workspace = true }

[tool.pytest.ini_options]
asyncio_mode = "auto"
addopts = "tests"
Expand Down
30 changes: 1 addition & 29 deletions src/functions/src/supabase_functions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from __future__ import annotations

from typing import Literal, Union, overload

from ._async.functions_client import AsyncFunctionsClient
from ._sync.functions_client import SyncFunctionsClient
from .client import AsyncFunctionsClient, SyncFunctionsClient, create_client
from .utils import FunctionRegion

__all__ = [
Expand All @@ -12,28 +9,3 @@
"AsyncFunctionsClient",
"SyncFunctionsClient",
]


@overload
def create_client(
url: str, headers: dict[str, str], *, is_async: Literal[True], verify: bool
) -> AsyncFunctionsClient: ...


@overload
def create_client(
url: str, headers: dict[str, str], *, is_async: Literal[False], verify: bool
) -> SyncFunctionsClient: ...


def create_client(
url: str,
headers: dict[str, str],
*,
is_async: bool,
verify: bool = True,
) -> Union[AsyncFunctionsClient, SyncFunctionsClient]:
if is_async:
return AsyncFunctionsClient(url, headers, verify)
else:
return SyncFunctionsClient(url, headers, verify)
1 change: 0 additions & 1 deletion src/functions/src/supabase_functions/_async/__init__.py

This file was deleted.

162 changes: 0 additions & 162 deletions src/functions/src/supabase_functions/_async/functions_client.py

This file was deleted.

1 change: 0 additions & 1 deletion src/functions/src/supabase_functions/_sync/__init__.py

This file was deleted.

Loading