dev-python/ipython: Stop polluting sys.path with extensions/tests

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2021-04-06 18:01:03 +02:00
parent 3e067130de
commit 0b7a57be43
2 changed files with 18 additions and 24 deletions

View File

@@ -19,7 +19,7 @@ KEYWORDS="amd64 ~arm arm64 ~ppc ppc64 x86 ~amd64-linux ~x86-linux"
IUSE="doc examples matplotlib notebook nbconvert qt5 +smp test"
RESTRICT="!test? ( test )"
CDEPEND="
RDEPEND="
dev-python/backcall[${PYTHON_USEDEP}]
dev-python/decorator[${PYTHON_USEDEP}]
>=dev-python/jedi-0.16[${PYTHON_USEDEP}]
@@ -32,12 +32,8 @@ CDEPEND="
matplotlib? ( dev-python/matplotlib[${PYTHON_USEDEP}] )
"
RDEPEND="${CDEPEND}
nbconvert? ( dev-python/nbconvert[${PYTHON_USEDEP}] )"
BDEPEND="
test? (
${CDEPEND}
app-text/dvipng[truetype]
>=dev-python/ipykernel-5.1.0[${PYTHON_USEDEP}]
dev-python/nbformat[${PYTHON_USEDEP}]
@@ -53,6 +49,10 @@ BDEPEND="
dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
)"
distutils_enable_tests pytest
RDEPEND+="
nbconvert? ( dev-python/nbconvert[${PYTHON_USEDEP}] )"
PDEPEND="
notebook? (
dev-python/notebook[${PYTHON_USEDEP}]
@@ -79,6 +79,10 @@ python_prepare_all() {
sed -e "/^ 'sphinx.ext.intersphinx',/d" -i docs/source/conf.py || die
fi
# Rename the test directory to reduce sys.path pollution
# https://github.com/ipython/ipython/issues/12892
mv IPython/extensions/{,ipython_}tests || die
distutils-r1_python_prepare_all
}
@@ -93,13 +97,6 @@ src_test() {
virtx distutils-r1_src_test
}
python_test() {
distutils_install_for_testing
pushd "${TEST_DIR}" >/dev/null || die
"${TEST_DIR}"/scripts/iptest || die
popd >/dev/null || die
}
python_install() {
distutils-r1_python_install

View File

@@ -19,7 +19,7 @@ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
IUSE="doc examples matplotlib notebook nbconvert qt5 +smp test"
RESTRICT="!test? ( test )"
CDEPEND="
RDEPEND="
dev-python/backcall[${PYTHON_USEDEP}]
dev-python/decorator[${PYTHON_USEDEP}]
>=dev-python/jedi-0.16[${PYTHON_USEDEP}]
@@ -32,12 +32,8 @@ CDEPEND="
matplotlib? ( dev-python/matplotlib[${PYTHON_USEDEP}] )
"
RDEPEND="${CDEPEND}
nbconvert? ( dev-python/nbconvert[${PYTHON_USEDEP}] )"
BDEPEND="
test? (
${CDEPEND}
app-text/dvipng[truetype]
>=dev-python/ipykernel-5.1.0[${PYTHON_USEDEP}]
dev-python/nbformat[${PYTHON_USEDEP}]
@@ -53,6 +49,10 @@ BDEPEND="
dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
)"
distutils_enable_tests pytest
RDEPEND+="
nbconvert? ( dev-python/nbconvert[${PYTHON_USEDEP}] )"
PDEPEND="
notebook? (
dev-python/notebook[${PYTHON_USEDEP}]
@@ -79,6 +79,10 @@ python_prepare_all() {
sed -e "/^ 'sphinx.ext.intersphinx',/d" -i docs/source/conf.py || die
fi
# Rename the test directory to reduce sys.path pollution
# https://github.com/ipython/ipython/issues/12892
mv IPython/extensions/{,ipython_}tests || die
distutils-r1_python_prepare_all
}
@@ -93,13 +97,6 @@ src_test() {
virtx distutils-r1_src_test
}
python_test() {
distutils_install_for_testing
pushd "${TEST_DIR}" >/dev/null || die
"${TEST_DIR}"/scripts/iptest || die
popd >/dev/null || die
}
python_install() {
distutils-r1_python_install