gnu: python-trimesh: Enable tests.

* gnu/packages/python-science.scm (python-trimesh): Enable tests and
apply new package style.
[source]: Use git checkout which has working test suit.
[arguments] <#:test-flags>: Disable tests requiring optional Python
modules.
[propagated-inputs]: Add python-chardet, python-colorlog python-httpx
python-jsonschema python-lxml python-networkx python-pillow
python-requests python-rtree python-scipy python-setuptools
python-shapely python-sympy and python-xxhash.

Change-Id: I1aa363053c2d736bc44b8f9071c637256cc2d952
This commit is contained in:
Sharlatan Hellseher 2024-01-23 11:31:04 +00:00
parent a01afbd300
commit 42c7b50e23
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -50,6 +50,7 @@
#:use-module (gnu packages cpp) #:use-module (gnu packages cpp)
#:use-module (gnu packages crypto) #:use-module (gnu packages crypto)
#:use-module (gnu packages databases) #:use-module (gnu packages databases)
#:use-module (gnu packages digest)
#:use-module (gnu packages gcc) #:use-module (gnu packages gcc)
#:use-module (gnu packages geo) #:use-module (gnu packages geo)
#:use-module (gnu packages image) #:use-module (gnu packages image)
@ -411,28 +412,65 @@ of regular expressions from text data and automatic test generation.")
(version "4.0.10") (version "4.0.10")
(source (source
(origin (origin
(method url-fetch) (method git-fetch) ; no tests in PyPI
(uri (pypi-uri "trimesh" version)) (uri (git-reference
(url "https://github.com/mikedh/trimesh")
(commit version)))
(file-name (git-file-name name version))
(sha256 (sha256
(base32 "1p3cnkajh2zmp6zwn23q3c73jcjlkq61h3r53ys0bmg58l8kpqrn")))) (base32 "0ry04qaw0pb3hkxv4gmna87jwk97aqangd21wbr2dr4xshmkbyyb"))))
(build-system pyproject-build-system) (build-system pyproject-build-system)
(propagated-inputs (arguments
(list python-numpy)) (list
#:test-flags
#~(list "-k" (string-append
;; XXX: When more optional modules are available review
;; disabled tests once again.
;;
;; Disable tests requiring optional, not packed modules.
"not test_material_round"
" and not test_bezier_example"
" and not test_discrete"
" and not test_dxf"
" and not test_layer"
" and not test_multi_nodupe"
" and not test_obj_roundtrip"
" and not test_roundtrip"
" and not test_scene"
" and not test_slice_onplane"
" and not test_svg"
" and not test_svg"))
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-build
(lambda _
(substitute* "trimesh/resources/templates/blender_boolean.py.tmpl"
(("\\$MESH_PRE")
"'$MESH_PRE'")))))))
(native-inputs (native-inputs
(list python-coveralls (list python-coveralls
python-pyinstrument python-pyinstrument
python-pytest python-pytest
python-pytest-cov)) python-pytest-cov))
(arguments (propagated-inputs
`(;; TODO: Get tests to work. (list python-chardet
#:tests? #f python-colorlog
#:phases python-httpx
(modify-phases %standard-phases python-jsonschema
(add-after 'unpack 'fix-build python-lxml
(lambda _ python-networkx
(substitute* "trimesh/resources/templates/blender_boolean.py.tmpl" python-numpy
(("\\$MESH_PRE") python-pillow
"'$MESH_PRE'"))))))) ;; python-pycollada ; not packed yet, optional
;; python-pyglet ; not packed yet, optional
python-requests
python-rtree
python-scipy
python-setuptools
python-shapely
;; python-svg-path ; not packed yet, optional
python-sympy
python-xxhash))
(home-page "https://github.com/mikedh/trimesh") (home-page "https://github.com/mikedh/trimesh")
(synopsis "Python library for loading and using triangular meshes") (synopsis "Python library for loading and using triangular meshes")
(description (description