Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 # For DEB_HOST_ARCH
4 include /usr/share/dpkg/architecture.mk
5
6 export PYBUILD_NAME=imbalanced-learn
7
8 # TBD: Why is this here?
9 ifeq ($(DEB_HOST_ARCH), i386)
10 DEB_BUILD_OPTIONS += nocheck
11 endif
12
13 EXCLUDE_TESTS = not test_rusboost
14
15 # Bus errors triggered by scikit-learn
16 ifeq ($(DEB_HOST_ARCH), armhf)
17 EXCLUDE_TESTS += and not test_common
18 endif
19
20 # This test is flaky, skip it for now
21 export PYBUILD_BEFORE_TEST=cd {build_dir}
22 export PYBUILD_TEST_ARGS=--import-mode=importlib -k "$(EXCLUDE_TESTS)" imblearn/tests/
23
24 %:
25 dh $@ --buildsystem=pybuild
26
27 override_dh_auto_test:
28 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
29 # link to examples ... does not work
30 # set -x && find .pybuild -name build -type d -exec ln -s $(CURDIR)/examples \{\} \;
31 # set -x && find .pybuild -name build -type d -exec ln -s $(CURDIR)/imblearn/tests \{\}/imblearn \;
32 # dh_auto_test
33 set -e; for builddir in $(wildcard .pybuild/cpython3_*/build); do \
34 python=$$(echo $$builddir | grep -oP 'cpython3_\K[0-9.]+'); \
35 PYTHONPATH=$$builddir python$$python -m pytest \
36 --import-mode=importlib \
37 -k "$(EXCLUDE_TESTS)" \
38 $(CURDIR)/imblearn/tests/; \
39 done
40 endif