Skip to content

Commit 458bb7f

Browse files
committed
fix: split dev, include dev as default dependency-group
1 parent e71ae6c commit 458bb7f

File tree

3 files changed

+804
-13
lines changed

3 files changed

+804
-13
lines changed

cli_scripts.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
from subprocess import Popen
22

33

4-
def run_cmd(cmd: str) -> Popen:
4+
def spawn(cmd: str) -> Popen:
55
return Popen(cmd.split())
66

77

8+
def spawn_precommit() -> Popen:
9+
return spawn("uv run pre-commit run --all-files")
10+
11+
12+
def spawn_pytest() -> Popen:
13+
return spawn("uv run pytest --cov=./ --cov-report=xml --cov-report=html -vv")
14+
15+
816
def run_tests():
917
# Install requirements
10-
with (
11-
run_cmd("uv run pre-commit run --all-files") as precommit,
12-
run_cmd(
13-
"uv run pytest --cov=./ --cov-report=xml --cov-report=html -vv"
14-
) as pytests,
15-
):
16-
pass
18+
with spawn_precommit() as precommit, spawn_pytest() as pytests:
19+
pass # implicitly wait for all of them to return
1720
return precommit.returncode and pytests.returncode

pyproject.toml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,33 @@ dependencies = [
3030
"httpx >=0.26,<0.29",
3131
]
3232

33-
[project.dependency-groups]
33+
[project.scripts]
34+
tests = 'cli_scripts:run_tests'
35+
36+
[dependency-groups]
3437
dev = [
38+
{ include-group = "pre-commit" },
39+
{ include-group = "tests" },
40+
{ include-group = "lints" },
41+
]
42+
pre-commit = [
3543
"pre-commit >= 4.1.0",
44+
"commitizen >=4.8.3",
45+
]
46+
tests = [
3647
"pytest >= 8.4.1",
3748
"pytest-cov >= 6.2.1",
38-
"commitizen >=4.8.3",
49+
"pytest-asyncio >=0.24,<1.1",
3950
"python-dotenv >= 1.1.1",
51+
]
52+
lints = [
4053
"unasync-cli",
41-
"pytest-asyncio >=0.24,<1.1",
4254
"ruff >=0.12.1",
4355
]
4456

45-
[project.scripts]
46-
tests = 'cli_scripts:run_tests'
57+
[tool.uv]
58+
default-groups = [ "dev" ]
59+
4760

4861
[tool.uv.sources]
4962
unasync-cli = { git = "https://github.com/supabase-community/unasync-cli.git", branch = "main" }

0 commit comments

Comments
 (0)