dev-python/webtest: Use distutils_enable_sphinx
authorMichał Górny <mgorny@gentoo.org>
Mon, 25 Nov 2019 12:25:27 +0000 (13:25 +0100)
committerMichał Górny <mgorny@gentoo.org>
Mon, 25 Nov 2019 12:35:21 +0000 (13:35 +0100)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/webtest/webtest-2.0.33.ebuild

index 192dfb7318f4320cea50bbf4e6498c7bc0f38c4e..c9df5a13b440395f0081fe01b94ca7af7294ad0b 100644 (file)
@@ -13,11 +13,13 @@ MY_P="${MY_PN}-${PV}"
 DESCRIPTION="Helper to test WSGI applications"
 HOMEPAGE="https://pypi.org/project/WebTest/"
 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
 
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc64 ~s390 ~sh ~sparc ~x86"
-IUSE="doc test"
+IUSE="test"
+RESTRICT="!test? ( test )"
 
 # nose<1.3.0 appears a leftover never updated in requires.txt. tests pass fine with latest
 RDEPEND="
@@ -28,10 +30,6 @@ RDEPEND="
 DEPEND="${RDEPEND}
        app-arch/unzip
        dev-python/setuptools[${PYTHON_USEDEP}]
-       doc? ( $(python_gen_any_dep '
-                       dev-python/sphinx[${PYTHON_USEDEP}]
-               ')
-       )
        test? ( dev-python/nose[${PYTHON_USEDEP}]
                dev-python/pyquery[${PYTHON_USEDEP}]
                dev-python/pastedeploy[${PYTHON_USEDEP}]
@@ -40,31 +38,11 @@ DEPEND="${RDEPEND}
                $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 )
        )"
 
-S="${WORKDIR}/${MY_P}"
-
-RESTRICT="!test? ( test )"
-
 PATCHES=(
        "${FILESDIR}/webtest-2.0.33-no-pylons-theme.patch"
 )
 
-python_check_deps() {
-       use doc || return 0
-       has_version "dev-python/sphinx[${PYTHON_USEDEP}]"
-}
-
-python_prepare_all() {
-       # Prevent un-needed d'loading during doc build
-       sed -i -e 's:^intersphinx_mapping:disabled_&: ; s:^templates_path:#&:' \
-               docs/conf.py || die
-       distutils-r1_python_prepare_all
-}
-
-python_compile_all() {
-       if use doc; then
-               sphinx-build docs html || die
-       fi
-}
+distutils_enable_sphinx docs
 
 python_test() {
        distutils_install_for_testing
@@ -72,8 +50,3 @@ python_test() {
        local -x PYTHONPATH=
        nosetests -v || die "Tests fail with ${EPYTHON}"
 }
-
-python_install_all() {
-       use doc && local HTML_DOCS=( html/. )
-       distutils-r1_python_install_all
-}