-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathmake.bat
More file actions
115 lines (95 loc) · 2.5 KB
/
make.bat
File metadata and controls
115 lines (95 loc) · 2.5 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
105
106
107
108
109
110
111
112
113
114
115
@ECHO OFF
FOR /F "tokens=* USEBACKQ" %%F IN (`python get_version.py`) do (
SET VERSION=%%F
)
FOR /F "tokens=* USEBACKQ" %%F IN (`pyenv version`) do (
SET PYTHON_VERSION=%%F
)
SET CMD=%1
echo.Hello, version=%VERSION%, cmd=%CMD%, python version=%PYTHON_VERSION%
if "%CMD%" == "" goto :HELP
if "%CMD%" == "help" goto :HELP
if "%CMD%" == "init" goto :INIT
if "%CMD%" == "clean" goto :CLEAN
if "%CMD%" == "pipenv_remove" goto :PIPENV_REMOVE
if "%CMD%" == "pipenv_install" goto :PIPENV_INSTALL
if "%CMD%" == "pip_install_dev" goto :PIP_INSTALL_DEV
if "%CMD%" == "pip_install" goto :PIP_INSTALL
if "%CMD%" == "test" goto :TEST
:FILES_CLEAN_CMD
echo.Removing files
rmdir /s /q artifacts
echo.Removed files
goto :END
:PIPENV_REMOVE_CMD
echo.Removing Virtual environment
call pipenv --rm
echo.Virtual environment removed
goto :END
:PIPENV_INSTALL_CMD
echo.Installing Virtual environment
call pipenv install --dev --skip-lock
echo.Virtual environment installed
goto :END
:PIP_INSTALL_CMD
echo.Installing requirements
call python -m pip install --upgrade --requirement requirements.txt
echo.Requirements installed
goto :END
:PIP_INSTALL_DEV_CMD
echo.Installing developement requirements
call python -m pip install --upgrade --requirement requirements-pkg.txt
call python -m pip install --upgrade --requirement requirements-dev.txt
call python -m pip install --upgrade --requirement requirements-build.txt
call python -m pip install --upgrade --requirement requirements-lint.txt
echo.Developement requirements installed
goto :END
:TEST_CMD
echo.Starting tests
call pytest
echo.Tests finished
goto :END
:CLEAN_CMD
echo.Cleaning...
call :PIPENV_REMOVE_CMD
call :FILES_CLEAN_CMD
echo.Cleaning done
goto :END
:INIT
echo.Initializing...
call :PIP_INSTALL_CMD
call :PIP_INSTALL_DEV_CMD
call :PIPENV_INSTALL_CMD
echo.Initialized
goto :BYE
:HELP
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. init to get things going
echo. test run the test suite
echo. clean clean everything up
goto :BYE
:CLEAN
call :CLEAN_CMD
goto :BYE
:FILES_CLEAN
call :FILES_CLEAN_CMD
goto :BYE
:PIPENV_REMOVE
call :PIPENV_REMOVE_CMD
goto :BYE
:PIPENV_INSTALL
call :PIPENV_INSTALL_CMD
goto :BYE
:PIP_INSTALL
call :PIP_INSTALL_CMD
goto :BYE
:PIP_INSTALL_DEV
call :PIP_INSTALL_DEV_CMD
goto :BYE
:TEST
call :TEST_CMD
goto :BYE
:BYE
echo.Goodbye, version=%VERSION%, cmd=%CMD%, python version=%PYTHON_VERSION%
goto :END
:END