Skip to content

Commit 1cd6d87

Browse files
authored
Merge pull request #360 from supabase-community/j0/bump-versions
chore: publish v1.0.0 with new versions of sublibs. py37 is deprecated
2 parents 93a9ef9 + f389e77 commit 1cd6d87

File tree

9 files changed

+183
-236
lines changed

9 files changed

+183
-236
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest]
11-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
11+
python-version: [3.8, 3.9, "3.10", "3.11"]
1212
runs-on: ${{ matrix.os }}
1313
steps:
1414
- name: Clone Repository

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
args: ["--fix=lf"]
1010

1111
- repo: https://github.com/pycqa/isort
12-
rev: 5.10.1
12+
rev: 5.12.0
1313
hooks:
1414
- id: isort
1515
args:
@@ -35,7 +35,7 @@ repos:
3535
]
3636

3737
- repo: https://github.com/psf/black
38-
rev: "22.10.0"
38+
rev: "23.1.0"
3939
hooks:
4040
- id: black
4141

poetry.lock

Lines changed: 143 additions & 195 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "supabase"
3-
version = "0.7.1"
3+
version = "1.0.0"
44
description = "Supabase client for Python."
55
authors = ["Joel Lee <[email protected]>", "Leon Fedden <[email protected]>", "Daniel Reinón García <[email protected]>", "Leynier Gutiérrez González <[email protected]>", "Anand"]
66
homepage = "https://github.com/supabase-community/supabase-py"
@@ -15,12 +15,12 @@ classifiers = [
1515
]
1616

1717
[tool.poetry.dependencies]
18-
python = "^3.7"
19-
postgrest-py = ">=0.10.2,<0.11.0"
20-
realtime = "^0.0.5"
21-
gotrue = "^0.5.0"
18+
python = "^3.8"
19+
postgrest-py = "0.10.3"
20+
realtime = "^1.0.0"
21+
gotrue = "^1.0.0"
2222
httpx = "^0.23.0"
23-
storage3 = ">=0.3.5,<0.5.0"
23+
storage3 = "0.5.0"
2424
supafunc = "^0.2.2"
2525
python-semantic-release = "7.33.0"
2626

supabase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.7.1"
1+
__version__ = "1.0.0"

supabase/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def _init_supabase_auth_client(
178178
url=auth_url,
179179
auto_refresh_token=client_options.auto_refresh_token,
180180
persist_session=client_options.persist_session,
181-
local_storage=client_options.local_storage,
181+
storage=client_options.storage,
182182
headers=client_options.headers,
183183
)
184184

supabase/lib/auth_client.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
from typing import Dict, Optional
1+
from typing import Dict, Union
22

3-
from gotrue import (
4-
CookieOptions,
5-
SyncGoTrueAPI,
6-
SyncGoTrueClient,
7-
SyncMemoryStorage,
8-
SyncSupportedStorage,
9-
)
10-
from gotrue.constants import COOKIE_OPTIONS
3+
from gotrue import SyncGoTrueClient, SyncMemoryStorage, SyncSupportedStorage
4+
5+
# TODO - export this from GoTrue-py in next release
6+
from httpx import Client as BaseClient
7+
8+
9+
class SyncClient(BaseClient):
10+
def aclose(self) -> None:
11+
self.close()
1112

1213

