aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Brehler <marbre@linux.sungazer.de>2015-09-05 15:17:55 +0200
committerMarius Brehler <marbre@linux.sungazer.de>2015-09-05 15:17:55 +0200
commit748694d00ff85b1b05b545fd46d29e9eaa55483f (patch)
treed4765fa3920677567922cb1b86c820ce22c1cf92 /dev-python
parentdev-python/nbconvert: Add deps for doc, fixes bug #559594 (diff)
downloadsci-748694d00ff85b1b05b545fd46d29e9eaa55483f.tar.gz
sci-748694d00ff85b1b05b545fd46d29e9eaa55483f.tar.bz2
sci-748694d00ff85b1b05b545fd46d29e9eaa55483f.zip
dev-python/testpath: Add test and doc use flag
Package-Manager: portage-2.2.20.1
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/testpath/ChangeLog3
-rw-r--r--dev-python/testpath/testpath-9999.ebuild34
2 files changed, 37 insertions, 0 deletions
diff --git a/dev-python/testpath/ChangeLog b/dev-python/testpath/ChangeLog
index ca3f48120..4d8f730e6 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 <marbre@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 2fcac43ac..7253698b5 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
+}