Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Supabase_py to Supabase #55

Merged
merged 2 commits into from
Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ We can then read the keys in the python source code.

```python
import os
from supabase_py import create_client, Client
from supabase import create_client, Client

url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_KEY")
Expand Down Expand Up @@ -88,7 +88,7 @@ This is a sample of how you'd use supabase-py. Functions and tests are WIP
## Authenticate

```python
from supabase_py import create_client, Client
from supabase import create_client, Client

url: str = os.environ.get("SUPABASE_TEST_URL")
key: str = os.environ.get("SUPABASE_TEST_KEY")
Expand All @@ -102,7 +102,7 @@ user = supabase.auth.sign_up(email=random_email, password=random_password)
## Sign-in

```python
from supabase_py import create_client, Client
from supabase import create_client, Client

url: str = os.environ.get("SUPABASE_TEST_URL")
key: str = os.environ.get("SUPABASE_TEST_KEY")
Expand All @@ -118,7 +118,7 @@ user = supabase.auth.sign_in(email=random_email, password=random_password)
#### Insertion of Data

```python
from supabase_py import create_client, Client
from supabase import create_client, Client

url: str = os.environ.get("SUPABASE_TEST_URL")
key: str = os.environ.get("SUPABASE_TEST_KEY")
Expand All @@ -130,7 +130,7 @@ assert len(data.get("data", [])) > 0
#### Selection of Data

```python
from supabase_py import create_client, Client
from supabase import create_client, Client

url: str = os.environ.get("SUPABASE_TEST_URL")
key: str = os.environ.get("SUPABASE_TEST_KEY")
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Welcome to supabase's documentation!
====================================

.. automodule:: supabase_py
.. automodule:: supabase
:members:
:show-inheritance:

Expand Down
2 changes: 1 addition & 1 deletion docs/query_builder.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Query Builder
================

.. automodule:: supabase_py.lib.query_builder
.. automodule:: supabase.lib.query_builder
:members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/storage_bucket.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Storage Bucket
================

.. automodule:: supabase_py.lib.storage.storage_bucket_api
.. automodule:: supabase.lib.storage.storage_bucket_api
:members:
:show-inheritance:
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "supabase-py"
version = "0.0.2"
name = "supabase"
version = "0.0.3"
description = "Supabase client for Python."
authors = ["Joel Lee <joel@joellee.org>", "Leon Fedden <leonfedden@gmail.com>"]
license = "MIT"
Expand Down
6 changes: 6 additions & 0 deletions supabase/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__version__ = "0.0.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be 0.0.3??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, good catch. It should be 0.0.3 Thanks!


from supabase import client, lib
from supabase.client import Client, create_client

__all__ = ["client", "lib", "Client", "create_client"]
12 changes: 6 additions & 6 deletions supabase_py/client.py → supabase/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from postgrest_py import PostgrestClient

from supabase_py.lib.auth_client import SupabaseAuthClient
from supabase_py.lib.constants import DEFAULT_HEADERS
from supabase_py.lib.query_builder import SupabaseQueryBuilder
from supabase_py.lib.realtime_client import SupabaseRealtimeClient
from supabase_py.lib.storage_client import SupabaseStorageClient
from supabase.lib.auth_client import SupabaseAuthClient
from supabase.lib.constants import DEFAULT_HEADERS
from supabase.lib.query_builder import SupabaseQueryBuilder
from supabase.lib.realtime_client import SupabaseRealtimeClient
from supabase.lib.storage_client import SupabaseStorageClient

DEFAULT_OPTIONS = {
"schema": "public",
Expand Down Expand Up @@ -213,7 +213,7 @@ def create_client(supabase_url: str, supabase_key: str, **options) -> Client:
--------
Instanciating the client.
>>> import os
>>> from supabase_py import create_client, Client
>>> from supabase import create_client, Client
>>>
>>> url: str = os.environ.get("SUPABASE_TEST_URL")
>>> key: str = os.environ.get("SUPABASE_TEST_KEY")
Expand Down
3 changes: 3 additions & 0 deletions supabase/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from supabase.lib import auth_client, query_builder, realtime_client

__all__ = ["auth_client", "query_builder", "realtime_client"]
File renamed without changes.
2 changes: 1 addition & 1 deletion supabase_py/lib/constants.py → supabase/lib/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from supabase_py import __version__
from supabase import __version__

DEFAULT_HEADERS = {"X-Client-Info": f"supabase-py/{__version__}"}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from supabase_py.lib.storage.storage_bucket_api import StorageBucketAPI
from supabase_py.lib.storage.storage_file_api import StorageFileAPI
from supabase.lib.storage.storage_bucket_api import StorageBucketAPI
from supabase.lib.storage.storage_file_api import StorageFileAPI


class SupabaseStorageClient(StorageBucketAPI):
Expand Down
File renamed without changes.
6 changes: 0 additions & 6 deletions supabase_py/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions supabase_py/lib/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from supabase_py import Client, create_client
from supabase import Client, create_client


@pytest.fixture(scope="session")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest

if TYPE_CHECKING:
from supabase_py import Client
from supabase import Client


def _random_string(length: int = 10) -> str:
Expand All @@ -33,7 +33,7 @@ def _assert_authenticated_user(data: Dict[str, Any]) -> None:
@pytest.mark.parametrize("key", ["", None, "valeefgpoqwjgpj", 139, -1, {}, []])
def test_incorrect_values_dont_instanciate_client(url: Any, key: Any) -> None:
"""Ensure we can't instanciate client with nonesense values."""
from supabase_py import Client, create_client
from supabase import Client, create_client

_: Client = create_client(url, key)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import supabase_py
import supabase

"""
Convert this flow into a test
client = supabase_py.Client("<insert link>", "<password>")
client = supabase.Client("<insert link>", "<password>")
client.auth.sign_up({"email": "anemail@gmail.com", "password": "apassword"})
"""

Expand All @@ -13,4 +13,4 @@ def test_dummy() -> None:


def test_client_initialziation() -> None:
client = supabase_py.Client("http://testwebsite.com", "atestapi")
client = supabase.Client("http://testwebsite.com", "atestapi")