b413034e1d0088f1473fe286e7d2b04df7aceaad
[gentoo.git] / dev-python / fitsio / fitsio-0.9.11.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
9
10 DESCRIPTION="Python library to read from and write to FITS files"
11 HOMEPAGE="https://github.com/esheldon/fitsio"
12 SRC_URI="https://github.com/esheldon/fitsio/archive/v${PV}.tar.gz -> ${P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE=""
18
19 RDEPEND="
20         >=dev-python/numpy-1.11[${PYTHON_USEDEP}]
21         sci-libs/cfitsio:0=
22 "
23 DEPEND="${RDEPEND}
24         dev-python/setuptools[${PYTHON_USEDEP}]
25 "
26
27 PATCHES=( "${FILESDIR}"/${P}-test-failures.patch )
28
29 python_prepare_all() {
30         sed -e '/self.use_system_fitsio/s/False/True/' \
31                 -i setup.py || die
32         distutils-r1_python_prepare_all
33 }
34
35 python_test() {
36         distutils_install_for_testing
37         pushd "${TEST_DIR}"/ || die
38         ${PYTHON} -c "import fitsio; exit(fitsio.test.test())" || die
39         popd > /dev/null || die
40 }