1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
#!/usr/bin/make
# WARN: gmake syntax
########################################################
# Makefile for pyeapi
#
# useful targets:
# make sdist -- build python source distribution
# make pep8 -- pep8 checks
# make pyflakes -- pyflakes checks
# make flake8 -- flake8 checks
# make check -- manifest checks
# make tests -- run all of the tests
# make unittest -- runs the unit tests
# make systest -- runs the system tests
# make clean -- clean distutils
# make coverage_report -- code coverage report
#
########################################################
# variable section
NAME = "pyeapi"
PYTHON=python
COVERAGE=coverage
SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
VERSION := $(shell cat VERSION)
########################################################
all: clean check pep8 flake8 tests
pep8:
-pep8 -r --ignore=E402,E731,E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241 pyeapi/ test/
pyflakes:
pyflakes pyeapi/ test/
flake8:
flake8 --ignore=E302,E303,E402,E731,W391 --exit-zero pyeapi/
flake8 --ignore=E302,E303,E402,E731,W391,N802 --max-line-length=100 test/
check:
check-manifest
clean:
@echo "Cleaning up distutils stuff"
rm -rf build
rm -rf dist
rm -rf MANIFEST
rm -rf *.egg-info
@echo "Cleaning up byte compiled python stuff"
find . -type f -regex ".*\.py[co]$$" -delete
@echo "Cleaning up doc builds"
rm -rf docs/_build
rm -rf docs/api_modules
rm -rf docs/client_modules
sdist: clean
$(PYTHON) setup.py sdist
tests: unittest systest
unittest: clean
$(COVERAGE) run -m unittest discover test/unit -v
systest: clean
$(COVERAGE) run -m unittest discover test/system -v
coverage_report:
$(COVERAGE) report --rcfile=".coveragerc"
|