-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmex.bat
More file actions
67 lines (51 loc) · 1.49 KB
/
Copy pathmex.bat
File metadata and controls
67 lines (51 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
@echo off
set target=%1
if "%target%"=="install" goto install
if "%target%"=="lint" goto lint
if "%target%"=="unit" goto unit
if "%target%"=="test" goto test
if "%target%"=="fuzzing" goto fuzzing
if "%target%"=="docs" goto docs
echo invalid argument %target%
exit /b 1
:install
@REM install meta requirements system-wide
echo installing requirements
pip --disable-pip-version-check install --force-reinstall -r requirements.txt
if %errorlevel% neq 0 exit /b %errorlevel%
@REM install pre-commit hooks when not in CI
if "%CI%"=="" (
pre-commit install
if %errorlevel% neq 0 exit /b %errorlevel%
)
@REM install packages from lock file in local virtual environment
echo installing package
uv sync
exit /b %errorlevel%
:lint
@REM run the linter hooks from pre-commit on all files
echo linting all files
pre-commit run --all-files
exit /b %errorlevel%
:unit
@REM run the test suite with all unit tests
echo running unit tests
uv run pytest -m "not integration"
exit /b %errorlevel%
:test
@REM run the unit and integration test suites
echo running all tests
uv run pytest --numprocesses=auto --dist=worksteal
exit /b %errorlevel%
:test
@REM run the fuzzing test suite
echo running fuzzing tests
uv sync --group fuzzing
uv run pytest -m fuzzing --numprocesses=auto --dist=worksteal --no-cov
exit /b %errorlevel%
:docs
@REM use sphinx to auto-generate html docs from code
echo generating docs
uv run sphinx-apidoc -f -o docs/source mex
uv run sphinx-build -aE -b dirhtml docs docs/dist
exit /b %errorlevel%