-
Notifications
You must be signed in to change notification settings - Fork 4
/
makefile
61 lines (45 loc) · 1.5 KB
/
makefile
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
# Need to export as ENV var
export TEST_DIR = tests
export TEST_DATA = test_data
export LIB_DIR = pylib
export CODE_DIR = .
export HTML_DIR = .
export DATA_DIR = $(CODE_DIR)/data
export DOCKER_DIR = docker
PYTHONFILES = $(shell ls *.py)
PYTHONFILES += $(shell ls $(LIB_DIR)/*.py)
PSHELL_SCRIPTS = $(shell ls *.sh | sed -e 's/.sh/.ps1/')
PSHELL_SCRIPTS += $(shell ls $(TEST_DIR)/*.sh | sed -e 's/.sh/.ps1/')
BASH2PS = python bash_to_powershell.py
FORCE:
github:
-git commit -a
git push origin master
container: $(DOCKER_DIR)/Dockerfile $(DOCKER_DIR)/requirements.txt
docker build -t utils docker
html_tests: FORCE
$(TEST_DIR)/html_tests.sh
script_tests: FORCE
$(TEST_DIR)/script_tests.sh
pytests: FORCE
$(LIB_DIR)/pytests.sh
tests: html_tests script_tests
# download make for windows to run tests on powershell:
# http://gnuwin32.sourceforge.net/packages/make.htm
# the test can depend upon the ps1 files being built like this:
# pshell_html_tests: $(TEST_DIR)/html_tests_powershell.ps1
pshell_html_tests: FORCE
$(info )
python bash_to_powershell.py ./tests/html_tests.sh -d=True
powershell -ExecutionPolicy ByPass $(TEST_DIR)/html_tests_powershell.ps1
%.ps1: %.sh
$(BASH2PS) $<
pshell_scripts: $(PSHELL_SCRIPTS)
pshell_script_tests: FORCE
$(info )
python bash_to_powershell.py ./tests/script_tests.sh -d=True
powershell -ExecutionPolicy ByPass $(TEST_DIR)/script_tests_powershell.ps1
pshell_tests: pshell_html_tests pshell_script_tests
lint:
flake8 $(PYTHONFILES)
prod: $(INCS) $(HTMLFILES) lint tests github