#!/usr/bin/make -f export PYBUILD_NAME=datalad_next # this instructs the test suite to skip any tests that require remote # resources export DATALAD_TESTS_NONETWORK = 1 PY3VERSIONS=$(shell py3versions -vr) # This is not needed in debhelper 12+ but we are targeting 10 TESTIT = 1 ifneq (,$(filter nocheck,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) TESTIT := 0 endif ifneq (,$(filter nocheck,$(subst $(COMMA), ,$(DEB_BUILD_PROFILES)))) TESTIT := 0 endif %: dh $@ --with python3 --buildsystem=pybuild clean:: dh_clean $(MAKE) PYTHON=python3 clean rm -rf $(CURDIR)/.pybuild rm -rf $(CURDIR)/.pytest_cache rm -rf $(CURDIR)/debian/install-for-tests override_dh_auto_test: ifeq ($(TESTIT),1) # Install special testing directory dh_auto_install --destdir $(CURDIR)/debian/install-for-tests # Perform the tests for any support python version. # This requires a particular environment: # - (PYTHON)PATH: we need the CLI entrypoint to be available # - HOME: tests require a a defined home (mostly) for accessing # configuration, and placing things like sockets set -e && \ for v in $(PY3VERSIONS); do \ distdir=$(CURDIR)/debian/install-for-tests/usr/lib/python$$v/dist-packages; \ PATH=$(CURDIR)/debian/install-for-tests/usr/bin:$$PATH \ PYTHONPATH=$$distdir:$$PYTHONPATH \ HOME=$(CURDIR)/.pybuild \ python$$v -m pytest -s -v $$distdir/datalad_next; \ done endif override_dh_auto_install: PYTHONPATH=. http_proxy='127.0.0.1:9' \ sphinx-build -N -bhtml docs/source/ \ debian/tmp/usr/share/doc/python3-datalad-next/html/ dh_auto_install