1314
class SupabaseAuthClient(SyncGoTrueClient):
@@ -18,22 +19,20 @@ def __init__(
1819
*,
1920
url: str,
2021
headers: Dict[str, str] = {},
22+
storage_key: Union[str, None] = None,
2123
auto_refresh_token: bool = True,
2224
persist_session: bool = True,
23-
local_storage: SyncSupportedStorage = SyncMemoryStorage(),
24-
cookie_options: CookieOptions = CookieOptions.parse_obj(COOKIE_OPTIONS),
25-
api: Optional[SyncGoTrueAPI] = None,
26-
replace_default_headers: bool = False,
25+
storage: SyncSupportedStorage = SyncMemoryStorage(),
26+
http_client: Union[SyncClient, None] = None,
2727
):
2828
"""Instantiate SupabaseAuthClient instance."""
2929
SyncGoTrueClient.__init__(
3030
self,
3131
url=url,
3232
headers=headers,
33+
storage_key=storage_key,
3334
auto_refresh_token=auto_refresh_token,
3435
persist_session=persist_session,
35-
local_storage=local_storage,
36-
cookie_options=cookie_options,
37-
api=api,
38-
replace_default_headers=replace_default_headers,
36+
storage=storage,
37+
http_client=http_client,
3938
)

supabase/lib/client_options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ClientOptions:
2727
persist_session: bool = True
2828
"""Whether to persist a logged in session to storage."""
2929

30-
local_storage: SyncSupportedStorage = field(default_factory=SyncMemoryStorage)
30+
storage: SyncSupportedStorage = field(default_factory=SyncMemoryStorage)
3131
"""A storage provider. Used to store the logged in session."""
3232

3333
realtime: Optional[Dict[str, Any]] = None
@@ -45,7 +45,7 @@ def replace(
4545
headers: Optional[Dict[str, str]] = None,
4646
auto_refresh_token: Optional[bool] = None,
4747
persist_session: Optional[bool] = None,
48-
local_storage: Optional[SyncSupportedStorage] = None,
48+
storage: Optional[SyncSupportedStorage] = None,
4949
realtime: Optional[Dict[str, Any]] = None,
5050
fetch: Optional[Callable] = None,
5151
timeout: Union[int, float, Timeout] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,
@@ -58,7 +58,7 @@ def replace(
5858
auto_refresh_token or self.auto_refresh_token
5959
)
6060
client_options.persist_session = persist_session or self.persist_session
61-
client_options.local_storage = local_storage or self.local_storage
61+
client_options.storage = storage or self.storage
6262
client_options.realtime = realtime or self.realtime
6363
client_options.fetch = fetch or self.fetch
6464
client_options.timeout = timeout or self.timeout

tests/test_client_options.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55

66
def test__client_options__replace__returns_updated_options():
7-
local_storage = SyncMemoryStorage()
8-
local_storage.set_item("key", "value")
7+
storage = SyncMemoryStorage()
8+
storage.set_item("key", "value")
99
options = ClientOptions(
1010
schema="schema",
1111
headers={"key": "value"},
1212
auto_refresh_token=False,
1313
persist_session=False,
14-
local_storage=local_storage,
14+
storage=storage,
1515
realtime={"key": "value"},
1616
)
1717

@@ -21,7 +21,7 @@ def test__client_options__replace__returns_updated_options():
2121
headers={"key": "value"},
2222
auto_refresh_token=False,
2323
persist_session=False,
24-
local_storage=local_storage,
24+
storage=storage,
2525
realtime={"key": "value"},
2626
)
2727

@@ -30,14 +30,14 @@ def test__client_options__replace__returns_updated_options():
3030

3131
def test__client_options__replace__updates_only_new_options():
3232
# Arrange
33-
local_storage = SyncMemoryStorage()
34-
local_storage.set_item("key", "value")
35-
options = ClientOptions(local_storage=local_storage)
33+
storage = SyncMemoryStorage()
34+
storage.set_item("key", "value")
35+
options = ClientOptions(storage=storage)
3636
new_options = options.replace()
3737

3838
# Act
39-
new_options.local_storage.set_item("key", "new_value")
39+
new_options.storage.set_item("key", "new_value")
4040

4141
# Assert
42-
assert options.local_storage.get_item("key") == "new_value"
43-
assert new_options.local_storage.get_item("key") == "new_value"
42+
assert options.storage.get_item("key") == "new_value"
43+
assert new_options.storage.get_item("key") == "new_value"

0 commit comments

Comments
 (0)