Skip to content

Commit

Permalink
Merge pull request #4 from supabase-community/fix-py3.7
Browse files Browse the repository at this point in the history
feat: python 3.7 compatibility and tests
  • Loading branch information
dreinon authored Apr 30, 2022
2 parents 75c9c43 + aa6adaf commit 5a8a1b4
Show file tree
Hide file tree
Showing 24 changed files with 698 additions and 257 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
per-file-ignores = __init__.py: F401, utils.py: F401
56 changes: 32 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,29 @@ jobs:
test:
name: Test / OS ${{ matrix.os }} / Python ${{ matrix.python-version }}
strategy:
max-parallel: 1
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: [3.7, 3.8, 3.9, "3.10"]
runs-on: ${{ matrix.os }}
steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.11
- name: Run Tests
run: make run_tests
- name: Upload Coverage
uses: codecov/codecov-action@v1
- name: Clone Repository
uses: actions/checkout@v2

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

- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.2.0b1

- name: Run Tests
run: make run_tests

- name: Upload Coverage
uses: codecov/codecov-action@v1

publish:
needs: test
Expand All @@ -37,31 +40,36 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
changelog_increment_filename: body.md

- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: body.md
tag_name: ${{ env.REVISION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.11
# - name: Publish
# env:
# PYPI_USERNAME: __token__
# PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# run: |
# poetry install
# poetry publish --build -u $PYPI_USERNAME -p $PYPI_PASSWORD
poetry-version: 1.2.0b1

- name: Publish
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
poetry install
poetry publish --build -u $PYPI_USERNAME -p $PYPI_PASSWORD
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tests_pre_commit:
run_tests: tests

tests_only:
export SUPABASE_TEST_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYzNTAwODQ4NywiZXhwIjoxOTUwNTg0NDg3fQ.l8IgkO7TQokGSc9OJoobXIVXsOXkilXl4Ak6SCX5qI8" &&\
export SUPABASE_TEST_URL="https://ibrydvrsxoapzgtnhpso.supabase.co" &&\
poetry run pytest --cov=./ --cov-report=xml --cov-report=html -vv

build_sync:
poetry run unasync storage3 tests
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ url = "https://<your_supabase_id>.supabase.co/storage/v1"
key = "<your api key>"

# pass in is_async=True to create an async client
storage_client = create_client(url, {'apiKey': key, 'Authorization': 'Bearer <an_auth_token>'}, is_async=False)
storage_client = create_client(url, key, is_async=False)

storage_client.list_buckets()
```
Loading

0 comments on commit 5a8a1b4

Please sign in to comment.