##// END OF EJS Templates
makefile: added dev-env command
super-admin -
r4905:cba0a015 default
parent child Browse files
Show More
@@ -1,147 +1,153 b''
1 1
2 2 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
3 3 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
4 4
5 5 NODE_PATH=./node_modules
6 6 WEBPACK=./node_binaries/webpack
7 7 GRUNT=./node_binaries/grunt
8 8
9 9 .PHONY: clean
10 10 ## Cleanup compiled and cache py files
11 11 clean:
12 12 make test-clean
13 13 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
14 14
15 15
16 16 .PHONY: test
17 17 ## run test-clean and tests
18 18 test:
19 19 make test-clean
20 20 make test-only
21 21
22 22
23 23 .PHONY:test-clean
24 24 ## run test-clean and tests
25 25 test-clean:
26 26 rm -rf coverage.xml htmlcov junit.xml pylint.log result
27 27 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
28 28 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
29 29
30 30
31 31 .PHONY: test-only
32 32 ## Run tests only without cleanup
33 33 test-only:
34 34 PYTHONHASHSEED=random \
35 35 py.test -x -vv -r xw -p no:sugar \
36 36 --cov-report=term-missing --cov-report=html \
37 37 --cov=rhodecode rhodecode
38 38
39 39 .PHONY: test-only-mysql
40 40 ## run tests against mysql
41 41 test-only-mysql:
42 42 PYTHONHASHSEED=random \
43 43 py.test -x -vv -r xw -p no:sugar \
44 44 --cov-report=term-missing --cov-report=html \
45 45 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \
46 46 --cov=rhodecode rhodecode
47 47
48 48
49 49 .PHONY: test-only-postgres
50 50 ## run tests against postgres
51 51 test-only-postgres:
52 52 PYTHONHASHSEED=random \
53 53 py.test -x -vv -r xw -p no:sugar \
54 54 --cov-report=term-missing --cov-report=html \
55 55 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \
56 56 --cov=rhodecode rhodecode
57 57
58 58 .PHONY: docs
59 59 ## build docs
60 60 docs:
61 61 (cd docs; nix-build default.nix -o result; make clean html)
62 62
63 63
64 64 .PHONY: docs-clean
65 65 ## Cleanup docs
66 66 docs-clean:
67 67 (cd docs; make clean)
68 68
69 69
70 70 .PHONY: docs-cleanup
71 71 ## Cleanup docs
72 72 docs-cleanup:
73 73 (cd docs; make cleanup)
74 74
75 75
76 76 .PHONY: web-build
77 77 ## Build JS packages static/js
78 78 web-build:
79 79 NODE_PATH=$(NODE_PATH) $(GRUNT)
80 80
81 81 # check required files
82 82 STATIC_CHECK="/robots.txt /502.html \
83 83 /js/scripts.min.js /js/rhodecode-components.js \
84 84 /css/style.css /css/style-polymer.css /css/style-ipython.css"
85 85
86 86 for file in $STATIC_CHECK;
87 87 do
88 88 if [ ! -f rhodecode/public/$file ]; then
89 89 echo "Missing $file expected after web-build"
90 90 exit 1
91 91 fi
92 92 done
93 93
94 94 .PHONY: pip-packages
95 95 ## show outdated packages
96 96 pip-packages:
97 97 python ${OUTDATED_PACKAGES}
98 98
99 99
100 100 .PHONY: sdist
101 101 ## Build sdist
102 102 sdist:
103 103 python setup.py sdist
104 104
105 105
106 .PHONY: dev-env
107 ## make dev-env based on the requirements files and install develop of packages
108 dev-env:
109 pip install -r requirements.txt -r requirements_debug.txt -r requirements_test.txt
110 pip install -e .
111
106 112 # Default command on calling make
107 113 .DEFAULT_GOAL := show-help
108 114
109 115 .PHONY: show-help
110 116 show-help:
111 117 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
112 118 @echo
113 119 @sed -n -e "/^## / { \
114 120 h; \
115 121 s/.*//; \
116 122 :doc" \
117 123 -e "H; \
118 124 n; \
119 125 s/^## //; \
120 126 t doc" \
121 127 -e "s/:.*//; \
122 128 G; \
123 129 s/\\n## /---/; \
124 130 s/\\n/ /g; \
125 131 p; \
126 132 }" ${MAKEFILE_LIST} \
127 133 | LC_ALL='C' sort --ignore-case \
128 134 | awk -F '---' \
129 135 -v ncol=$$(tput cols) \
130 136 -v indent=19 \
131 137 -v col_on="$$(tput setaf 6)" \
132 138 -v col_off="$$(tput sgr0)" \
133 139 '{ \
134 140 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
135 141 n = split($$2, words, " "); \
136 142 line_length = ncol - indent; \
137 143 for (i = 1; i <= n; i++) { \
138 144 line_length -= length(words[i]) + 1; \
139 145 if (line_length <= 0) { \
140 146 line_length = ncol - indent - length(words[i]) - 1; \
141 147 printf "\n%*s ", -indent, " "; \
142 148 } \
143 149 printf "%s ", words[i]; \
144 150 } \
145 151 printf "\n"; \
146 152 }'
147 153
General Comments 0
You need to be logged in to leave comments. Login now