supabase_functions 0.4.5__tar.gz → 0.4.7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supabase_functions
3
- Version: 0.4.5
3
+ Version: 0.4.7
4
4
  Summary: Library for Supabase Functions
5
5
  Home-page: https://github.com/supabase-community/functions-py
6
6
  License: MIT
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.9
14
14
  Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
- Requires-Dist: httpx (>=0.24,<0.28)
17
+ Requires-Dist: httpx[http2] (>=0.24,<0.28)
18
18
  Project-URL: Repository, https://github.com/supabase-community/functions-py
19
19
  Description-Content-Type: text/markdown
20
20
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "supabase_functions"
3
- version = "0.4.5"
3
+ version = "0.4.7"
4
4
  description = "Library for Supabase Functions"
5
5
  authors = [
6
6
  "Joel Lee <joel@joellee.org>",
@@ -12,7 +12,7 @@ repository = "https://github.com/supabase-community/functions-py"
12
12
 
13
13
  [tool.poetry.dependencies]
14
14
  python = "^3.8"
15
- httpx = ">=0.24,<0.28"
15
+ httpx = {version = ">=0.24,<0.28", extras = ["http2"]}
16
16
 
17
17
  [tool.poetry.group.dev.dependencies]
18
18
  python-semantic-release = ">=8.1.1,<10.0.0"
@@ -21,7 +21,7 @@ isort = "^5.12.0"
21
21
  pre-commit = "^3.4.0"
22
22
  pyjwt = "^2.8.0"
23
23
  pytest = ">=7.4.2,<9.0.0"
24
- pytest-cov = "^4.0.0"
24
+ pytest-cov = ">=4,<6"
25
25
  unasync-cli = "^0.0.9"
26
26
  pytest-asyncio = ">=0.21.1,<0.24.0"
27
27
  respx = ">=0.20.2,<0.22.0"
@@ -10,22 +10,24 @@ __all__ = ["create_client"]
10
10
 
11
11
  @overload
12
12
  def create_client(
13
- url: str, headers: dict[str, str], *, is_async: Literal[True]
14
- ) -> AsyncFunctionsClient:
15
- ...
13
+ url: str, headers: dict[str, str], *, is_async: Literal[True], verify: bool
14
+ ) -> AsyncFunctionsClient: ...
16
15
 
17
16
 
18
17
  @overload
19
18
  def create_client(
20
- url: str, headers: dict[str, str], *, is_async: Literal[False]
21
- ) -> SyncFunctionsClient:
22
- ...
19
+ url: str, headers: dict[str, str], *, is_async: Literal[False], verify: bool
20
+ ) -> SyncFunctionsClient: ...
23
21
 
24
22
 
25
23
  def create_client(
26
- url: str, headers: dict[str, str], *, is_async: bool
24
+ url: str,
25
+ headers: dict[str, str],
26
+ *,
27
+ is_async: bool,
28
+ verify: bool = True,
27
29
  ) -> Union[AsyncFunctionsClient, SyncFunctionsClient]:
28
30
  if is_async:
29
- return AsyncFunctionsClient(url, headers)
31
+ return AsyncFunctionsClient(url, headers, verify)
30
32
  else:
31
- return SyncFunctionsClient(url, headers)
33
+ return SyncFunctionsClient(url, headers, verify)
@@ -7,13 +7,19 @@ from ..utils import AsyncClient, __version__
7
7
 
8
8
 
9
9
  class AsyncFunctionsClient:
10
- def __init__(self, url: str, headers: Dict):
10
+ def __init__(self, url: str, headers: Dict, verify: bool = True):
11
11
  self.url = url
12
12
  self.headers = {
13
13
  "User-Agent": f"supabase-py/functions-py v{__version__}",
14
14
  **headers,
15
15
  }
16
- self._client = AsyncClient(base_url=self.url, headers=self.headers)
16
+ self._client = AsyncClient(
17
+ base_url=self.url,
18
+ headers=self.headers,
19
+ verify=bool(verify),
20
+ follow_redirects=True,
21
+ http2=True,
22
+ )
17
23
 
18
24
  async def _request(
19
25
  self,
@@ -7,13 +7,19 @@ from ..utils import SyncClient, __version__
7
7
 
8
8
 
9
9
  class SyncFunctionsClient:
10
- def __init__(self, url: str, headers: Dict):
10
+ def __init__(self, url: str, headers: Dict, verify: bool = True):
11
11
  self.url = url
12
12
  self.headers = {
13
13
  "User-Agent": f"supabase-py/functions-py v{__version__}",
14
14
  **headers,
15
15
  }
16
- self._client = SyncClient(base_url=self.url, headers=self.headers)
16
+ self._client = SyncClient(
17
+ base_url=self.url,
18
+ headers=self.headers,
19
+ verify=bool(verify),
20
+ follow_redirects=True,
21
+ http2=True,
22
+ )
17
23
 
18
24
  def _request(
19
25
  self,
@@ -1,7 +1,7 @@
1
1
  from httpx import AsyncClient as AsyncClient # noqa: F401
2
2
  from httpx import Client as BaseClient
3
3
 
4
- __version__ = "0.4.5"
4
+ __version__ = "0.4.7"
5
5
 
6
6
 
7
7
  class SyncClient(BaseClient):