diff mbox series

[bug#55989,1/2] gnu: Add python-pydicom.

Message ID 20220615012714.1414-1-antero@mailbox.org
State New
Headers show
Series [bug#55989,1/2] gnu: Add python-pydicom. | 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
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

Antero Mejr June 15, 2022, 1:27 a.m. UTC
* gnu/packages/python-science.scm (python-pydicom): New variable.
---
 gnu/packages/python-science.scm | 37 +++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

Comments

M June 15, 2022, 7:59 a.m. UTC | #1
Antero Mejr via Guix-patches via schreef op wo 15-06-2022 om 01:27
[+0000]:
> +      ;; 181 failed, 2235 pass. Pulls test datasets off the web, no-go for Guix
> +      #:tests? #f

How about only disabling tests that download from the web?
Are all of these test failures due to downloading from the web or are
there some other tests too?

> +    (synopsis "Pure Python package for reading and writing DICOM data")

Unlike some language-specific package managers, Guix supports using dependents
from other languages without any complications, so no need to mention ‘Pure’
here.

> + pydicom provides a pure Python package

It doesn't provide a Python package, it is a Python package, especially if pydicom
is replaced by @code{python-pydicom}.

Greetings,
Maxime.
Antero Mejr June 15, 2022, 3:40 p.m. UTC | #2
Maxime Devos <maximedevos@telenet.be> writes:

> How about only disabling tests that download from the web?
> Are all of these test failures due to downloading from the web or are
> there some other tests too?

Sure, see updated patch. I looked through the error log to confirm
that the tests were failing due to missing data. I also did an
end-to-end test of pydicom by importing it, then reading/writing
a DICOM file.

>
>> +    (synopsis "Pure Python package for reading and writing DICOM data")
>
> Unlike some language-specific package managers, Guix supports using dependents
> from other languages without any complications, so no need to mention ‘Pure’
> here.
>

OK, updated.

>> + pydicom provides a pure Python package
>
> It doesn't provide a Python package, it is a Python package, especially if pydicom
> is replaced by @code{python-pydicom}.
>

Updated.
diff mbox series

Patch

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 0684826a6c..08359515d5 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -20,6 +20,7 @@ 
 ;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
 ;;; Copyright © 2022 Wiktor Żelazny <wzelazny@vurv.cz>
 ;;; Copyright © 2022 Eric Bavier <bavier@posteo.net>
+;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,6 +47,7 @@  (define-module (gnu packages python-science)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages image)
   #:use-module (gnu packages image-processing)
   #:use-module (gnu packages machine-learning)
   #:use-module (gnu packages maths)
@@ -1367,3 +1369,38 @@  (define-public python-gpy
 Python, from the Sheffield machine learning group.  GPy implements a range of
 machine learning algorithms based on GPs.")
     (license license:bsd-3)))
+
+(define-public python-pydicom
+  (package
+    (name "python-pydicom")
+    (version "2.3.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/pydicom/pydicom")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "18l26s53yf5j9yh2zwq83n74qq4f2iq0cfblamsw4y9k35l1c108"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      ;; 181 failed, 2235 pass. Pulls test datasets off the web, no-go for Guix
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (chdir "pydicom/tests")
+               (invoke "python3" "-m" "pytest")))))))
+    (native-inputs (list python-pytest))
+    (inputs (list gdcm libjpeg-turbo))
+    (propagated-inputs (list python-numpy python-pillow))
+    (home-page "https://github.com/pydicom/pydicom")
+    (synopsis "Pure Python package for reading and writing DICOM data")
+    (description "pydicom provides a pure Python package for reading and
+writing DICOM medical imaging data. It lets developers read, modify and write
+DICOM data in a pythonic way.")
+    (license license:expat)))