forked from supabase/supabase-py
-
Notifications
You must be signed in to change notification settings - Fork 0
Unify sync and async clients #2
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
Open
tinvaan
wants to merge
45
commits into
studio/tox
Choose a base branch
from
studio/tox-sync-async
base: studio/tox
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
588c4c2 to
eae626f
Compare
eae626f to
6244295
Compare
Owner
Author
|
Test coverage is now up to 78% after the test suite revamp. ---------- coverage: platform darwin, python 3.9.18-final-0 ----------
Name Stmts Miss Cover
-----------------------------------------------------
scripts.py 11 11 0%
supabase/__init__.py 9 0 100%
supabase/__version__.py 1 0 100%
supabase/client/__init__.py 17 0 100%
supabase/client/default.py 133 24 82%
supabase/client/exceptions.py 4 0 100%
supabase/client/services.py 32 6 81%
supabase/lib/__init__.py 3 0 100%
supabase/lib/client_options.py 33 0 100%
supabase/lib/realtime_client.py 29 20 31%
-----------------------------------------------------
TOTAL 272 61 78%
Coverage HTML written to dir htmlcov
Results (31.69s):
17 passed
1 skipped
py39: OK (38.44=setup[3.35]+cmd[1.98,33.11] seconds)
congratulations :) (38.50 seconds) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current implementation of Supabase's sync and async client contains a ton of redundant code that is shared between both classes and should ideally reside under one class.
This PR is an attempt to unify the two client classes and host them in one single
SupabaseClientclass. A single client class should in theory be easier to maintain and an significantly bumps the project's code coverage(up to 63% from 44% earlier).py39 run-test: commands[1] | poetry run pytest -s --disable-warnings --cov=./ --cov-report=term --cov-report=html Test session starts (platform: darwin, Python 3.9.18, pytest 8.0.1, pytest-sugar 1.0.0) cachedir: .tox/py39/.pytest_cache rootdir: /Users/harish/Workspaces/oss/supabase/supabase-py plugins: sugar-1.0.0, cov-4.1.0, anyio-4.2.0 collected 52 items tests/test_client.py xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 94% █████████▌ tests/test_client_options.py ✓✓ 98% █████████▊ tests/test_function_configuration.py ✓ 100% ██████████ ---------- coverage: platform darwin, python 3.9.18-final-0 ---------- Name Stmts Miss Cover ----------------------------------------------------- scripts.py 11 11 0% supabase/__init__.py 7 0 100% supabase/__version__.py 1 0 100% supabase/client/__init__.py 10 0 100% supabase/client/auth.py 10 2 80% supabase/client/default.py 106 45 58% supabase/client/exceptions.py 4 2 50% supabase/lib/__init__.py 3 0 100% supabase/lib/client_options.py 33 0 100% supabase/lib/realtime_client.py 29 20 31% ----------------------------------------------------- TOTAL 214 80 63% Coverage HTML written to dir htmlcov Results (0.21s): 3 passed 49 xfailed ____________________________________________________________________________________ summary _____________________________________________________________________________________ py39: commands succeeded congratulations :)