commit: 748694d00ff85b1b05b545fd46d29e9eaa55483f Author: Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de> AuthorDate: Sat Sep 5 13:17:55 2015 +0000 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org> CommitDate: Sat Sep 5 13:17:55 2015 +0000 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=748694d0
dev-python/testpath: Add test and doc use flag Package-Manager: portage-2.2.20.1 dev-python/testpath/ChangeLog | 3 +++ dev-python/testpath/testpath-9999.ebuild | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/dev-python/testpath/ChangeLog b/dev-python/testpath/ChangeLog index ca3f481..4d8f730 100644 --- a/dev-python/testpath/ChangeLog +++ b/dev-python/testpath/ChangeLog @@ -2,6 +2,9 @@ # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 # $Id$ + 05 Sep 2015; Marius Brehler <mar...@linux.sungazer.de> testpath-9999.ebuild: + dev-python/testpath: Add test and doc use flag + *testpath-0.2 (12 Aug 2015) *testpath-9999 (12 Aug 2015) diff --git a/dev-python/testpath/testpath-9999.ebuild b/dev-python/testpath/testpath-9999.ebuild index 2fcac43..7253698 100644 --- a/dev-python/testpath/testpath-9999.ebuild +++ b/dev-python/testpath/testpath-9999.ebuild @@ -20,7 +20,41 @@ fi LICENSE="BSD" SLOT="0" +IUSE="doc test" + +DEPEND=" + test? ( + dev-python/pathlib[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + ) + doc? ( dev-python/sphinx[${PYTHON_USEDEP}] ) + " PATCHES=( "${FILESDIR}/${P}"-setup.py.patch ) + +python_prepare_all() { + # Prevent un-needed download during build + if use doc; then + sed -e "/^ 'sphinx.ext.intersphinx',/d" -i doc/conf.py || die + fi + +distutils-r1_python_prepare_all +} + +python_compile_all() { + use doc && emake -C doc html +} + +python_install_all() { + use doc && HTML_DOCS=( doc/_build/html/. ) + distutils-r1_python_install_all + } + +python_test() { + distutils_install_for_testing + cd "${TEST_DIR}"/lib || die + cp -r "${S}"/tests "${TEST_DIR}"/lib/ || die + py.test || die +}