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

Unify sync and async clients #2

Open
wants to merge 45 commits into
base: studio/tox
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d12a1ce
Markdown lint fixes.
tinvaan Feb 16, 2024
51dd50c
deps++ mdformat-gfm
tinvaan Feb 20, 2024
e3c8cfe
initial tox configuration
tinvaan Feb 19, 2024
903c590
rename poetry scripts file
tinvaan Feb 19, 2024
80bf2b8
update tox and pyproject configurations
tinvaan Feb 19, 2024
d6a487f
show coverage report on terminal as well
tinvaan Feb 19, 2024
81ca897
drop Makefile
tinvaan Feb 19, 2024
c09f3d2
Update CI workflows
tinvaan Mar 3, 2024
7efcfb5
Sync tox envlist with CI envs
tinvaan Mar 3, 2024
bf47b41
Add lint step
tinvaan Mar 3, 2024
c8ccaf7
undo code coverage step
tinvaan Mar 3, 2024
b9a745c
do not disable all warnings & remove unused flake8 section
tinvaan Mar 5, 2024
c5ef463
actually remove the flake8 section
tinvaan Mar 5, 2024
9b84bc5
prepare for a unified client module
tinvaan Feb 19, 2024
5bbf00e
rename auth client class
tinvaan Feb 19, 2024
f140739
rename supabase exception class
tinvaan Feb 19, 2024
f692164
start out with syncclient as default client class
tinvaan Feb 19, 2024
a0220a6
add is_async flag to client options
tinvaan Feb 19, 2024
e27b8d4
fix NameError
tinvaan Feb 19, 2024
2227878
attempt to collapse AsyncClient into SupabaseClient
tinvaan Feb 20, 2024
1763de9
Lint formatting fixes
tinvaan Feb 20, 2024
ca73a33
run async routines inline via asyncio.run()
tinvaan Feb 20, 2024
ddf6239
drop legacy client modules
tinvaan Feb 20, 2024
a4304b4
fix tests
tinvaan Feb 20, 2024
6244295
remove redundant client.py
tinvaan Feb 20, 2024
37ffc32
Update pyproject & poetry lockfile
tinvaan Feb 20, 2024
5d6ffa6
multiline authors field in pyproject.toml
tinvaan Feb 20, 2024
11256cc
WIP: Add more tests
tinvaan Feb 20, 2024
5448f4d
Move test function configuration class to unittest style
tinvaan Feb 27, 2024
7eeb439
Begin porting default client tests to unittest
tinvaan Feb 27, 2024
666e186
Lint & formatting fixes
tinvaan Feb 27, 2024
8843d52
WIP: More client test cases
tinvaan Feb 28, 2024
56654bf
testrunner debug option
tinvaan Mar 4, 2024
4b5e3f0
Sync client tests
tinvaan Mar 4, 2024
9b1bccf
minor refactor
tinvaan Mar 4, 2024
ca169cf
define a base test client class
tinvaan Mar 4, 2024
1f6a3f7
async tests
tinvaan Mar 4, 2024
264c50c
more test cases
tinvaan Mar 4, 2024
ccb74af
black formatter
tinvaan Mar 4, 2024
efe8b6c
Fix client test setup states
tinvaan Mar 5, 2024
f0cd116
black config: line-length = 120
tinvaan Mar 5, 2024
236b877
provide wrapper classes for services and fix imports/references
tinvaan Mar 8, 2024
c715b6d
avoid asyncio.run() usage
tinvaan Mar 8, 2024
554b90b
Update/fix tests
tinvaan Mar 8, 2024
a7f75d2
update docstring
tinvaan Mar 8, 2024
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
31 changes: 18 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,36 @@ on:

jobs:
test:
name: Test / OS ${{ matrix.os }} / Python ${{ matrix.python-version }}
name: Tests
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- name: Clone Repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Poetry
uses: abatilo/actions-poetry@v3
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.3.2
- run: |
pip install tox>=4
pip install tox-gh>=1.2
tox -re ${{ matrix.python-version }}
- uses: codecov/codecov-action@v4

- name: Run Tests
run: poetry run tests
lint:
name: Code formatting
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
pip install tox>=4
tox -re format

- name: Upload Coverage
uses: codecov/codecov-action@v4
publish:
needs: test
if: ${{ !startsWith(github.event.head_commit.message, 'bump') && !startsWith(github.event.head_commit.message, 'chore') && github.ref == 'refs/heads/main' && github.event_name == 'push' && github.repository_owner == 'supabase-community' }}
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ Co-authored-by: dependabot\[bot\] \<49699333+dependabot\[bot\]@users.noreply.git

- chore(deps-dev): bump jinja2 from 3.1.2 to 3.1.3 (#661)

Signed-off-by: dependabot\[bot\] \<support@github.com>
Signed-off-by: dependabot\[bot\] \<<support@github.com>>
Co-authored-by: dependabot\[bot\] \<49699333+dependabot\[bot\]@users.noreply.github.com> ([`dcbd7b4`](https://github.com/supabase-community/supabase-py/commit/dcbd7b47700b3b0d0e13f518e4542d5a2adc7ac9))

- chore(deps): bump postgrest from 0.13.1 to 0.13.2 (#662)

Signed-off-by: dependabot\[bot\] \<support@github.com>
Signed-off-by: dependabot\[bot\] \<<support@github.com>>
Co-authored-by: dependabot\[bot\] \<49699333+dependabot\[bot\]@users.noreply.github.com> ([`82c4305`](https://github.com/supabase-community/supabase-py/commit/82c4305dcb572a372ecdadd653056d530f308f28))

### Fix
Expand All @@ -109,7 +109,7 @@ Co-authored-by: dependabot\[bot\] \<49699333+dependabot\[bot\]@users.noreply.git

- chore(deps-dev): bump gitpython from 3.1.40 to 3.1.41 (#659)

Signed-off-by: dependabot\[bot\] \<support@github.com>
Signed-off-by: dependabot\[bot\] \<<support@github.com>>
Co-authored-by: dependabot\[bot\] \<49699333+dependabot\[bot\]@users.noreply.github.com> ([`b3fd488`](https://github.com/supabase-community/supabase-py/commit/b3fd4887e11813118a465fe57c6c28830c31466f))

### Fix
Expand Down
19 changes: 0 additions & 19 deletions Makefile

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ Currently the test suites are in a state of flux. We are expanding our clients t
The above test database is a blank supabase instance that has populated the `countries` table with the built in countries script that can be found in the supabase UI. You can launch the test scripts and point to the above test database by running

```bash
./test.sh
# Example: Run tests against python3.9 environment
$ tox -e py39
```

## Badges
Expand Down
Loading
Loading