-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement sync/async support with httppx and unasync
The "_sync" folder is generated automatically with the "make build_sync" command. All scripts in the "_async" folder will be translated into their synchronous form using "unasync" behind the scenes.
- Loading branch information
Showing
18 changed files
with
1,376 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
build_sync: | ||
if [ -d "build" ]; then rm -r "build"; fi | ||
python build_sync.py build | ||
if [ -d "gotrue/_sync" ]; then rm -r "gotrue/_sync"; fi | ||
cp -r "build/lib/gotrue/_sync" "gotrue/_sync" | ||
rm -r "build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from setuptools import find_packages, setup | ||
from unasync import cmdclass_build_py | ||
|
||
setup( | ||
packages=find_packages(exclude=["tests"]), | ||
# package_dir={"": "gotrue"}, | ||
cmdclass={"build_py": cmdclass_build_py()}, # type: ignore | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
__version__ = "0.2.0" | ||
|
||
from . import api # noqa: F401 | ||
from . import client # noqa: F401 | ||
from .client import Client, GoTrueClient # noqa: F401 | ||
from .lib.types import * # noqa: F401, F403 | ||
from ._async.api import AsyncGoTrueApi # noqa: F401 | ||
from ._async.client import AsyncGoTrueClient # noqa: F401 | ||
from ._async.storage import AsyncMemoryStorage, AsyncSupportedStorage # noqa: F401 | ||
from ._sync.api import SyncGoTrueApi # noqa: F401 | ||
from ._sync.client import SyncGoTrueClient # noqa: F401 | ||
from ._sync.storage import SyncMemoryStorage, SyncSupportedStorage # noqa: F401 | ||
from .common.types import * # noqa: F401, F403 | ||
|
||
Client = SyncGoTrueClient | ||
GoTrueApi = SyncGoTrueApi |
File renamed without changes.
Oops, something went wrong.