561c7746aaf9869c46af4d220e211d2de747d068
[gentoo.git] / dev-python / pywavelets / pywavelets-0.5.2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python{2_7,3_5,3_6} )
7
8 inherit distutils-r1
9
10 MY_PN="${PN/pyw/PyW}"
11 MY_P="${MY_PN}-${PV}"
12
13 DESCRIPTION="Discrete Wavelet Transforms in Python"
14 HOMEPAGE="https://pywavelets.readthedocs.io/en/latest/"
15 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
16
17 LICENSE="MIT"
18 SLOT="0"
19 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
20 IUSE="doc examples test"
21 RESTRICT="!test? ( test )"
22
23 RDEPEND="dev-python/numpy[${PYTHON_USEDEP}]"
24 DEPEND="
25         dev-python/cython[${PYTHON_USEDEP}]
26         doc? ( dev-python/sphinx[${PYTHON_USEDEP}]
27                 dev-python/numpydoc[${PYTHON_USEDEP}] )
28         test? (
29            ${RDEPEND}
30            dev-python/nose[${PYTHON_USEDEP}]
31         )
32 "
33
34 S="${WORKDIR}/${MY_P}"
35
36 python_test() {
37         cd "${BUILD_DIR}"/lib || die
38         nosetests -v .
39 }
40
41 python_compile_all() {
42         use doc && emake -C doc html
43 }
44
45 python_install_all() {
46         use doc && local HTML_DOCS=( doc/build/html/. )
47         distutils-r1_python_install_all
48         if use examples; then
49                 insinto /usr/share/doc/${PF}/examples
50                 doins -r demo/*
51                 docompress -x /usr/share/doc/${PF}/examples
52         fi
53 }