File tree Expand file tree Collapse file tree 3 files changed +804
-13
lines changed Expand file tree Collapse file tree 3 files changed +804
-13
lines changed Original file line number Diff line number Diff line change 1
1
from subprocess import Popen
2
2
3
3
4
- def run_cmd (cmd : str ) -> Popen :
4
+ def spawn (cmd : str ) -> Popen :
5
5
return Popen (cmd .split ())
6
6
7
7
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
+
8
16
def run_tests ():
9
17
# 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
17
20
return precommit .returncode and pytests .returncode
Original file line number Diff line number Diff line change @@ -30,20 +30,33 @@ dependencies = [
30
30
" httpx >=0.26,<0.29" ,
31
31
]
32
32
33
- [project .dependency-groups ]
33
+ [project .scripts ]
34
+ tests = ' cli_scripts:run_tests'
35
+
36
+ [dependency-groups ]
34
37
dev = [
38
+ { include-group = " pre-commit" },
39
+ { include-group = " tests" },
40
+ { include-group = " lints" },
41
+ ]
42
+ pre-commit = [
35
43
" pre-commit >= 4.1.0" ,
44
+ " commitizen >=4.8.3" ,
45
+ ]
46
+ tests = [
36
47
" pytest >= 8.4.1" ,
37
48
" pytest-cov >= 6.2.1" ,
38
- " commitizen >=4.8.3 " ,
49
+ " pytest-asyncio >=0.24,<1.1 " ,
39
50
" python-dotenv >= 1.1.1" ,
51
+ ]
52
+ lints = [
40
53
" unasync-cli" ,
41
- " pytest-asyncio >=0.24,<1.1" ,
42
54
" ruff >=0.12.1" ,
43
55
]
44
56
45
- [project .scripts ]
46
- tests = ' cli_scripts:run_tests'
57
+ [tool .uv ]
58
+ default-groups = [ " dev" ]
59
+
47
60
48
61
[tool .uv .sources ]
49
62
unasync-cli = { git = " https://github.com/supabase-community/unasync-cli.git" , branch = " main" }
You can’t perform that action at this time.
0 commit comments