diff mbox series

[bug#60324,2/3] gnu: Add python-pyvisa.

Message ID 20221225225801.829867-2-monego@posteo.net
State New
Headers show
Series Add python-scikit-rf. | expand

Commit Message

Vinicius Monego Dec. 25, 2022, 10:58 p.m. UTC
* gnu/packages/engineering.scm (python-pyvisa): New variable.
---
This package claims to be a Python interface to a library called "VISA" however I couldn't find such library. All the executable code in the repo is Python.

 gnu/packages/engineering.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 28a79d7c5f..26f0db03d7 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -69,6 +69,7 @@  (define-module (gnu packages engineering)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
+  #:use-module (guix build-system pyproject)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt)
   #:use-module (gnu packages)
@@ -2378,6 +2379,39 @@  (define-public lib3mf
     (home-page "https://3mf.io/")
     (license license:bsd-2)))
 
+(define-public python-pyvisa
+  (package
+    (name "python-pyvisa")
+    (version "1.13.0")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "PyVISA" version))
+              (sha256
+               (base32
+                "1iprr3h6d4w6v8ksgqpkgg545sai7i8hi5a5an394p26b25h1yl9"))
+              (modules '((guix build utils)))
+              (snippet '(begin
+                          ;; Delete bundled python-prettytable.
+                          (delete-file-recursively "pyvisa/thirdparty")))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'use-system-prettytable
+                          (lambda _
+                            (substitute* "pyvisa/shell.py"
+                              (("from .thirdparty import prettytable")
+                               "import prettytable")))))))
+    (native-inputs (list python-pytest-7.1))
+    (propagated-inputs (list python-dataclasses python-prettytable
+                             python-typing-extensions))
+    (home-page "https://pyvisa.readthedocs.io/en/latest/")
+    (synopsis "Python binding for the VISA library")
+    (description
+     "PyVISA is a Python package for support of the 'Virtual Instrument
+Software Architecture' (VISA), in order to control measurement devices and
+test equipment via GPIB, RS232, Ethernet or USB.")
+    (license license:expat)))
+
 (define-public openscad
   (package
     (name "openscad")