@@ -37,10 +37,10 @@ Changelog = "https://github.com/apathetic-tools/python-utils/releases"
3737# --- Development tasks ---
3838[tool .poe .tasks ]
3939# 🧩 All-in-one
40- "check:fix" = [" pre-commit:install" , " fix" , " typecheck" , " test" ]
40+ "check:fix" = [" pre-commit:install" , " fix" , " typecheck" , " test:parallel " ]
4141
4242# 🔍 Linting and static checks
43- check = [" lint" , " typecheck" , " test" ]
43+ check = [" lint" , " typecheck" , " test:parallel " ]
4444lint = [" lint:ruff" ]
4545"lint:ruff" = " ruff check ."
4646
@@ -53,14 +53,48 @@ typecheck = ["typecheck:mypy", "typecheck:pyright"]
5353# 🧪 Tests (runs all three: installed + singlefile + zipapp)
5454test = [" test:pytest:installed" , " test:pytest:script" , " test:pytest:zipapp" ]
5555"test:pytest:installed" = " pytest"
56+ "test:pytest:installed:parallel" = " pytest -n auto"
5657"test:pytest:script" = [
5758 " build:script" ,
5859 { cmd = " pytest" , env = { RUNTIME_MODE =" singlefile" } }
5960]
61+ "test:pytest:script:parallel" = [
62+ " build:script" ,
63+ { cmd = " pytest -n auto" , env = { RUNTIME_MODE =" singlefile" } }
64+ ]
6065"test:pytest:zipapp" = [
6166 " build:zipapp" ,
6267 { cmd = " pytest" , env = { RUNTIME_MODE =" zipapp" } }
6368]
69+ "test:pytest:zipapp:parallel" = [
70+ " build:zipapp" ,
71+ { cmd = " pytest -n auto" , env = { RUNTIME_MODE =" zipapp" } }
72+ ]
73+
74+ # 🚀 Fast test runs (for development)
75+ # Fast: installed mode only, parallel, skip slow tests
76+ "test:fast" = " pytest -n auto -m 'not slow'"
77+ # Fast: all three modes, parallel, skip slow tests
78+ "test:fast:installed" = " pytest -n auto -m 'not slow'"
79+ "test:fast:script" = [
80+ " build:script" ,
81+ { cmd = " pytest -n auto -m 'not slow'" , env = { RUNTIME_MODE =" singlefile" } }
82+ ]
83+ "test:fast:zipapp" = [
84+ " build:zipapp" ,
85+ { cmd = " pytest -n auto -m 'not slow'" , env = { RUNTIME_MODE =" zipapp" } }
86+ ]
87+ "test:fast:all" = [
88+ " test:fast:installed" ,
89+ " test:fast:script" ,
90+ " test:fast:zipapp"
91+ ]
92+ # Parallel: all three modes with parallel execution
93+ "test:parallel" = [
94+ " test:pytest:installed:parallel" ,
95+ " test:pytest:script:parallel" ,
96+ " test:pytest:zipapp:parallel"
97+ ]
6498
6599# 📊 Coverage reporting
66100"coverage:clean" = { shell = " rm -f .coverage .coverage.*" }
@@ -116,17 +150,17 @@ fix = ["sync:ai:guidance", "fix:ruff:installed", "fix:format:installed"]
116150"env:py3x" = " bash dev/env_use_py3x.sh"
117151"test:py310" = [
118152 " env:py310" ,
119- " test" ,
153+ " test:parallel " ,
120154 " env:py3x"
121155]
122156"test:py311" = [
123157 " env:py311" ,
124- " test" ,
158+ " test:parallel " ,
125159 " env:py3x"
126160]
127161"test:py312" = [
128162 " env:py312" ,
129- " test" ,
163+ " test:parallel " ,
130164 " env:py3x"
131165]
132166
@@ -154,6 +188,7 @@ dev = [
154188 " pytest-timeout (>=2.4.0,<3.0.0)" ,
155189 " pytest-benchmark (>=5.1.0,<6.0.0)" ,
156190 " pytest-cov (>=7.0.0,<8.0.0)" ,
191+ " pytest-xdist" ,
157192 " pyright (>=1.1.407,<2.0.0)" ,
158193 " shiv (>=1.0.0,<2.0.0)" ,
159194 " python-semantic-release (>=10.0.0,<11.0.0)" ,
0 commit comments