*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / sci-physics / qutip / qutip-4.2.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 python3_6 )
7
8 inherit distutils-r1 toolchain-funcs
9
10 DESCRIPTION="Simulating dynamics of open quantum systems in Python."
11 HOMEPAGE="http://qutip.org"
12 SRC_URI="https://github.com/qutip/qutip/archive/v$PV.tar.gz -> $P.tar.gz"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="openmp test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="dev-python/cython[${PYTHON_USEDEP}]
21         dev-python/numpy[${PYTHON_USEDEP}]
22         dev-python/matplotlib[${PYTHON_USEDEP}]
23         sci-libs/scipy[${PYTHON_USEDEP}]
24 "
25 DEPEND="${RDEPEND}
26         test? ( dev-python/nose[${PYTHON_USEDEP}] )
27 "
28
29 pkg_pretend() {
30         [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
31 }
32
33 pkg_setup() {
34         [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
35 }
36
37 python_prepare_all() {
38         sed -i setup.py \
39                 -e 's/_compiler_flags = .*$/_compiler_flags = []/' || die
40
41         distutils-r1_python_prepare_all
42 }
43
44 python_configure_all() {
45         use openmp && mydistutilsargs=( --with-openmp )
46 }
47
48 python_test() {
49         cd "${BUILD_DIR}"/lib* || die
50         ${EPYTHON} -c "import qutip.testing as qt ; qt.run()" || die
51 }