-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathmake.bat
More file actions
70 lines (54 loc) · 1.49 KB
/
Copy pathmake.bat
File metadata and controls
70 lines (54 loc) · 1.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
@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"=="check" goto check
if "%1"=="test" goto test
if "%1"=="doc" goto doc
if "%1"=="publish" goto publish
echo Usage: make.bat [install^|format^|fix^|ruff-check^|mypy-check^|check^|test^|doc^|publish]
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
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%
:check
call :ruff-check
if errorlevel 1 exit /b %errorlevel%
call :mypy-check
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
if exist dist\ rmdir /s /q dist\
uv build
if errorlevel 1 exit /b %errorlevel%
uvx twine check .\dist\*
if errorlevel 1 exit /b %errorlevel%
uv publish
exit /b %errorlevel%