-
Notifications
You must be signed in to change notification settings - Fork 15
/
make.bat
121 lines (83 loc) · 2.35 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
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
116
117
118
119
120
121
@echo off
rem Build script for Windows
IF "%~1"=="" GOTO printdoc
IF "%~1"=="dist" GOTO makedist
IF "%~1"=="test" GOTO test
IF "%~1"=="testcov" GOTO test
IF "%~1"=="docs" GOTO makedoc
IF "%~1"=="spelling" GOTO spelling
IF "%~1"=="deploy_pypi" GOTO deploy_pypi
IF "%~1"=="deploy_docs" GOTO deploy_docs
IF "%~1"=="clean" GOTO clean
GOTO printdoc
:clean
rmdir /S /Q arcade.egg-info
rmdir /S /Q build
rmdir /S /Q dist
rmdir /S /Q .pytest_cache
rmdir /S /Q doc\build
GOTO end
:test
pytest
GOTO end
:testcov
pytest --cov=pypi_package_example
GOTO end
:typecheck
echo Running mypy type checker:
mypy -p arcade
IF ERRORLEVEL 1 (
echo ERROR: Type checking via mypy found errors, detailed above.
) else (
echo OK: Type checking via mypy found no errors.
)
GOTO end
:makedist
rem Clean out old builds
del /q dist\*.*
python setup.py clean
rem Build the python
python setup.py build
python setup.py bdist_wheel
GOTO end
rem -- Make the documentation
:makedoc
rmdir /s /q "doc\build"
sphinx-build -n -b html doc doc/build/html
GOTO end
rem -- Make the documentation
:spelling
rmdir /s /q "doc\build"
sphinx-build -n -b spelling doc doc/build/html
GOTO end
rem == This does a fast build and install, but no unit tests
:makefast
python setup.py build
python setup.py bdist_wheel
pip uninstall -y pypi_package_example
for /r %%i in (dist\*) do pip install "%%i"
GOTO end
rem -- Deploy
:deploy_pypi
rem Do a "pip install twine" and set environment variables before running.
twine upload -u %PYPI_USER% -p %PYPI_PASSWORD% -r pypi dist/*
GOTO end
:deploy_docs
rem This is a batch file used to sync the documentation for arcade.academy to
rem the bucket it is hosted on. Doesn't do much good if you don't have
rem the credentials.
rem You also need "aws command line" installed.
rem aws s3 sync doc/build/html s3://craven-arcade
GOTO end
rem -- Print documentation
:printdoc
echo make test - Runs the tests
echo make testcov - Runs the tests with coverage
echo make dist - Make the distributables
echo make docs Builds the documentation. Documentation
echo will be in doc/build/html
echo make deploy_pypi - Deploy to PyPi (if you have environment
echo variables set up correctly.)
echo make deploy_docs - Deploy documentation to S3 bucket (if you
echo have environment variables set up.)
:end