Sunil Mohan Adapa f2bcecdf74
d/rules: Don't use setup.py to invoke tests, invoke directly instead
Invoking pytest from setup.py seems to be deprecated. It offers no real
advantages other than being predictable way of invoking tests for someone who
don't know that we use pytest for testing. Let's rely on our documentation
instead. Further this clears up the need to have setup.cfg.

Tests:

- Build debian package in using pbuilder. Tests are run and succeed during the
build.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-07 15:14:09 -04:00

24 lines
783 B
Makefile
Executable File

#!/usr/bin/make -f
export DH_VERBOSE=1
export PYBUILD_DESTDIR=debian/tmp
%:
dh $@ --with python3 --buildsystem=pybuild
override_dh_auto_install-indep:
dh_auto_install
./run --develop --list-dependencies | sort | tr '\n' ', ' | \
sed -e 's/^/freedombox:Depends=/' >> debian/freedombox.substvars
# pybuild can run pytest. However, when the top level directory is included in
# the path (done using manage.py), it results in import problems.
# https://www.mail-archive.com/debian-python@lists.debian.org/msg17997.html
override_dh_auto_test:
PYBUILD_SYSTEM=custom \
PYBUILD_TEST_ARGS="{interpreter} -m pytest" dh_auto_test
override_dh_installsystemd:
# Do not enable or start freedombox-manual-upgrade.service.
dh_installsystemd --exclude=freedombox-manual-upgrade.service