Makefile
87 lines
| 1.9 KiB
| text/x-makefile
|
MakefileLexer
r132 | ||||
r832 | # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py | |||
OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES} | ||||
r132 | ||||
r1040 | .PHONY: clean | |||
## Cleanup compiled and cache py files | ||||
r132 | clean: | |||
make test-clean | ||||
r642 | find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' | |||
r132 | ||||
r1040 | ||||
.PHONY: test | ||||
## Run tests | ||||
r132 | test: | |||
make test-clean | ||||
make test-only | ||||
r1040 | ||||
.PHONY: test-only | ||||
## Run tests only without cleanup | ||||
test-only: | ||||
PYTHONHASHSEED=random \ | ||||
py.test -x -vv -r xw -p no:sugar \ | ||||
--cov-report=term-missing --cov-report=html --cov=vcsserver vcsserver | ||||
.PHONY: test-clean | ||||
## Cleanup test run artifacts | ||||
r132 | test-clean: | |||
rm -rf coverage.xml htmlcov junit.xml pylint.log result | ||||
find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' | ||||
r970 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' | |||
r132 | ||||
r1040 | .PHONY: pip-packages | |||
## Show outdated packages | ||||
r832 | pip-packages: | |||
python ${OUTDATED_PACKAGES} | ||||
r973 | ||||
r1040 | ||||
.PHONY: sdist | ||||
## Build sdist | ||||
sdist: | ||||
python setup.py sdist | ||||
# Default command on calling make | ||||
.DEFAULT_GOAL := show-help | ||||
.PHONY: show-help | ||||
show-help: | ||||
@echo "$$(tput bold)Available rules:$$(tput sgr0)" | ||||
@echo | ||||
@sed -n -e "/^## / { \ | ||||
h; \ | ||||
s/.*//; \ | ||||
:doc" \ | ||||
-e "H; \ | ||||
n; \ | ||||
s/^## //; \ | ||||
t doc" \ | ||||
-e "s/:.*//; \ | ||||
G; \ | ||||
s/\\n## /---/; \ | ||||
s/\\n/ /g; \ | ||||
p; \ | ||||
}" ${MAKEFILE_LIST} \ | ||||
| LC_ALL='C' sort --ignore-case \ | ||||
| awk -F '---' \ | ||||
-v ncol=$$(tput cols) \ | ||||
-v indent=19 \ | ||||
-v col_on="$$(tput setaf 6)" \ | ||||
-v col_off="$$(tput sgr0)" \ | ||||
'{ \ | ||||
printf "%s%*s%s ", col_on, -indent, $$1, col_off; \ | ||||
n = split($$2, words, " "); \ | ||||
line_length = ncol - indent; \ | ||||
for (i = 1; i <= n; i++) { \ | ||||
line_length -= length(words[i]) + 1; \ | ||||
if (line_length <= 0) { \ | ||||
line_length = ncol - indent - length(words[i]) - 1; \ | ||||
printf "\n%*s ", -indent, " "; \ | ||||
} \ | ||||
printf "%s ", words[i]; \ | ||||
} \ | ||||
printf "\n"; \ | ||||
}' \ | ||||
| more $(shell test $(shell uname) == Darwin && echo '--no-init --raw-control-chars') | ||||