#!/usr/bin/make -f # See debhelper(7) (uncomment to enable) # output every command that modifies files on the build system. #export DH_VERBOSE = 1 export PYBUILD_NAME=pymatgen include /usr/share/dpkg/architecture.mk # bootstrapping problem with circular dependency between pymatgen and mp-api # mp_api is only used by ext/matproj.py, so skip its test at build-time # (in practice the matproj tests are skipped anyway since an MP API key is not available) SKIP_TEST_LIST += test_matproj # io/qchem is partly broken, skip failing tests # io/qchem input SKIP_TEST_LIST += test_from_multi_jobs_file test_from_string test_read_molecule test_read_nbo test_read_negative test_read_plots test_read_write_nbo7 # io/qchem output SKIP_TEST_LIST += test_all test_custom_smd_write # io/qchem sets (test_sets.py all fail) SKIP_TEST_LIST += test_sets # these io tests fail in chroot SKIP_TEST_LIST += test_CifWriter test_read_write test_init test_get_site_symmetries ifneq (,$(findstring $(DEB_HOST_ARCH), arm64)) SKIP_TEST_LIST += test_get_parchg endif ifneq (,$(findstring $(DEB_HOST_ARCH), i386)) SKIP_TEST_LIST += test_get_parchg endif ifneq (,$(findstring $(DEB_HOST_ARCH), mips64el)) SKIP_TEST_LIST += test_pca endif ifneq (,$(findstring $(DEB_HOST_ARCH), ppc64el)) SKIP_TEST_LIST += test_get_parchg endif ifneq (,$(findstring $(DEB_HOST_ARCH), s390x)) SKIP_TEST_LIST += test_spillage_from_vasprun test_from_file # many VASP tests fail on s390x (and ppc64) SKIP_TEST_LIST += test_optics test__generate_G_points test__generate_nbmax test_evaluate_wavefunc test_fft_mesh_advanced test_fft_mesh_basic SKIP_TEST_LIST += test_get_parchg test_n2_45210 test_n2_spin test_standard test_write_unks test_consistency endif ifneq (,$(findstring $(DEB_HOST_ARCH), hurd-i386)) SKIP_TEST_LIST += plot test_structure_environments test_pca test_get_info_cohps_to_neighbors test_get_parchg test_as_dict_from_dict test_ir_spectra endif # ppc64 fails on same tests as s390x ifneq (,$(findstring $(DEB_HOST_ARCH), ppc64)) SKIP_TEST_LIST += test_spillage_from_vasprun test_from_file SKIP_TEST_LIST += test_optics test__generate_G_points test__generate_nbmax test_evaluate_wavefunc test_fft_mesh_advanced test_fft_mesh_basic SKIP_TEST_LIST += test_get_parchg test_n2_45210 test_n2_spin test_standard test_write_unks test_consistency endif ifneq (,$(findstring $(DEB_HOST_ARCH), riscv64)) SKIP_TEST_LIST += test_get_parchg endif %: dh $@ --buildsystem=pybuild execute_after_dh_auto_clean: rm -f pymatgen/optimization/linear_assignment.c pymatgen/optimization/neighbors.c pymatgen/util/coord_cython.c ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) execute_after_dh_auto_build-indep: export http_proxy=127.0.0.1:9 execute_after_dh_auto_build-indep: export https_proxy=127.0.0.1:9 execute_after_dh_auto_build-indep: PYTHONPATH=$(shell pybuild --pyver `py3versions --default -v` --print build_dir | awk '{print $$3}' ) \ make -C docs_rst html BUILDDIR=$(CURDIR)/build/html endif override_dh_auto_test: py=`py3versions --default -v`; \ pybuilddir=`pybuild --pyver $$py --print build_dir | awk '{print $$3}'`; \ testdir=$(CURDIR)/.pybuild/test_python$$py; \ cp -a $$pybuilddir $$testdir; \ for t in `find pymatgen -name tests`; do \ d=`dirname $$t`; \ cp -a $$t $$testdir/$$d; \ done; \ SKIP_TESTS=""; \ list_initialised=0; \ for t in $(SKIP_TEST_LIST); do \ if [ $${list_initialised} = 0 ]; then \ SKIP_TESTS=$$t; \ list_initialised=1; \ else \ SKIP_TESTS="$${SKIP_TESTS} or $$t"; \ fi; \ done; \ if [ "x$${SKIP_TESTS}" != "x" ]; then \ SKIP_TESTS="not ( $${SKIP_TESTS} )"; \ fi; \ echo "skipping tests: $${SKIP_TESTS}"; \ PMG_TEST_FILES_DIR=/usr/share/doc/pymatgen-test-files/examples/test_files PYTHONPATH=$$testdir \ pytest-3 -v --color=no -k "$${SKIP_TESTS}" $$testdir; \ ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) execute_after_dh_installdocs-indep: # use multiline sed to remove entire div block for google-analytics.com grep "google-analytics.com" debian/python-pymatgen-doc/usr/share/doc/python-pymatgen-doc/html/* -r --files-with-matches | xargs sed '/./{H;$$!d} ; x ; s/