1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{6,7} pypy3 )
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/"
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 )"
20 REQUIRED_USE="doc? ( || ( $(python_gen_useflags 'python2*') ) )"
23 dev-python/setuptools[${PYTHON_USEDEP}]
24 test? ( dev-python/pytest[${PYTHON_USEDEP}] )
25 doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
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"
35 use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( 'python2*' )
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
44 python_compile_all() {
45 use doc && emake -C docs html
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