Created
June 18, 2013 20:03
-
-
Save dimitrov/5808780 to your computer and use it in GitHub Desktop.
An example Makefile for a python project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PACKAGE=mypackage | |
MIN_COVERAGE=90 | |
# NOTE: Be careful, rm -rf will be called on this! | |
COVERAGE_HTML_DIR=coverage/ | |
VERBOSITY=2 | |
.PHONY: all dev install test coverage clean | |
all: test | |
dev: | |
pip install -r requirements.txt | |
python setup.py develop | |
install: | |
python setup.py install | |
test: | |
nosetests --verbosity=$(VERBOSITY) | |
coverage: | |
nosetests --verbosity=$(VERBOSITY) \ | |
--with-coverage \ | |
--cover-erase \ | |
--cover-package=$(PACKAGE) \ | |
--cover-html \ | |
--cover-html-dir=$(COVERAGE_HTML_DIR) \ | |
--cover-min-percentage=$(MIN_COVERAGE) | |
@echo | |
@echo "Coverage report: file://`pwd`/$(COVERAGE_HTML_DIR)index.html" | |
clean: | |
find . -type f -name '*.pyc' -delete | |
find . -type f -name '*.pyo' -delete | |
find . -type f -name '*~' -delete | |
find . -type f -name '.coverage' -delete | |
rm -rf $(COVERAGE_HTML_DIR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment