From 3ded91b33ad1f756ed9e7c798528aeace532fdf3 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Mon, 12 Sep 2016 08:03:39 +0200 Subject: Move doc generation and test invocation to separate Makefile --- HACKING | 4 ++-- Makefile | 22 ++++++++++++++++++++++ debian/rules | 15 +++------------ 3 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 Makefile diff --git a/HACKING b/HACKING index 2c542d3b..bb90b0cc 100644 --- a/HACKING +++ b/HACKING @@ -2,7 +2,7 @@ Running the Tests ----------------- The tests are run via - python setup.py nosetests + make To also run the component tests, you need to initialize the git submodules once via: @@ -17,7 +17,7 @@ Building the API Docs --------------------- You can build the API docs using - epydoc -v --config=setup.cfg + make apidocs Contributing Patches diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..4575b355 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +all: syntax-check test + +test: + export GIT_AUTHOR_NAME="Gbp Tests"; \ + export GIT_AUTHOR_EMAIL=tests@example.com; \ + export GIT_COMMITTER_NAME=$$GIT_AUTHOR_NAME; \ + export GIT_COMMITTER_EMAIL=$$GIT_AUTHOR_EMAIL; \ + PYTHONPATH=. \ + python setup.py nosetests --with-xcoverage + +syntax-check: + PYTHONPATH=. pychecker $(PYCHECKER_ARGS) -q \ + gbp gbp.scripts gbp.git gbp.deb + +docs: + make -C docs + +apidocs: + mkdir -p build + epydoc -v --config=setup.cfg + +.PHONY: docs diff --git a/debian/rules b/debian/rules index 405bb88d..00702d4d 100755 --- a/debian/rules +++ b/debian/rules @@ -14,28 +14,19 @@ ZSH_COMPDIR = /usr/share/zsh/vendor-completions/ PYCHECKER_ARGS=-boptparse --no-override --no-shadowbuiltin %: - dh $@ --with python2 + dh $@ --with python2 --buildsystem=python_distutils override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) dh_auto_test - export GIT_AUTHOR_NAME="Gbp Tests"; \ - export GIT_AUTHOR_EMAIL=tests@example.com; \ - export GIT_COMMITTER_NAME=$$GIT_AUTHOR_NAME; \ - export GIT_COMMITTER_EMAIL=$$GIT_AUTHOR_EMAIL; \ - PYTHONPATH=. \ - python setup.py nosetests --with-xcoverage - - PYTHONPATH=. pychecker $(PYCHECKER_ARGS) -q \ - gbp gbp.scripts gbp.git gbp.deb + make else @echo "Checks disabled via DEB_BUILD_OPTIONS" endif override_dh_auto_build: dh_auto_build - epydoc -v --config=setup.cfg - make -C docs/ + make apidocs docs override_dh_auto_install: dh_auto_install -- cgit v1.2.3