*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / click / click-6.7-r1.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} pypy3 )
7
8 inherit distutils-r1
9
10 DESCRIPTION="A Python package for creating beautiful command line interfaces"
11 SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
12 HOMEPAGE="https://palletsprojects.com/p/click/ https://pypi.org/project/click/"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
17 IUSE="doc examples test"
18 RESTRICT="!test? ( test )"
19
20 REQUIRED_USE="doc? ( || ( $(python_gen_useflags 'python2*') ) )"
21
22 DEPEND="
23         dev-python/setuptools[${PYTHON_USEDEP}]
24         test? ( dev-python/pytest[${PYTHON_USEDEP}] )
25         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
26
27 PATCHES=(
28         # From upstream, can be removed in next release.
29         "${FILESDIR}/${PN}-6.7-fix-tests.patch"
30         # From upstream, can be removed in next release.
31         "${FILESDIR}/${PN}-6.7-support-sphinx-1.7.patch"
32 )
33
34 pkg_setup() {
35         use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( 'python2*' )
36 }
37
38 python_prepare_all() {
39         # Prevent un-needed d'loading
40         sed -e "s/, 'sphinx.ext.intersphinx'//" -i docs/conf.py || die
41         distutils-r1_python_prepare_all
42 }
43
44 python_compile_all() {
45         use doc && emake -C docs html
46 }
47
48 python_test() {
49         emake test
50 }
51
52 python_install_all() {
53         use doc && local HTML_DOCS=( docs/_build/html/. )
54         use examples && dodoc -r examples
55         distutils-r1_python_install_all
56 }