##// END OF EJS Templates
makefile: updated to latest format
super-admin -
r1040:8b0bc54c python3
parent child Browse files
Show More
@@ -1,32 +1,87 b''
1
2 .PHONY: clean test test-clean test-only generate-pkgs pip-packages build-nix
3
1
4 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
2 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
5 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
3 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
6
4
5 .PHONY: clean
6 ## Cleanup compiled and cache py files
7 clean:
7 clean:
8 make test-clean
8 make test-clean
9 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
9 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
10
10
11
12 .PHONY: test
13 ## Run tests
11 test:
14 test:
12 make test-clean
15 make test-clean
13 make test-only
16 make test-only
14
17
18
19 .PHONY: test-only
20 ## Run tests only without cleanup
21 test-only:
22 PYTHONHASHSEED=random \
23 py.test -x -vv -r xw -p no:sugar \
24 --cov-report=term-missing --cov-report=html --cov=vcsserver vcsserver
25
26
27 .PHONY: test-clean
28 ## Cleanup test run artifacts
15 test-clean:
29 test-clean:
16 rm -rf coverage.xml htmlcov junit.xml pylint.log result
30 rm -rf coverage.xml htmlcov junit.xml pylint.log result
17 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
31 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
18 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
32 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
19
33
20 test-only:
34 .PHONY: pip-packages
21 PYTHONHASHSEED=random \
35 ## Show outdated packages
22 py.test -x -vv -r xw -p no:sugar \
23 --cov=vcsserver --cov-report=term-missing --cov-report=html vcsserver
24
25 generate-pkgs:
26 nix-shell pkgs/shell-generate.nix --command "pip2nix generate --licenses --no-binary :all:"
27
28 pip-packages:
36 pip-packages:
29 python ${OUTDATED_PACKAGES}
37 python ${OUTDATED_PACKAGES}
30
38
31 build-nix:
39
32 nix-build --show-trace --option sandbox false --option max-jobs 4 --option cores 4
40 .PHONY: sdist
41 ## Build sdist
42 sdist:
43 python setup.py sdist
44
45
46 # Default command on calling make
47 .DEFAULT_GOAL := show-help
48
49 .PHONY: show-help
50 show-help:
51 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
52 @echo
53 @sed -n -e "/^## / { \
54 h; \
55 s/.*//; \
56 :doc" \
57 -e "H; \
58 n; \
59 s/^## //; \
60 t doc" \
61 -e "s/:.*//; \
62 G; \
63 s/\\n## /---/; \
64 s/\\n/ /g; \
65 p; \
66 }" ${MAKEFILE_LIST} \
67 | LC_ALL='C' sort --ignore-case \
68 | awk -F '---' \
69 -v ncol=$$(tput cols) \
70 -v indent=19 \
71 -v col_on="$$(tput setaf 6)" \
72 -v col_off="$$(tput sgr0)" \
73 '{ \
74 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
75 n = split($$2, words, " "); \
76 line_length = ncol - indent; \
77 for (i = 1; i <= n; i++) { \
78 line_length -= length(words[i]) + 1; \
79 if (line_length <= 0) { \
80 line_length = ncol - indent - length(words[i]) - 1; \
81 printf "\n%*s ", -indent, " "; \
82 } \
83 printf "%s ", words[i]; \
84 } \
85 printf "\n"; \
86 }' \
87 | more $(shell test $(shell uname) == Darwin && echo '--no-init --raw-control-chars')
General Comments 0
You need to be logged in to leave comments. Login now