supabase_functions 0.5.0__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/LICENSE +1 -1
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/PKG-INFO +3 -3
- supabase_functions-0.6.0/pyproject.toml +33 -0
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/supabase_functions/_async/functions_client.py +22 -10
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/supabase_functions/_sync/functions_client.py +22 -10
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/supabase_functions/utils.py +0 -2
- supabase_functions-0.6.0/supabase_functions/version.py +1 -0
- supabase_functions-0.5.0/pyproject.toml +0 -44
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/README.md +0 -0
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/supabase_functions/__init__.py +0 -0
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/supabase_functions/_async/__init__.py +0 -0
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/supabase_functions/_sync/__init__.py +0 -0
- {supabase_functions-0.5.0 → supabase_functions-0.6.0}/supabase_functions/errors.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: supabase_functions
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Library for Supabase Functions
|
|
5
|
-
Home-page: https://github.com/supabase
|
|
5
|
+
Home-page: https://github.com/supabase/functions-py
|
|
6
6
|
License: MIT
|
|
7
7
|
Author: Joel Lee
|
|
8
8
|
Author-email: joel@joellee.org
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Requires-Dist: httpx[http2] (>=0.24,<0.28)
|
|
18
|
-
Project-URL: Repository, https://github.com/supabase
|
|
18
|
+
Project-URL: Repository, https://github.com/supabase/functions-py
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
|
|
21
21
|
# Functions-py
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "supabase_functions"
|
|
3
|
+
version = "0.6.0" # {x-release-please-version}
|
|
4
|
+
description = "Library for Supabase Functions"
|
|
5
|
+
authors = [
|
|
6
|
+
"Joel Lee <joel@joellee.org>",
|
|
7
|
+
"Andrew Smith <a.smith@silentworks.co.uk>"
|
|
8
|
+
]
|
|
9
|
+
license = "MIT"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
repository = "https://github.com/supabase/functions-py"
|
|
12
|
+
|
|
13
|
+
[tool.poetry.dependencies]
|
|
14
|
+
python = "^3.8"
|
|
15
|
+
httpx = {version = ">=0.24,<0.28", extras = ["http2"]}
|
|
16
|
+
|
|
17
|
+
[tool.poetry.group.dev.dependencies]
|
|
18
|
+
black = ">=23.9.1,<25.0.0"
|
|
19
|
+
isort = "^5.12.0"
|
|
20
|
+
pre-commit = "^3.4.0"
|
|
21
|
+
pyjwt = "^2.8.0"
|
|
22
|
+
pytest = ">=7.4.2,<9.0.0"
|
|
23
|
+
pytest-cov = ">=4,<6"
|
|
24
|
+
unasync-cli = "^0.0.9"
|
|
25
|
+
pytest-asyncio = ">=0.21.1,<0.25.0"
|
|
26
|
+
respx = ">=0.20.2,<0.22.0"
|
|
27
|
+
|
|
28
|
+
[tool.pytest.ini_options]
|
|
29
|
+
asyncio_mode = "auto"
|
|
30
|
+
|
|
31
|
+
[build-system]
|
|
32
|
+
requires = ["poetry-core>=1.0.0"]
|
|
33
|
+
build-backend = "poetry.core.masonry.api"
|
{supabase_functions-0.5.0 → supabase_functions-0.6.0}/supabase_functions/_async/functions_client.py
RENAMED
|
@@ -3,11 +3,19 @@ from typing import Any, Dict, Literal, Optional, Union
|
|
|
3
3
|
from httpx import HTTPError, Response
|
|
4
4
|
|
|
5
5
|
from ..errors import FunctionsHttpError, FunctionsRelayError
|
|
6
|
-
from ..utils import AsyncClient
|
|
6
|
+
from ..utils import AsyncClient
|
|
7
|
+
from ..version import __version__
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class AsyncFunctionsClient:
|
|
10
|
-
def __init__(
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
url: str,
|
|
14
|
+
headers: Dict,
|
|
15
|
+
timeout: int,
|
|
16
|
+
verify: bool = True,
|
|
17
|
+
proxy: Optional[str] = None,
|
|
18
|
+
):
|
|
11
19
|
self.url = url
|
|
12
20
|
self.headers = {
|
|
13
21
|
"User-Agent": f"supabase-py/functions-py v{__version__}",
|
|
@@ -18,6 +26,7 @@ class AsyncFunctionsClient:
|
|
|
18
26
|
headers=self.headers,
|
|
19
27
|
verify=bool(verify),
|
|
20
28
|
timeout=timeout,
|
|
29
|
+
proxy=proxy,
|
|
21
30
|
follow_redirects=True,
|
|
22
31
|
http2=True,
|
|
23
32
|
)
|
|
@@ -65,18 +74,21 @@ class AsyncFunctionsClient:
|
|
|
65
74
|
`responseType`: how the response should be parsed. The default is `json`
|
|
66
75
|
"""
|
|
67
76
|
headers = self.headers
|
|
77
|
+
body = None
|
|
78
|
+
response_type = "text/plain"
|
|
68
79
|
if invoke_options is not None:
|
|
69
80
|
headers.update(invoke_options.get("headers", {}))
|
|
81
|
+
response_type = invoke_options.get("responseType", "text/plain")
|
|
70
82
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
)
|
|
83
|
+
region = invoke_options.get("region")
|
|
84
|
+
if region and isinstance(region, str) and region != "any":
|
|
85
|
+
headers["x-region"] = region.lower().strip()
|
|
75
86
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
body = invoke_options.get("body")
|
|
88
|
+
if isinstance(body, str):
|
|
89
|
+
headers["Content-Type"] = "text/plain"
|
|
90
|
+
elif isinstance(body, dict):
|
|
91
|
+
headers["Content-Type"] = "application/json"
|
|
80
92
|
|
|
81
93
|
response = await self._request(
|
|
82
94
|
"POST", f"{self.url}/{function_name}", headers=headers, json=body
|
{supabase_functions-0.5.0 → supabase_functions-0.6.0}/supabase_functions/_sync/functions_client.py
RENAMED
|
@@ -3,11 +3,19 @@ from typing import Any, Dict, Literal, Optional, Union
|
|
|
3
3
|
from httpx import HTTPError, Response
|
|
4
4
|
|
|
5
5
|
from ..errors import FunctionsHttpError, FunctionsRelayError
|
|
6
|
-
from ..utils import SyncClient
|
|
6
|
+
from ..utils import SyncClient
|
|
7
|
+
from ..version import __version__
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class SyncFunctionsClient:
|
|
10
|
-
def __init__(
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
url: str,
|
|
14
|
+
headers: Dict,
|
|
15
|
+
timeout: int,
|
|
16
|
+
verify: bool = True,
|
|
17
|
+
proxy: Optional[str] = None,
|
|
18
|
+
):
|
|
11
19
|
self.url = url
|
|
12
20
|
self.headers = {
|
|
13
21
|
"User-Agent": f"supabase-py/functions-py v{__version__}",
|
|
@@ -18,6 +26,7 @@ class SyncFunctionsClient:
|
|
|
18
26
|
headers=self.headers,
|
|
19
27
|
verify=bool(verify),
|
|
20
28
|
timeout=timeout,
|
|
29
|
+
proxy=proxy,
|
|
21
30
|
follow_redirects=True,
|
|
22
31
|
http2=True,
|
|
23
32
|
)
|
|
@@ -65,18 +74,21 @@ class SyncFunctionsClient:
|
|
|
65
74
|
`responseType`: how the response should be parsed. The default is `json`
|
|
66
75
|
"""
|
|
67
76
|
headers = self.headers
|
|
77
|
+
body = None
|
|
78
|
+
response_type = "text/plain"
|
|
68
79
|
if invoke_options is not None:
|
|
69
80
|
headers.update(invoke_options.get("headers", {}))
|
|
81
|
+
response_type = invoke_options.get("responseType", "text/plain")
|
|
70
82
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
)
|
|
83
|
+
region = invoke_options.get("region")
|
|
84
|
+
if region and isinstance(region, str) and region != "any":
|
|
85
|
+
headers["x-region"] = region.lower().strip()
|
|
75
86
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
body = invoke_options.get("body")
|
|
88
|
+
if isinstance(body, str):
|
|
89
|
+
headers["Content-Type"] = "text/plain"
|
|
90
|
+
elif isinstance(body, dict):
|
|
91
|
+
headers["Content-Type"] = "application/json"
|
|
80
92
|
|
|
81
93
|
response = self._request(
|
|
82
94
|
"POST", f"{self.url}/{function_name}", headers=headers, json=body
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.6.0" # {x-release-please-version}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
[tool.poetry]
|
|
2
|
-
name = "supabase_functions"
|
|
3
|
-
version = "0.5.0"
|
|
4
|
-
description = "Library for Supabase Functions"
|
|
5
|
-
authors = [
|
|
6
|
-
"Joel Lee <joel@joellee.org>",
|
|
7
|
-
"Andrew Smith <a.smith@silentworks.co.uk>"
|
|
8
|
-
]
|
|
9
|
-
license = "MIT"
|
|
10
|
-
readme = "README.md"
|
|
11
|
-
repository = "https://github.com/supabase-community/functions-py"
|
|
12
|
-
|
|
13
|
-
[tool.poetry.dependencies]
|
|
14
|
-
python = "^3.8"
|
|
15
|
-
httpx = {version = ">=0.24,<0.28", extras = ["http2"]}
|
|
16
|
-
|
|
17
|
-
[tool.poetry.group.dev.dependencies]
|
|
18
|
-
python-semantic-release = ">=8.1.1,<10.0.0"
|
|
19
|
-
black = ">=23.9.1,<25.0.0"
|
|
20
|
-
isort = "^5.12.0"
|
|
21
|
-
pre-commit = "^3.4.0"
|
|
22
|
-
pyjwt = "^2.8.0"
|
|
23
|
-
pytest = ">=7.4.2,<9.0.0"
|
|
24
|
-
pytest-cov = ">=4,<6"
|
|
25
|
-
unasync-cli = "^0.0.9"
|
|
26
|
-
pytest-asyncio = ">=0.21.1,<0.24.0"
|
|
27
|
-
respx = ">=0.20.2,<0.22.0"
|
|
28
|
-
|
|
29
|
-
[tool.semantic_release]
|
|
30
|
-
version_variables = ["supabase_functions/utils.py:__version__"]
|
|
31
|
-
version_toml = ["pyproject.toml:tool.poetry.version"]
|
|
32
|
-
major_on_zero = false
|
|
33
|
-
commit_message = "chore(release): bump version to v{version}"
|
|
34
|
-
build_command = "curl -sSL https://install.python-poetry.org | python - && export PATH=\"/github/home/.local/bin:$PATH\" && poetry install && poetry build"
|
|
35
|
-
upload_to_vcs_release = true
|
|
36
|
-
branch = "main"
|
|
37
|
-
changelog_components = "semantic_release.changelog.changelog_headers,semantic_release.changelog.compare_url"
|
|
38
|
-
|
|
39
|
-
[tool.pytest.ini_options]
|
|
40
|
-
asyncio_mode = "auto"
|
|
41
|
-
|
|
42
|
-
[build-system]
|
|
43
|
-
requires = ["poetry-core>=1.0.0"]
|
|
44
|
-
build-backend = "poetry.core.masonry.api"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|