*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / boto / boto-2.41.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python2_7 python3_6 )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Amazon Web Services API"
11 HOMEPAGE="https://github.com/boto/boto https://pypi.org/project/boto/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="MIT"
15 SLOT="0"
16 KEYWORDS="amd64 arm ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
17 IUSE="doc test"
18
19 REQUIRED_USE="doc? ( || ( $(python_gen_useflags 'python2*') ) )"
20
21 DEPEND="
22         dev-python/setuptools[${PYTHON_USEDEP}]
23         test? ( dev-python/nose[${PYTHON_USEDEP}] )
24         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
25
26 # requires Amazon Web Services keys to pass some tests
27 RESTRICT="test"
28
29 pkg_setup() {
30         use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( 'python2*' )
31 }
32
33 python_test() {
34         "${PYTHON}" tests/test.py -v || die "Tests fail with ${EPYTHON}"
35 }
36
37 python_prepare_all() {
38         # Prevent un-needed d'loading
39         sed -e "s/, 'sphinx.ext.intersphinx'//" -i docs/source/conf.py || die
40         distutils-r1_python_prepare_all
41 }
42
43 python_compile_all() {
44         if use doc; then
45                 # Appease the doc build and supply a file for _static
46                 # the usual emake -C docs doesn't work under this authorship
47                 cd docs && mkdir source/_static  || die
48                 emake html
49         fi
50 }
51
52 python_install_all() {
53         use doc && local HTML_DOCS=( docs/build/html/. )
54         distutils-r1_python_install_all
55 }