diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -1,28 +1,45 @@ - -.PHONY: clean test test-clean test-only generate-pkgs pip-packages +.DEFAULT_GOAL := help # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES} -clean: +.PHONY: clean +clean: ## full clean make test-clean find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' -test: + +.PHONY: test +test: ## run test-clean and tests make test-clean make test-only -test-clean: + +.PHONY:test-clean +test-clean: ## run test-clean and tests rm -rf coverage.xml htmlcov junit.xml pylint.log result find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' + find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' -test-only: + +.PHONY: test-only +test-only: ## run tests PYTHONHASHSEED=random \ py.test -x -vv -r xw -p no:sugar \ - --cov=vcsserver --cov-report=term-missing --cov-report=html vcsserver + --cov=vcsserver --cov-report=term-missing --cov-report=html \ + vcsserver -generate-pkgs: + +.PHONY: generate-pkgs +generate-pkgs: ## generate new python packages nix-shell pkgs/shell-generate.nix --command "pip2nix generate --licenses" -pip-packages: + +.PHONY: pip-packages +pip-packages: ## show outdated packages python ${OUTDATED_PACKAGES} + + +.PHONY: help +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}'