*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / xlwt / xlwt-1.3.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{6,7} )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Python library to create spreadsheet files compatible with Excel"
11 HOMEPAGE="https://pypi.org/project/xlwt/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="doc examples test"
18 RESTRICT="!test? ( test )"
19
20 DEPEND="
21         dev-python/setuptools[${PYTHON_USEDEP}]
22         doc? (
23                 >=dev-python/sphinx-1.3.1[${PYTHON_USEDEP}]
24                 dev-python/pkginfo[${PYTHON_USEDEP}]
25         )
26         test? ( dev-python/nose[${PYTHON_USEDEP}] )"
27
28 # Prevent d'loading in the doc build
29 PATCHES=( "${FILESDIR}/${PN}-1.3.0-no-intersphinx.patch" )
30
31 python_prepare_all() {
32         # Don't install documentation and examples in site-packages directories.
33         sed -e "/package_data/d" -i setup.py || die
34
35         distutils-r1_python_prepare_all
36 }
37
38 python_compile_all() {
39         use doc && emake -C docs html
40 }
41
42 python_test() {
43         nosetests tests || die "tests failed under ${EPYTHON}}"
44 }
45
46 python_install_all() {
47         use doc && local HTML_DOCS=( docs/_build/html/. )
48         if use examples; then
49                 dodoc -r examples
50                 docompress -x /usr/share/doc/${PF}
51         fi
52         distutils-r1_python_install_all
53 }