-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
44 lines (29 loc) · 980 Bytes
/
build.bat
File metadata and controls
44 lines (29 loc) · 980 Bytes
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
@echo off
setlocal
SET PROJECT_NAME=partomatic
SET /P PYTEST_CHOSEN=Do you want to run pytest --cov ([Y]/N)?
IF /I "%PYTEST_CHOSEN%" NEQ "N" GOTO TEST
GOTO BUILD
:TEST
pytest --cov
SET /P PYTEST_CLEAN=Based on the pytest results, proceed with the build? ([Y]/N)?
IF /I "%PYTEST_CLEAN%" NEQ "N" GOTO BUILD
GOTO END
:BUILD
py -m pip uninstall -y %PROJECT_NAME%
del /F /Q dist\*.*
py -m build
py -m pip install -e .
:TESTLOCAL
python -c "exec(\"from partomatic import Partomatic, PartomaticConfig, AutomatablePart\nprint(PartomaticConfig().stl_folder)\")"
SET /P PYPI_UPLOAD=Based on that simple test, upload to pypi? ([Y]/N)?
IF /I "%PYPI_UPLOAD%" NEQ "N" GOTO UPLOAD
GOTO END
:UPLOAD
py -m twine upload dist/*
py -m pip uninstall -y partomatic
py -m pip install partomatic
python -c "exec(\"from partomatic import Partomatic, PartomaticConfig, AutomatablePart\nprint(PartomaticConfig().stl_folder)\")"
ECHO "REMINDER!!! Commit and push git changes!!!"
:END
endlocal