forked from pythonarcade/arcade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.bat
154 lines (109 loc) · 3.2 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
@echo off
rem Build script for Windows
IF "%~1"=="" GOTO printdoc
IF "%~1"=="full" GOTO makefull
IF "%~1"=="dist" GOTO makedist
IF "%~1"=="test" GOTO test
IF "%~1"=="testcov" GOTO test
IF "%~1"=="typecheck" GOTO typecheck
IF "%~1"=="fast" GOTO makefast
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=arcade
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
:makefull
rem -- This builds the project, installs it, and runs unit tests
rem Clean out old builds
rmdir /s /q "doc\build"
del /q dist\*.*
python setup.py clean
rem Build the python
python setup.py build
python setup.py bdist_wheel
rem Install the packages
pip uninstall -y arcade
for /r %%i in (dist\*) do pip install "%%i"
rem Build the documentation
sphinx-build -b html doc doc/build/html
rem Run tests and do code coverage
coverage run --source arcade setup.py test
coverage report --omit=arcade/examples/* -m
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 arcade
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.
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 full - Builds the project, installs it, builds
echo documentation, runs unit tests.
echo make docs Builds the documentation. Documentation
echo will be in doc/build/html
echo make spelling Spellchecks the documentation
echo make fast - Builds and installs the library WITHOUT unit
echo tests.
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