*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / sci-astronomy / pyephem / pyephem-3.7.6.0-r1.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=( python3_6 )
7 inherit distutils-r1
8
9 DESCRIPTION="Astronomical routines for the python programming language"
10 HOMEPAGE="https://rhodesmill.org/pyephem/"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="LGPL-3"
14 SLOT="0"
15 KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
16 IUSE="doc test"
17
18 DEPEND="doc? ( dev-python/sphinx )"
19 RDEPEND=""
20
21 RESTRICT="!test? ( test )"
22
23 src_prepare() {
24         # don't install rst files by dfefault
25         sed -i -e "s:'doc/\*\.rst',::" setup.py || die
26         distutils-r1_src_prepare
27 }
28
29 src_compile() {
30         distutils-r1_src_compile
31         if use doc; then
32                 PYTHONPATH=. emake -C ephem/doc html
33         fi
34 }
35
36 python_test() {
37         PYTHONPATH="$(ls -d ${BUILD_DIR}/lib*)" unit2 discover -s ephem
38 }
39
40 src_install() {
41         use doc && HTML_DOCS=( ephem/doc/_build/html/. )
42         distutils-r1_src_install
43
44         delete_tests() {
45                 rm -r "${D}$(python_get_sitedir)/ephem/tests" || die
46         }
47         python_foreach_impl delete_tests
48 }