Skip to content

chore: fix ci cd, update precommit rules and add badges to readme #120

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

Merged
Show file tree
Hide file tree
Changes from all commits
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
35 changes: 7 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,26 @@ jobs:
- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.11
poetry-version: 1.1.12
- name: Run Tests
run: make run_tests
- name: Upload Coverage
uses: codecov/codecov-action@v1

publish:
needs: test
if: ${{ !startsWith(github.event.head_commit.message, 'bump:') && github.ref == 'refs/heads/develop' && github.event_name == 'push' }}
if: ${{ !startsWith(github.event.head_commit.message, 'bump:') && !startsWith(github.event.head_commit.message, 'chore') && github.ref == 'refs/heads/develop' && github.event_name == 'push' && github.repository_owner == 'supabase-community' }}
runs-on: ubuntu-latest
name: "Bump version, create changelog and publish"
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
- name: Python Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: develop
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
repository_username: __token__
repository_password: ${{ secrets.PYPI_TOKEN }}
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand Down Expand Up @@ -35,18 +35,18 @@ repos:
]

- repo: https://github.com/ambv/black
rev: 21.11b1
rev: 21.12b0
hooks:
- id: black

- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
rev: v2.31.0
hooks:
- id: pyupgrade
args: ["--py37-plus", "--keep-runtime-typing"]

- repo: https://github.com/commitizen-tools/commitizen
rev: v2.20.0
rev: v2.20.3
hooks:
- id: commitizen
stages: [commit-msg]
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# supabase-py

[![CI/CD](https://github.com/supabase-community/supabase-py/actions/workflows/ci.yml/badge.svg)](https://github.com/supabase-community/supabase-py/actions/workflows/ci.yml)
[![PyPI version](https://badge.fury.io/py/supabase.svg)](https://badge.fury.io/py/supabase)
[![Documentation Status](https://readthedocs.org/projects/supabase/badge/?version=latest)](https://supabase.readthedocs.io/en/latest/?badge=latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?label=license)](https://opensource.org/licenses/MIT)
[![CI](https://github.com/supabase-community/supabase-py/actions/workflows/ci.yml/badge.svg)](https://github.com/supabase-community/supabase-py/actions/workflows/ci.yml)
[![Python](https://img.shields.io/pypi/pyversions/supabase)](https://pypi.org/project/supabase)
[![Version](https://img.shields.io/pypi/v/supabase?color=%2334D058)](https://pypi.org/project/supabase)
[![Codecov](https://codecov.io/gh/supabase-community/supabase-py/branch/develop/graph/badge.svg)](https://codecov.io/gh/supabase-community/supabase-py)
[![Last commit](https://img.shields.io/github/last-commit/supabase-community/supabase-py.svg?style=flat)](https://github.com/supabase-community/supabase-py/commits)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/supabase-community/supabase-py)](https://github.com/supabase-community/supabase-py/commits)
[![Github Stars](https://img.shields.io/github/stars/supabase-community/supabase-py?style=flat&logo=github)](https://github.com/supabase-community/supabase-py/stargazers)
[![Github Forks](https://img.shields.io/github/forks/supabase-community/supabase-py?style=flat&logo=github)](https://github.com/supabase-community/supabase-py/network/members)
[![Github Watchers](https://img.shields.io/github/watchers/supabase-community/supabase-py?style=flat&logo=github)](https://github.com/supabase-community/supabase-py)
[![GitHub contributors](https://img.shields.io/github/contributors/supabase-community/supabase-py)](https://github.com/supabase-community/supabase-py/graphs/contributors)

Supabase client for Python. This mirrors the design of [supabase-js](https://github.com/supabase/supabase-js/blob/master/README.md)

Expand All @@ -21,15 +29,15 @@ We are currently in Public Alpha. Watch "releases" of this repo to get notified

**Recomended:** First activate your virtual environment, with your favourites system. For example, we like `poetry` and `conda`!

#### PyPi installation
### PyPi installation

Now install the package. (for > Python 3.7)

```bash
pip install supabase
```

#### Local installation
### Local installation

You can also installing from after cloning this repo. Install like below to install in Development Mode, which means when you edit the source code the changes will be reflected in your python module.

Expand Down Expand Up @@ -115,7 +123,7 @@ user = supabase.auth.sign_in(email=random_email, password=random_password)

## Managing Data

#### Insertion of Data
### Insertion of Data

```python
from supabase import create_client, Client
Expand All @@ -127,7 +135,7 @@ data = supabase.table("countries").insert({"name":"Germany"}).execute()
assert len(data.get("data", [])) > 0
```

#### Selection of Data
### Selection of Data

```python
from supabase import create_client, Client
Expand All @@ -140,7 +148,7 @@ data = supabase.table("countries").select("*").execute()
assert len(data.get("data", [])) > 0
```

#### Update of Data
### Update of Data

```python
from supabase import create_client, Client
Expand Down
Loading