-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathmake.bat
More file actions
104 lines (82 loc) Β· 2.49 KB
/
Copy pathmake.bat
File metadata and controls
104 lines (82 loc) Β· 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@echo off
where uv >nul 2>nul
if errorlevel 1 (
echo uv not found. Install uv to use make.bat targets:
echo powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
exit /b 1
)
if "%1"=="install" goto install
if "%1"=="format" goto format
if "%1"=="fix" goto fix
if "%1"=="ruff-check" goto ruff-check
if "%1"=="mypy-check" goto mypy-check
if "%1"=="zizmor-check" goto zizmor-check
if "%1"=="check" goto check
if "%1"=="benchmark-test" goto benchmark-test
if "%1"=="integration-test" goto integration-test
if "%1"=="property-test" goto property-test
if "%1"=="unit-test" goto unit-test
if "%1"=="test" goto test
if "%1"=="doc" goto doc
if "%1"=="publish" goto publish
if "%1"=="clean" goto clean
echo Usage: make.bat [install^|format^|fix^|ruff-check^|mypy-check^|zizmor-check^|check^|benchmark-test^|integration-test^|property-test^|unit-test^|test^|doc^|publish^|clean]
exit /b 1
:install
uv sync --all-groups --locked
exit /b %errorlevel%
:format
uv run --group quality --locked ruff format
exit /b %errorlevel%
:fix
uv run --group quality --locked ruff check --fix
if errorlevel 1 exit /b %errorlevel%
uv run --group quality --locked zizmor --collect=all --no-progress --fix --persona=auditor .
exit /b %errorlevel%
:ruff-check
uv run --group quality --locked ruff check
if errorlevel 1 exit /b %errorlevel%
uv run --group quality --locked ruff format --check
exit /b %errorlevel%
:mypy-check
uv run --group tests --group types --group quality --locked mypy
exit /b %errorlevel%
:zizmor-check
uv run --group quality --locked zizmor --collect=all --no-progress --persona=auditor .
exit /b %errorlevel%
:check
call :ruff-check
if errorlevel 1 exit /b %errorlevel%
call :mypy-check
if errorlevel 1 exit /b %errorlevel%
call :zizmor-check
exit /b %errorlevel%
:benchmark-test
uv run --group tests --locked pytest -m perf
exit /b %errorlevel%
:integration-test
uv run --group tests --locked pytest -m integration
exit /b %errorlevel%
:property-test
uv run --group tests --locked pytest -m property
exit /b %errorlevel%
:unit-test
uv run --group tests --locked pytest -m unit
exit /b %errorlevel%
:test
uv run --group tests --locked pytest
exit /b %errorlevel%
:doc
call uv run --group docs --locked sphinx-build -M html docs/source docs/build
exit /b %errorlevel%
:publish
call .\make.bat clean
uv build
if errorlevel 1 exit /b %errorlevel%
uvx twine check .\dist\*
if errorlevel 1 exit /b %errorlevel%
uv publish
exit /b %errorlevel%
:clean
git clean -xfd --exclude .venv
exit /b %errorlevel%