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>
This commit is contained in:
Sunil Mohan Adapa 2021-09-22 16:06:10 -07:00 committed by James Valleroy
parent 3c370d02ab
commit f2bcecdf74
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 4 additions and 4 deletions

5
debian/rules vendored
View File

@ -11,9 +11,12 @@ override_dh_auto_install-indep:
./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} setup.py test" dh_auto_test
PYBUILD_TEST_ARGS="{interpreter} -m pytest" dh_auto_test
override_dh_installsystemd:
# Do not enable or start freedombox-manual-upgrade.service.

View File

@ -1,3 +0,0 @@
[aliases]
# When './setup.py test' is invoked, run './setup.py pytest'
test=pytest