1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
export PYBUILD_NAME=pysam
export LC_ALL = C.UTF-8
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
TESTPKG := $(DEB_SOURCE)-tests
export HTSLIB_MODE=external
HTSLIBDIR := /usr/lib/$(DEB_HOST_MULTIARCH)
export HTSLIB_LIBRARY_DIR=$(HTSLIBDIR)
export HTSLIB_INCLUDE_DIR=/usr/include
export PYBUILD_TEST_NOSE=1
# pybuild calls nosetests as `python{version} -m nose tests`
#
# The "tests" argument (passed by pybuild as shown above) fails,
# so don't pass anything:
export PYBUILD_TEST_ARGS=
# This is how we pass parameters to nose without command-line flags
export NOSE_WHERE=$(CURDIR)/tests
export NOSE_VERBOSE=2
export NOSE_NOCAPTURE=1
# DEB_BUILD_OPTIONS := nocheck
clean: clean-tests
%:
dh $@ --with python2,python3 --buildsystem=pybuild
override_dh_install: clean-tests
dh_install -Xtest.gtf.gz
override_dh_auto_test: pysam_data.all cbcf_data.all
dh_auto_test
override_dh_auto_clean:
dh_auto_clean
$(RM) \
pysam/config.py \
pysam/config.h \
pysam/lib*.c \
samtools/config.h
rm -rf pysam.egg-info
.PHONY: pysam_data.% cbcf_data.%
cbcf_data.%:
cd tests/$(basename $@) && $(MAKE) $*
pysam_data.%:
cd tests/$(basename $@) && $(MAKE) $*
.PHONY: clean-tests
clean-tests: pysam_data.clean cbcf_data.clean
find . -name "*.pyc" -delete
find . -name "*.pyxbldc" -delete
find . -name "tmp_*" -delete
find . -name "*.bai*" -delete
find . -name "*.cram*" -delete
find . -name "*.bam" -delete
rm -rf tests/pysam_test_work \
tests/example_htslib.gtf.gz.tbi \
tests/log.txt \
tests/test.bam \
tests/_compile_test.c \
tests/pysam_ex2.sam \
tests/__pycache__ \
pysam/calignmentfile.c \
pysam/cbcf.c \
tests/GRCh38_full_analysis_set_plus_decoy_hla.fa.fai \
tests/pysam_data/ex1.fa.gz \
tests/pysam_data/ex1.fa.gz.gzi \
tests/pysam_data/ex1_csi.bam.csi
|