File: rules

package info (click to toggle)
pymatgen 2022.11.7%2Bdfsg1-11%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 87,528 kB
  • sloc: python: 149,229; xml: 39,149; makefile: 203; sh: 50
file content (112 lines) | stat: -rwxr-xr-x 5,502 bytes parent folder | download
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/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/<div class="footer">.*google-analytics.com.*<\/div>//' -i
	grep 'src="https://anaconda.org/conda-forge/pymatgen/badges/downloads.svg"' debian/python-pymatgen-doc/usr/share/doc/python-pymatgen-doc/html/* -r --files-with-matches | xargs sed 's|src="https://anaconda.org/conda-forge/pymatgen/badges/downloads.svg"|src="_images/downloads.svg"|' -i
	grep 'src="https://github.com/materialsproject/pymatgen/actions/workflows/test.yml/badge.svg"' debian/python-pymatgen-doc/usr/share/doc/python-pymatgen-doc/html/* -r --files-with-matches | xargs sed 's|src="https://github.com/materialsproject/pymatgen/actions/workflows/test.yml/badge.svg"|src="_images/tests_passing.svg"|' -i
	grep 'src="https://coveralls.io/repos/github/materialsproject/pymatgen/badge.svg?branch=master"' debian/python-pymatgen-doc/usr/share/doc/python-pymatgen-doc/html/* -r --files-with-matches | xargs sed 's|src="https://coveralls.io/repos/github/materialsproject/pymatgen/badge.svg?branch=master"|src="_images/coverage.svg"|' -i
	grep 'src="https://cdnjs.cloudflare.com/ajax/libs/octicons/.*/svg/mark-github.svg"' debian/python-pymatgen-doc/usr/share/doc/python-pymatgen-doc/html/* -r --files-with-matches | xargs sed 's|src="https://cdnjs.cloudflare.com/ajax/libs/octicons/.*/svg/mark-github.svg"|src="_images/mark-notgithub.svg"|' -i
endif