forked from cdfarrow/flexlibs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.bat
56 lines (44 loc) · 1.23 KB
/
make.bat
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
@ECHO OFF
REM Simple build commands for flexlibs
REM Build with the default Python version
set PYTHON=py
REM Check that the argument is a valid command, and do it. /I ignores case.
FOR %%C IN ("Init"
"RunTests"
"Clean"
"Build"
"Publish") DO (
IF /I "%1"=="%%~C" GOTO :Do%1
)
:Usage
echo Usage:
echo make init - Install the libraries for building
echo make runtests - Run the unit tests
echo make clean - Clean out build files
echo make build - Build the project
echo make publish - Publish the project to PyPI
goto :End
:DoInit
%PYTHON% -m pip install -r requirements.txt
goto :End
:DoRunTests
%PYTHON% -m pytest
goto :End
:DoClean
rmdir /s /q ".\build"
rmdir /s /q ".\dist"
rmdir /s /q ".\flexlibs\docs"
goto :End
:DoBuild
@REM Build the Sphinx docs
sphinx-build docs/sphinx flexlibs/docs/flexlibsAPI
@REM Build the wheel
%PYTHON% -m build -w
@REM Check for package errors
%PYTHON% -m twine check .\dist\*
goto :End
:DoPublish
echo Publishing wheel to PyPI
%PYTHON% -m twine upload .\dist\flexlibs*
goto :End
:End