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