dev-python/backports-unittest-mock: Use distutils_enable_sphinx
authorMichał Górny <mgorny@gentoo.org>
Mon, 25 Nov 2019 12:24:44 +0000 (13:24 +0100)
committerMichał Górny <mgorny@gentoo.org>
Mon, 25 Nov 2019 12:35:01 +0000 (13:35 +0100)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/backports-unittest-mock/backports-unittest-mock-1.5-r1.ebuild

index b69e44f57ae255ec0ca9ef8aec36b6d47ac9b195..cd052cc5e1bcfb29dc744a668f72fc14b823c9d7 100644 (file)
@@ -18,7 +18,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-IUSE="doc test"
+IUSE="test"
 
 RDEPEND="
        dev-python/backports[${PYTHON_USEDEP}]
@@ -26,12 +26,6 @@ RDEPEND="
 "
 BDEPEND="
        dev-python/setuptools[${PYTHON_USEDEP}]
-       doc? ( $(python_gen_any_dep '
-                       >=dev-python/jaraco-packaging-3.2[${PYTHON_USEDEP}]
-                       >=dev-python/rst-linker-1.9[${PYTHON_USEDEP}]
-                       >=dev-python/sphinx-1.5.2[${PYTHON_USEDEP}]
-               ')
-       )
        test? (
                ${RDEPEND}
                >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
@@ -42,12 +36,9 @@ S="${WORKDIR}/${MY_PN}-${PV}"
 
 RESTRICT="!test? ( test )"
 
-python_check_deps() {
-       use doc || return 0
-       has_version ">=dev-python/jaraco-packaging-3.2[${PYTHON_USEDEP}]" && \
-               has_version ">=dev-python/rst-linker-1.9[${PYTHON_USEDEP}]" && \
-               has_version ">=dev-python/sphinx-1.5.2[${PYTHON_USEDEP}]"
-}
+distutils_enable_sphinx docs \
+       '>=dev-python/jaraco-packaging-3.2' \
+       '>=dev-python/rst-linker-1.9'
 
 python_prepare_all() {
        # avoid a setuptools_scm dependency
@@ -58,14 +49,6 @@ python_prepare_all() {
        distutils-r1_python_prepare_all
 }
 
-python_compile_all() {
-       if use doc; then
-               cd docs || die
-               sphinx-build . _build/html || die
-               HTML_DOCS=( docs/_build/html/. )
-       fi
-}
-
 python_test() {
        # Override pytest options to skip flake8
        pytest -vv --override-ini="addopts=--doctest-modules" \