# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 DISTUTILS_USE_SETUPTOOLS=rdepend PYTHON_COMPAT=( python3_{6..9} pypy3 ) PYTHON_REQ_USE="threads(+)" inherit distutils-r1 DESCRIPTION="Python documentation generator" HOMEPAGE="https://www.sphinx-doc.org/ https://github.com/sphinx-doc/sphinx" SRC_URI="mirror://pypi/S/${PN^}/${P^}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris" IUSE="doc latex test" RESTRICT="!test? ( test )" RDEPEND=" /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" pytest -vv || die "Tests fail with ${EPYTHON}" }