commit:     5c8626d61a59319a1311936d997946fe98798ac5
Author:     Henri Gasc <gasc <AT> eurecom <DOT> fr>
AuthorDate: Sun Mar 12 12:00:23 2023 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Sun Mar 12 17:37:47 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5c8626d6

dev-python/pyrr: unkeyword 0.10.3 for ~x86, allow tests and doc

Closes: https://bugs.gentoo.org/893460
Signed-off-by: Henri Gasc <gasc <AT> eurecom.fr>

 dev-python/pyrr/pyrr-0.10.3.ebuild | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/dev-python/pyrr/pyrr-0.10.3.ebuild 
b/dev-python/pyrr/pyrr-0.10.3.ebuild
index 574118c51..038b8a499 100644
--- a/dev-python/pyrr/pyrr-0.10.3.ebuild
+++ b/dev-python/pyrr/pyrr-0.10.3.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_COMPAT=( python3_{9..11} )
 
 inherit distutils-r1
 
@@ -15,32 +15,39 @@ S="${WORKDIR}/Pyrr-${PV}"
 
 LICENSE="MIT"
 SLOT="0"
-KEYWORDS="~amd64 ~x86"
+KEYWORDS="~amd64"
+IUSE="doc"
 
-RDEPEND=""
 BDEPEND="
        dev-python/multipledispatch[${PYTHON_USEDEP}]
        dev-python/numpy[${PYTHON_USEDEP}]
-       dev-python/setuptools[${PYTHON_USEDEP}]
-       dev-python/wheel[${PYTHON_USEDEP}]
-       dev-python/sphinx[${PYTHON_USEDEP}]
+       doc? (
+               dev-python/sphinx[${PYTHON_USEDEP}]
+       )
 "
 DEPEND="${BDEPEND}"
 
 python_compile() {
        distutils-r1_python_compile
-       find ./ -type f -exec sed -i 
's/sphinx.ext.pngmath/sphinx.ext.imgmath/g' {} \;
-       emake man -C docs
+       if use doc; then
+               find "${S}/docs" -type f -exec sed -i 
's/sphinx\.ext\.pngmath/sphinx\.ext\.imgmath/g' {} \;
+               emake man -C docs
+       fi
 }
 
 python_install() {
        distutils-r1_python_install
-       doman "${S}/docs/build/man/pyrr.1"
+       use doc && doman "${S}/docs/build/man/pyrr.1"
 }
 
-# The tests failed with `module 'numpy' has no attribute 'float'`
-# distutils_enable_tests pytest
-# python_test() {
-#     cd "${T}" || die
-#     epytest "${S}"/tests || die "Tests failed with ${EPYTHON}"
-# }
+distutils_enable_tests pytest
+python_test() {
+       local 
EPYTEST_DESELECT="tests/test_matrix44.py::test_matrix44::test_create_perspective_projection_matrix_dtype"
+       find "${S}/tests" -iname "*.py" -exec sed -i \
+               -e 's/np\.float/float/g' \
+               -e 's/float32/np\.float32/g' \
+               -e 's/np\.int/int/g' \
+               -e 's/int16/np\.int16/g' \
+               {} \;
+       epytest "${S}/tests" || die "Tests failed with ${EPYTHON}"
+}

Reply via email to