Skip to content

Commit 55a0f06

Browse files
committed
rename package to supabase_auth
1 parent cacb4b6 commit 55a0f06

34 files changed

+544
-464
lines changed

.github/workflows/ci.yml

+50-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ jobs:
4343
needs: test
4444
if: ${{ !startsWith(github.event.head_commit.message, 'bump') && !startsWith(github.event.head_commit.message, 'chore') && github.ref == 'refs/heads/main' && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.repository_owner == 'supabase-community' }}
4545
runs-on: ubuntu-latest
46-
name: "Bump version, create changelog and publish"
46+
name: "supabase_auth: Bump version, create changelog and publish"
4747
environment:
4848
name: pypi
49-
url: https://pypi.org/p/gotrue
49+
url: https://pypi.org/p/supabase_auth
5050
permissions:
5151
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
5252
contents: write # needed for dependabot to write to repo
53+
outputs:
54+
is-released: ${{ steps.release.outputs.released }}
5355
steps:
5456
- name: Clone Repository
5557
uses: actions/checkout@v4
@@ -75,3 +77,49 @@ jobs:
7577
if: steps.release.outputs.released == 'true'
7678
with:
7779
github_token: ${{ secrets.GITHUB_TOKEN }}
80+
publish_legacy:
81+
needs: publish
82+
if: ${{ !startsWith(github.event.head_commit.message, 'bump') && !startsWith(github.event.head_commit.message, 'chore') && github.ref == 'refs/heads/main' && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.repository_owner == 'supabase-community' }}
83+
runs-on: ubuntu-latest
84+
name: "gotrue: Bump version and publish"
85+
environment:
86+
name: pypi
87+
url: https://pypi.org/p/gotrue
88+
permissions:
89+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
90+
contents: write # needed for github actions bot to write to repo
91+
steps:
92+
- name: Clone Repository
93+
uses: actions/checkout@v4
94+
with:
95+
ref: ${{ github.ref }}
96+
fetch-depth: 0
97+
token: ${{ secrets.SILENTWORKS_PAT }}
98+
99+
- name: Rename Project
100+
id: rename_project
101+
run: make rename_project
102+
103+
- name: Install poetry
104+
uses: abatilo/actions-poetry@v2
105+
- name: Setup a local virtual environment (if no poetry.toml file)
106+
run: |
107+
poetry config virtualenvs.create true --local
108+
poetry config virtualenvs.in-project true --local
109+
- uses: actions/cache@v3
110+
name: Define a cache for the virtual environment based on the dependencies lock file
111+
with:
112+
path: ./.venv
113+
key: venv-${{ hashFiles('poetry.lock') }}
114+
- name: Install the project dependencies
115+
run: poetry install
116+
117+
- name: Build package distribution directory
118+
id: build_dist
119+
run: make build_package
120+
121+
- name: Publish package distributions to PyPI
122+
uses: pypa/gh-action-pypi-publish@release/v1
123+
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
124+
# See https://github.com/actions/runner/issues/1173
125+
if: needs.publish.outputs.is-released == 'true'

Makefile

+12-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,21 @@ sync_infra:
2828
run_tests: run_infra sleep tests
2929

3030
build_sync:
31-
poetry run unasync gotrue tests
31+
poetry run unasync supabase_auth tests
3232

3333
build_run_tests: build_sync run_tests
3434
echo "Done"
3535

3636
sleep:
3737
sleep 20
38+
39+
rename_project: rename_package_dir rename_package
40+
41+
rename_package_dir:
42+
mv supabase_auth gotrue
43+
44+
rename_package:
45+
sed -i 's/supabase_auth/gotrue/g' pyproject.toml tests/_async/clients.py tests/_sync/clients.py tests/_async/test_gotrue_admin_api.py tests/_sync/test_gotrue_admin_api.py tests/_async/test_utils.py tests/_sync/test_utils.py tests/_async/utils.py tests/_sync/utils.py README.md
46+
47+
build_package:
48+
poetry build

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ This is a Python port of the [supabase js gotrue client](https://github.com/supa
1616

1717
## Installation
1818

19-
We are still working on making the `gotrue` python library more user-friendly. For now here are some sparse notes on how to install the module.
19+
We are still working on making the `supabase_auth` python library more user-friendly. For now here are some sparse notes on how to install the module.
2020

2121
### Poetry
2222

2323
```bash
24-
poetry add gotrue
24+
poetry add supabase_auth
2525
```
2626

2727
### Pip
2828

2929
```bash
30-
pip install gotrue
30+
pip install supabase_auth
3131
```
3232

3333
## Differences to the JS client
@@ -46,7 +46,7 @@ const { data, error } = client.sign_up(...)
4646

4747
The other key difference is we do not use pascalCase to encode variable and method names. Instead we use the snake_case convention adopted in the Python language.
4848

49-
Also, the `gotrue` library for Python parses the date-time string into `datetime` Python objects. The [JS client](https://github.com/supabase/gotrue-js) keeps the date-time as strings.
49+
Also, the `supabase_auth` library for Python parses the date-time string into `datetime` Python objects. The [JS client](https://github.com/supabase/gotrue-js) keeps the date-time as strings.
5050

5151
## Usage (outdated)
5252

@@ -55,7 +55,7 @@ Also, the `gotrue` library for Python parses the date-time string into `datetime
5555
To instantiate the client, you'll need the URL and any request headers at a minimum.
5656

5757
```python
58-
from gotrue import SyncGoTrueClient
58+
from supabase_auth import SyncGoTrueClient
5959

6060
headers = {
6161
"apiKey": "my-mega-awesome-api-key",

0 commit comments

Comments
 (0)