Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
package: ["functions", "realtime", "storage", "auth", "postgrest", "supabase"]
runs-on: ${{ matrix.os }}
steps:
Expand Down
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
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

[tool.uv.sources]
realtime = { workspace = true }
supabase_functions = { workspace = true }
supabase_auth = { workspace = true }
supabase_utils = { workspace = true }
storage3 = { workspace = true }
postgrest = { workspace = true }
supabase = { workspace = true }
Expand Down
14 changes: 1 addition & 13 deletions src/functions/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,10 @@ help::
@echo " pytest -- run pytest on supabase_functions package"

mypy:
uv run --package supabase_functions mypy src/supabase_functions tests
uv run --package supabase_functions mypy --strict src/supabase_functions tests
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
34 changes: 32 additions & 2 deletions src/functions/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ maintainers = [
]
license = "MIT"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"httpx[http2] >=0.26,<0.29",
"pydantic>=2.12.2",
"strenum >=0.4.15",
"supabase-utils==2.28.0", # x-release-please-version
"yarl>=1.20.1",
]

Expand All @@ -32,7 +34,6 @@ tests = [
"pytest-asyncio >=0.21.1,<1.2.0",
]
lints = [
"unasync>=0.6.0",
"ruff >=0.12.1",
"python-lsp-server (>=1.12.2,<2.0.0)",
"pylsp-mypy (>=0.7.0,<0.8.0)",
Expand All @@ -43,13 +44,42 @@ 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"
filterwarnings = [
"ignore::DeprecationWarning", # ignore deprecation warnings globally
]

[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
# "B",
# flake8-simplify
# "SIM",
# isort
"I",
]
ignore = ["E712", "E501", "E402", "UP006", "UP035"]

[build-system]
requires = ["uv_build>=0.8.3,<0.9.0"]
build-backend = "uv_build"

[tool.mypy]
strict = true
allow_redefinition = true

no_warn_no_return = true
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
13 changes: 0 additions & 13 deletions src/functions/run-unasync.py

This file was deleted.

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.

175 changes: 0 additions & 175 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