diff mbox series

[bug#55060,6/6] gnu: Add python-pyvista.

Message ID 20220422010244.23280-6-paul@apatience.com
State Accepted
Headers show
Series [bug#55060,1/6] gnu: python-meshio: Remove input labels. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Paul A. Patience April 22, 2022, 1:03 a.m. UTC
* gnu/packages/python-science.scm (python-pyvista): New variable.
---
 gnu/packages/python-science.scm | 56 +++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

--
2.35.1

Comments

M April 22, 2022, 6:04 p.m. UTC | #1
Paul A. Patience schreef op vr 22-04-2022 om 01:03 [+0000]:
> +         ;; Disable tests for now because they require several modules
> +         ;; currently unpackaged in Guix.
> +         (delete 'check)
> +         ;; Disable the sanity check, which fails with the following error:
> +         ;;
> +         ;;   ...checking requirements: ERROR: pyvista==0.34.0 DistributionNotFound(Requirement.parse('vtk'), {'pyvista'})
> +         ;;
> +         ;; Probably it cannot find VTK because it isn't a Python library.

vtk is (among other things) a Python library, try building vtk and
looking into lib/python3.9/site-packages/vtk.py.

As such, shouldn't 'vtk' be in propagated-inputs, such that when
dependents use 'python-pyvista', the vtk libraries will actually be
found?

Greetings,
Maxime
Paul A. Patience April 22, 2022, 7:36 p.m. UTC | #2
On 2022-04-22 14:04:03-04:00, Maxime Devos wrote:
> Paul A. Patience schreef op vr 22-04-2022 om 01:03 [+0000]:
>> +         ;; Disable tests for now because they require several modules
>> +         ;; currently unpackaged in Guix.
>> +         (delete 'check)
>> +         ;; Disable the sanity check, which fails with the following error:
>> +         ;;
>> +         ;;   ...checking requirements: ERROR: pyvista==0.34.0 DistributionNotFound(Requirement.parse('vtk'), {'pyvista'})
>> +         ;;
>> +         ;; Probably it cannot find VTK because it isn't a Python library.
>
> vtk is (among other things) a Python library, try building vtk and
> looking into lib/python3.9/site-packages/vtk.py.

vtk.py is indeed there.
Also, I am able to "import vtk" in a Python repl.
I'm not sure why the sanity check cannot find vtk.py, then.
This sanity check issue also plagues the python-vedo package, and I
don't know how to fix it.
(However, obviously the last line of the comment is incorrect.)

> As such, shouldn't 'vtk' be in propagated-inputs, such that when
> dependents use 'python-pyvista', the vtk libraries will actually be
> found?

I fixed this in the v2 series.

Best regards,
Paul
M April 22, 2022, 9:49 p.m. UTC | #3
Paul A. Patience schreef op vr 22-04-2022 om 19:36 [+0000]:
> vtk.py is indeed there.
> Also, I am able to "import vtk" in a Python repl.
> I'm not sure why the sanity check cannot find vtk.py, then.
> This sanity check issue also plagues the python-vedo package, and I
> don't know how to fix it.
> (However, obviously the last line of the comment is incorrect.)

A guess: maybe whatever 'sanity-check' indirectly uses, expects the
dependencies to have an 'egg-info', which appears to be the case for
(most?) python-build-system packages, but not for whatever vtk does.

Greetings,
Maxime
diff mbox series

Patch

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 07d713e013..d114a1c12f 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -1183,3 +1183,59 @@  (define-public python-numpy-groupies
      "This package provides optimized tools for group-indexing operations:
 aggregated sum and more.")
     (license license:bsd-3)))
+
+(define-public python-pyvista
+  (package
+    (name "python-pyvista")
+    (version "0.34.0")
+    (source
+     ;; The PyPI tarball does not contain the tests.
+     ;; (However, we don't yet actually run the tests.)
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/pyvista/pyvista")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0f2x2wvi5pkpv5h3jrnx8zxnaj51navfqp2fdna1l9rpjgjjf94g"))))
+    (build-system python-build-system)
+    (inputs
+     (list vtk))
+    (propagated-inputs
+     (list python-appdirs
+           python-imageio
+           python-matplotlib
+           python-meshio
+           python-numpy
+           python-pillow
+           python-scooby))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Disable tests for now because they require several modules
+         ;; currently unpackaged in Guix.
+         (delete 'check)
+         ;; Disable the sanity check, which fails with the following error:
+         ;;
+         ;;   ...checking requirements: ERROR: pyvista==0.34.0 DistributionNotFound(Requirement.parse('vtk'), {'pyvista'})
+         ;;
+         ;; Probably it cannot find VTK because it isn't a Python library.
+         (delete 'sanity-check))))
+    (home-page "https://docs.pyvista.org/")
+    (synopsis "3D plotting and mesh analysis through VTK")
+    (description
+     "PyVista is...
+
+@itemize
+@item @emph{Pythonic VTK}: a high-level API to the Visualization Toolkit (VTK)
+@item mesh data structures and filtering methods for spatial datasets
+@item 3D plotting made simple and built for large/complex data geometries
+@end itemize
+
+PyVista is a helper module for the Visualization Toolkit (VTK) that wraps the
+VTK library through NumPy and direct array access through a variety of methods
+and classes.  This package provides a Pythonic, well-documented interface
+exposing VTK's powerful visualization backend to facilitate rapid prototyping,
+analysis, and visual integration of spatially referenced datasets.")
+    (license (list license:expat))))