-
-
Notifications
You must be signed in to change notification settings - Fork 323
chore: use uv instead of poetry #1186
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
+1,418
−90
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c064ea6
feat: use uv instead of poetry
o-santi b755bca
fix: accept ruff formatting
o-santi 76d7cfc
fix: change CI to use test scripts
o-santi 169f522
fix: switch build-backend to uv_build
o-santi e71ae6c
fix: rename scripts to `cli_scripts.py`
o-santi 458bb7f
fix: split `dev`, include dev as default dependency-group
o-santi 6703649
chore: add uv section to README
o-santi 50e6fb1
chore: remove Makefile in favor of `cli_scripts.py`
o-santi 4d4a5b2
fix: remove comment
o-santi a458b02
fix: run uv format
o-santi 275608a
fix: pin our dependencies
o-santi 8b95073
fix: move urls to `project.urls`, remove deprecated license classifiers
o-santi d59abd2
fix: bump unasync-cli to version using `uv`
o-santi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import subprocess | ||
|
||
|
||
def uvx(*cmds: str): | ||
return subprocess.run(["uv", "run", *cmds], check=True) | ||
|
||
|
||
def precommit(): | ||
return uvx("pre-commit", "run", "--all-files") | ||
|
||
|
||
def pytest(): | ||
return uvx("pytest", "--cov=./", "--cov-report=xml", "--cov-report=html", "-vv") | ||
|
||
|
||
def unasync(): | ||
return uvx("unasync", "supabase", "tests") | ||
|
||
|
||
def sed(before: str, after: str): | ||
return subprocess.run(["sed", "-i", "", before, after], check=True) | ||
|
||
|
||
def build_sync(): | ||
substs = [ | ||
( | ||
"s/asyncio.create_task(self.realtime.set_auth(access_token))//g", | ||
"supabase/_sync/client.py", | ||
), | ||
("s/asynch/synch/g", "supabase/_sync/auth_client.py"), | ||
("s/Async/Sync/g", "supabase/_sync/auth_client.py"), | ||
("s/Async/Sync/g", "supabase/_sync/client.py"), | ||
("s/create_async_client/create_client/g", "tests/_sync/test_client.py"), | ||
("s/SyncClient/Client/gi", "tests/_sync/test_client.py"), | ||
("s/SyncHTTPTransport/HTTPTransport/g", "tests/_sync/test_client.py"), | ||
("s/SyncMock/Mock/g", "tests/_sync/test_client.py"), | ||
] | ||
unasync() | ||
for left, right in substs: | ||
sed(left, right) | ||
|
||
|
||
def run_tests(): | ||
precommit() | ||
pytest() |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,76 @@ | ||
[tool.poetry] | ||
[project] | ||
name = "supabase" | ||
version = "2.17.0" # {x-release-please-version} | ||
description = "Supabase client for Python." | ||
authors = ["Joel Lee <joel@joellee.org>", "Leon Fedden <leonfedden@gmail.com>", "Daniel Reinón García <danielreinon@outlook.com>", "Leynier Gutiérrez González <leynier41@gmail.com>", "Anand", "Andrew Smith <a.smith@silentworks.co.uk>"] | ||
homepage = "https://github.com/supabase/supabase-py" | ||
repository = "https://github.com/supabase/supabase-py" | ||
documentation = "https://github.com/supabase/supabase-py" | ||
authors = [ | ||
{ name = "Joel Lee", email = "joel@joellee.org" }, | ||
{ name = "Leon Fedden", email = "leonfedden@gmail.com" }, | ||
{ name = "Daniel Reinón García", email = "danielreinon@outlook.com" }, | ||
{ name = "Leynier Gutiérrez González", email = "leynier41@gmail.com" }, | ||
{ name = "Anand" }, | ||
{ name = "Andrew Smith", email = "a.smith@silentworks.co.uk" }, | ||
] | ||
readme = "README.md" | ||
license = "MIT" | ||
license-files = [ "LICENSE" ] | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent" | ||
] | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"postgrest == 1.1.1", | ||
"realtime == 2.6.0", | ||
"gotrue == 2.12.3", | ||
"storage3 == 0.12.0", | ||
"supafunc == 0.10.1", | ||
"httpx >=0.26,<0.29", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
postgrest = "1.1.1" | ||
realtime = "2.6.0" | ||
gotrue = "2.12.3" | ||
storage3 = "0.12.0" | ||
supafunc = "0.10.1" | ||
httpx = ">=0.26,<0.29" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pre-commit = "^4.1.0" | ||
pytest = "^8.4.1" | ||
pytest-cov = "^6.2.1" | ||
commitizen = "^4.8.3" | ||
python-dotenv = "^1.1.1" | ||
[project.urls] | ||
homepage = "https://github.com/supabase/supabase-py" | ||
repository = "https://github.com/supabase/supabase-py" | ||
documentation = "https://github.com/supabase/supabase-py" | ||
|
||
[project.scripts] | ||
tests = "cli_scripts:run_tests" | ||
build_sync = "cli_scripts:build_sync" | ||
|
||
[dependency-groups] | ||
dev = [ | ||
{ include-group = "pre-commit" }, | ||
{ include-group = "tests" }, | ||
{ include-group = "lints" }, | ||
] | ||
pre-commit = [ | ||
"pre-commit >= 4.1.0", | ||
"commitizen >=4.8.3", | ||
] | ||
tests = [ | ||
"pytest >= 8.4.1", | ||
"pytest-cov >= 6.2.1", | ||
"pytest-asyncio >=0.24,<1.1", | ||
"python-dotenv >= 1.1.1", | ||
] | ||
lints = [ | ||
"unasync-cli", | ||
"ruff >=0.12.1", | ||
] | ||
|
||
[tool.uv] | ||
default-groups = [ "dev" ] | ||
|
||
|
||
[tool.uv.sources] | ||
unasync-cli = { git = "https://github.com/supabase-community/unasync-cli.git", branch = "main" } | ||
pytest-asyncio = ">=0.24,<1.1" | ||
ruff = "^0.12.1" | ||
|
||
[tool.poetry.scripts] | ||
tests = 'poetry_scripts:run_tests' | ||
[build-system] | ||
requires = ["uv_build>=0.8.3,<0.9.0"] | ||
build-backend = "uv_build" | ||
|
||
[tool.uv.build-backend] | ||
module-name = "supabase" | ||
module-root = "" | ||
|
||
[tool.pytest.ini_options] | ||
asyncio_mode = "auto" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.