commit:     dc306a22689901bfac970b637160b9916cd130ea
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  3 13:23:13 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Nov  3 13:30:03 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc306a22

dev-python/gfloat: Add nbval test dep

Closes: https://bugs.gentoo.org/942802
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/gfloat/gfloat-0.4.ebuild | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/dev-python/gfloat/gfloat-0.4.ebuild 
b/dev-python/gfloat/gfloat-0.4.ebuild
index 073c3dceaa00..8fb620eee753 100644
--- a/dev-python/gfloat/gfloat-0.4.ebuild
+++ b/dev-python/gfloat/gfloat-0.4.ebuild
@@ -17,6 +17,7 @@ HOMEPAGE="
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="test-rust"
 
 RDEPEND="
        dev-python/more-itertools[${PYTHON_USEDEP}]
@@ -25,16 +26,28 @@ RDEPEND="
 BDEPEND="
        test? (
                dev-python/ml-dtypes[${PYTHON_USEDEP}]
+               test-rust? (
+                       dev-python/nbval[${PYTHON_USEDEP}]
+               )
        )
 "
 
 distutils_enable_tests pytest
 
-EPYTEST_IGNORE=(
-       # require jax
-       docs/source/03-value-tables.ipynb
-       docs/source/04-benchmark.ipynb
-       test/test_jax.py
-       # requires mx (possibly git version), torch
-       test/test_microxcaling.py
-)
+python_test() {
+       local EPYTEST_IGNORE=(
+               # require jax
+               docs/source/03-value-tables.ipynb
+               docs/source/04-benchmark.ipynb
+               test/test_jax.py
+               # requires mx (possibly git version), torch
+               test/test_microxcaling.py
+       )
+
+       local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+       if has_version "dev-python/nbval[${PYTHON_USEDEP}]"; then
+               epytest -p nbval
+       else
+               epytest -o addopts=
+       fi
+}

Reply via email to