39
39
export PRINT_HELP_PYSCRIPT
40
40
BROWSER := python -c "$$BROWSER_PYSCRIPT"
41
41
42
+
43
+ define ASCILOGO
44
+ ██████ ▄████▄ ▄▄▄ ██▀███ ██▓ ▓█████▄▄▄█████▓▄▄▄█████▓ ███▄ ▄███▓ ▄▄▄ ██ ▄█▀▓█████
45
+ ▒██ ▒ ▒██▀ ▀█ ▒████▄ ▓██ ▒ ██▒▓██▒ ▓█ ▀▓ ██▒ ▓▒▓ ██▒ ▓▒ ▓██▒▀█▀ ██▒▒████▄ ██▄█▒ ▓█ ▀
46
+ ░ ▓██▄ ▒▓█ ▄ ▒██ ▀█▄ ▓██ ░▄█ ▒▒██░ ▒███ ▒ ▓██░ ▒░▒ ▓██░ ▒░ ▓██ ▓██░▒██ ▀█▄ ▓███▄░ ▒███
47
+ ▒ ██▒▒▓▓▄ ▄██▒░██▄▄▄▄██ ▒██▀▀█▄ ▒██░ ▒▓█ ▄░ ▓██▓ ░ ░ ▓██▓ ░ ▒██ ▒██ ░██▄▄▄▄██ ▓██ █▄ ▒▓█ ▄
48
+ ▒██████▒▒▒ ▓███▀ ░ ▓█ ▓██▒░██▓ ▒██▒░██████▒░▒████▒ ▒██▒ ░ ▒██▒ ░ ▒██▒ ░██▒ ▓█ ▓██▒▒██▒ █▄░▒████▒
49
+ ▒ ▒▓▒ ▒ ░░ ░▒ ▒ ░ ▒▒ ▓▒█░░ ▒▓ ░▒▓░░ ▒░▓ ░░░ ▒░ ░ ▒ ░░ ▒ ░░ ░ ▒░ ░ ░ ▒▒ ▓▒█░▒ ▒▒ ▓▒░░ ▒░ ░
50
+ ░ ░▒ ░ ░ ░ ▒ ▒ ▒▒ ░ ░▒ ░ ▒░░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ▒▒ ░░ ░▒ ▒░ ░ ░ ░
51
+ ░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░░ ░ ░
52
+ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░
53
+ ░
54
+ =======================================
55
+ endef
56
+
57
+ export ASCILOGO
58
+
59
+ # http://misc.flogisoft.com/bash/tip_colors_and_formatting
60
+
61
+ RED =\033[0;31m
62
+ GREEN =\033[0;32m
63
+ ORNG =\033[38;5;214m
64
+ BLUE =\033[38;5;81m
65
+ NC =\033[0m
66
+
67
+ export RED
68
+ export GREEN
69
+ export NC
70
+ export ORNG
71
+ export BLUE
72
+
73
+ # # verify that certain variables have been defined off the bat
74
+ # check_defined = \
75
+ # $(foreach 1,$1,$(__check_defined))
76
+ # __check_defined = \
77
+ # $(if $(value $1),, \
78
+ # $(error Undefined $1$(if $(value 2), ($(strip $2)))))
79
+
80
+ # list_allowed_args := product
81
+
42
82
help :
83
+ @printf " \033[1m$$ ASCILOGO $$ NC\n"
84
+ @printf " \033[21m\n\n"
85
+ @printf " =======================================\n"
86
+ @printf " \n"
43
87
@python -c " $$ PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST )
44
88
45
89
list :
@@ -49,13 +93,17 @@ clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and
49
93
50
94
.PHONY : bootstrap
51
95
bootstrap :
52
- [ " $$ VIRTUAL_ENV" != " " ]
96
+ # [ "$$VIRTUAL_ENV" != "" ]
53
97
rm -rf * .egg-info || true
54
98
pip install -r requirements.txt
55
99
pip install -r requirements_dev.txt
56
100
python setup.py install
57
101
pip install -e .[test]
58
102
103
+ .PHONY : bootstrap-experimental
104
+ bootstrap-experimental :
105
+ pip install -r requirements_test_experimental.txt
106
+
59
107
clean-build : # # remove build artifacts
60
108
rm -fr build/
61
109
rm -fr dist/
@@ -130,18 +178,63 @@ test-travis:
130
178
$(pytest ) $(test_args_no_xml ) --benchmark-skip
131
179
coverage report -m
132
180
181
+ .PHONY : test-travis-scarlettonly
182
+ test-travis-scarlettonly : export TRAVIS_CI=1
183
+ test-travis-scarlettonly :
184
+ $(pytest ) $(test_args_no_xml ) --benchmark-skip -m scarlettonly
185
+ coverage report -m
186
+
187
+ .PHONY : test-travis-scarlettonlyintgr
188
+ test-travis-scarlettonlyintgr : export TRAVIS_CI=1
189
+ test-travis-scarlettonlyintgr :
190
+ $(pytest ) $(test_args_no_xml ) --benchmark-skip -m scarlettonlyintgr
191
+ coverage report -m
192
+
193
+ .PHONY : test-travis-scarlettonlyintgr-no-timeout
194
+ test-travis-scarlettonlyintgr-no-timeout : export TRAVIS_CI=1
195
+ test-travis-scarlettonlyintgr-no-timeout :
196
+ $(pytest ) $(test_args_no_xml ) --benchmark-skip -m scarlettonlyintgr -p no:timeout
197
+ coverage report -m
198
+
199
+ .PHONY : test-travis-scarlettonlyunittest
200
+ test-travis-scarlettonlyunittest : export TRAVIS_CI=1
201
+ test-travis-scarlettonlyunittest :
202
+ $(pytest ) $(test_args_no_xml ) --benchmark-skip -m scarlettonlyunittest
203
+ coverage report -m
204
+
205
+ .PHONY : test-travis-unittest
206
+ test-travis-unittest : export TRAVIS_CI=1
207
+ test-travis-unittest :
208
+ $(pytest ) $(test_args_no_xml ) --benchmark-skip -m unittest
209
+ coverage report -m
210
+
133
211
.PHONY : test-travis-debug
134
212
test-travis-debug :
135
213
$(pytest ) $(test_args_no_xml ) --benchmark-skip --pdb --showlocals
136
214
coverage report -m
137
215
216
+ .PHONY : test-travis-leaks
217
+ test-travis-leaks : export TRAVIS_CI=1
218
+ test-travis-leaks :
219
+ $(pytest ) $(test_args_no_xml ) --benchmark-skip -R :
220
+ coverage report -m
221
+
138
222
.PHONY : cover
139
223
cover :
140
224
$(pytest ) $(cover_args ) --benchmark-skip
141
225
coverage report -m
142
226
coverage html
143
227
$(BROWSER ) htmlcov/index.html
144
228
229
+ .PHONY : cover-travisci
230
+ cover-travisci : export TRAVIS_CI=1
231
+ cover-travisci : display-env
232
+ # $(pytest) $(cover_args) --benchmark-skip -p no:ipdb
233
+ pytest -p no:ipdb -p no:pytestipdb -s --tb short --cov-config .coveragerc --cov scarlett_os tests --cov-report html --benchmark-skip --showlocals --trace-config
234
+ coverage report -m
235
+ coverage html
236
+ $(BROWSER ) htmlcov/index.html
237
+
145
238
.PHONY : cover-debug
146
239
cover-debug :
147
240
# --showlocals # show local variables in tracebacks
@@ -157,6 +250,21 @@ cover-debug-no-timeout:
157
250
coverage html
158
251
$(BROWSER ) htmlcov/index.html
159
252
253
+ .PHONY : display-env
254
+ display-env :
255
+ @printf " =======================================\n"
256
+ @printf " $$ GREEN TRAVIS_CI:$$ NC $( TRAVIS_CI) \n"
257
+ @printf " =======================================\n"
258
+
259
+ # This task simulates a travis environment
260
+ .PHONY : cover-debug-no-timeout-travisci
261
+ cover-debug-no-timeout-travisci : export TRAVIS_CI=1
262
+ cover-debug-no-timeout-travisci : display-env
263
+ pytest -p no:timeout -s --tb short --cov-config .coveragerc --cov scarlett_os tests --cov-report html --benchmark-skip --pdb --showlocals
264
+ coverage report -m
265
+ coverage html
266
+ $(BROWSER ) htmlcov/index.html
267
+
160
268
.PHONY : shell
161
269
shell :
162
270
ipython
@@ -256,3 +364,34 @@ create-docker-machine:
256
364
--engine-install-url " https://test.docker.com" \
257
365
scarlett-1604-packer
258
366
eval $(docker-machine env scarlett-1604-packer )
367
+
368
+ docker-compose-build :
369
+ @docker-compose -f docker-compose-devtools.yml build
370
+
371
+ docker-compose-build-master :
372
+ @docker-compose -f docker-compose-devtools.yml build master
373
+
374
+ docker-compose-run-master :
375
+ @docker-compose -f docker-compose-devtools.yml run --name scarlett_master --rm master bash
376
+
377
+ docker-compose-run-test :
378
+ @docker-compose -f docker-compose-devtools.yml run --name scarlett_test --rm test bash python3 --version
379
+
380
+ docker-compose-up :
381
+ @docker-compose -f docker-compose-devtools.yml up
382
+
383
+ docker-compose-up-build :
384
+ @docker-compose -f docker-compose-devtools.yml up --build
385
+
386
+ docker-compose-down :
387
+ @docker-compose -f docker-compose-devtools.yml down
388
+
389
+ docker-version :
390
+ @docker --version
391
+ @docker-compose --version
392
+
393
+ docker-exec :
394
+ @scripts/docker/exec-master
395
+
396
+ docker-exec-master :
397
+ @scripts/docker/exec-master
0 commit comments