Skip to content

Commit c064ea6

Browse files
committed
feat: use uv instead of poetry
1 parent 12c5fc9 commit c064ea6

File tree

5 files changed

+572
-54
lines changed

5 files changed

+572
-54
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,14 @@ jobs:
2828
- name: Clone Repository
2929
uses: actions/checkout@v4
3030

31-
- name: Set up Python ${{ matrix.python-version }}
32-
uses: actions/setup-python@v5
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v6
3333
with:
34+
version: "0.8.2"
3435
python-version: ${{ matrix.python-version }}
3536

36-
- name: Set up Poetry
37-
run: pipx install poetry==1.8.5 --python python${{ matrix.python-version }}
38-
3937
- name: Run Tests
40-
run: poetry run tests
38+
run: uv run pytest --cov=./ --cov-report=xml --cov-report=html -vv
4139

4240
- name: Upload coverage to Coveralls
4341
uses: coverallsapp/github-action@v2
@@ -85,25 +83,20 @@ jobs:
8583
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
8684
contents: write # needed for github actions bot to write to repo
8785
steps:
88-
- name: Set up Python 3.11
89-
uses: actions/setup-python@v5
90-
with:
91-
python-version: 3.11
92-
9386
- name: Clone Repository
9487
uses: actions/checkout@v4
9588
with:
9689
ref: ${{ github.ref }}
9790
fetch-depth: 0
9891

99-
- name: Set up Poetry
100-
run: pipx install poetry==1.8.5 --python python3.11
101-
102-
- name: Install dependencies
103-
run: poetry install
92+
- name: Install uv
93+
uses: astral-sh/setup-uv@v6
94+
with:
95+
version: "0.8.2"
96+
python-version: "3.11"
10497

10598
- name: Build package dist directory
106-
run: poetry build
99+
run: uv build
107100

108101
- name: Publish package distributions to PyPI
109102
uses: pypa/gh-action-pypi-publish@release/v1

poetry_scripts.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

pyproject.toml

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
[tool.poetry]
1+
[project]
22
name = "supabase"
33
version = "2.17.0" # {x-release-please-version}
44
description = "Supabase client for Python."
5-
authors = ["Joel Lee <[email protected]>", "Leon Fedden <[email protected]>", "Daniel Reinón García <[email protected]>", "Leynier Gutiérrez González <[email protected]>", "Anand", "Andrew Smith <[email protected]>"]
5+
authors = [
6+
{ name = "Joel Lee", email = "[email protected]" },
7+
{ name = "Leon Fedden", email = "[email protected]" },
8+
{ name = "Daniel Reinón García", email = "[email protected]" },
9+
{ name = "Leynier Gutiérrez González", email = "[email protected]" },
10+
{ name = "Anand" },
11+
{ name = "Andrew Smith", email = "[email protected]" },
12+
]
613
homepage = "https://github.com/supabase/supabase-py"
714
repository = "https://github.com/supabase/supabase-py"
815
documentation = "https://github.com/supabase/supabase-py"
@@ -13,28 +20,33 @@ classifiers = [
1320
"License :: OSI Approved :: MIT License",
1421
"Operating System :: OS Independent"
1522
]
23+
requires-python = ">=3.9"
24+
dependencies = [
25+
"postgrest >= 1.1.1",
26+
"realtime >= 2.6.0",
27+
"gotrue >= 2.12.3",
28+
"storage3 >= 0.12.0",
29+
"supafunc >= 0.10.1",
30+
"httpx >=0.26,<0.29",
31+
]
1632

17-
[tool.poetry.dependencies]
18-
python = "^3.9"
19-
postgrest = "1.1.1"
20-
realtime = "2.6.0"
21-
gotrue = "2.12.3"
22-
storage3 = "0.12.0"
23-
supafunc = "0.10.1"
24-
httpx = ">=0.26,<0.29"
33+
[project.dependency-groups]
34+
dev = [
35+
"pre-commit >= 4.1.0",
36+
"pytest >= 8.4.1",
37+
"pytest-cov >= 6.2.1",
38+
"commitizen >=4.8.3",
39+
"python-dotenv >= 1.1.1",
40+
"unasync-cli",
41+
"pytest-asyncio >=0.24,<1.1",
42+
"ruff >=0.12.1",
43+
]
2544

26-
[tool.poetry.group.dev.dependencies]
27-
pre-commit = "^4.1.0"
28-
pytest = "^8.4.1"
29-
pytest-cov = "^6.2.1"
30-
commitizen = "^4.8.3"
31-
python-dotenv = "^1.1.1"
32-
unasync-cli = { git = "https://github.com/supabase-community/unasync-cli.git", branch = "main" }
33-
pytest-asyncio = ">=0.24,<1.1"
34-
ruff = "^0.12.1"
45+
[project.scripts]
46+
tests = 'test_scripts:run_tests'
3547

36-
[tool.poetry.scripts]
37-
tests = 'poetry_scripts:run_tests'
48+
[tool.uv.sources]
49+
unasync-cli = { git = "https://github.com/supabase-community/unasync-cli.git", branch = "main" }
3850

3951
[tool.pytest.ini_options]
4052
asyncio_mode = "auto"

test_scripts.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from subprocess import Popen
2+
3+
4+
def run_cmd(cmd: str) -> Popen:
5+
return Popen(cmd.split())
6+
7+
def run_tests():
8+
# Install requirements
9+
with run_cmd('uv run pre-commit run --all-files') as precommit, \
10+
run_cmd('uv run pytest --cov=./ --cov-report=xml --cov-report=html -vv') as pytests:
11+
pass
12+
return precommit.returncode and pytests.returncode

0 commit comments

Comments
 (0)