dev-python/webtest: Use distutils_enable_sphinx

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2019-11-25 13:25:27 +01:00
parent c0df39f605
commit a53294c6e4

View 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
}