# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" PYPI_PN="${PN^}" PYPI_NO_NORMALIZE=1 inherit distutils-r1 pypi DESCRIPTION="Python documentation generator" HOMEPAGE="http://www.sphinx-doc.org/" S="${WORKDIR}/${P^}" LICENSE="BSD" SLOT="python2" KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" IUSE="doc latex net test" # Tests automagically use latex, bug 667414 #REQUIRED_USE="test? ( latex )" RESTRICT="!test? ( test )" RDEPEND=" >=dev-python/alabaster-0.7.9:python2[${PYTHON_USEDEP}] =dev-python/babel-2.1.1:python2[${PYTHON_USEDEP}] >=dev-python/docutils-0.11:python2[${PYTHON_USEDEP}] dev-python/imagesize:python2[${PYTHON_USEDEP}] >=dev-python/jinja2-2.3:python2[${PYTHON_USEDEP}] >=dev-python/pygments-2.0.1-r1:python2[${PYTHON_USEDEP}] >=dev-python/requests-2.0.0:python2[${PYTHON_USEDEP}] >=dev-python/six-1.5:python2[${PYTHON_USEDEP}] >=dev-python/snowballstemmer-1.1:python2[${PYTHON_USEDEP}] >=dev-python/sphinx-rtd-theme-0.1:python2[${PYTHON_USEDEP}] =dev-python/sqlalchemy-0.9:python2[${PYTHON_USEDEP}] >=dev-python/whoosh-2.0:python2[${PYTHON_USEDEP}] ) !/dev/null || die "${EPYTHON}" -m sphinx.pycode.__init__ || die "Grammar generation failed." popd >/dev/null || die } python_compile_all() { if use doc; then esetup.py build_sphinx HTML_DOCS=( "${BUILD_DIR}"/sphinx/html/. ) fi } python_test() { mkdir -p "${BUILD_DIR}/sphinx_tempdir" || die local -x SPHINX_TEST_TEMPDIR="${BUILD_DIR}/sphinx_tempdir" py.test -vv || die "Tests fail with ${EPYTHON}" }