Subject: Re: Rebase it for the new python packages

From: Vivien <[email-masked]>
Date: Sun, 06 Feb 2022 15:49:44 +0100

Hello, thank you for your review!

Le jeudi 03 février 2022 à 20:49 +0000, Vinicius Monego a écrit :
> To avoid future merge conflicts, please move the packages somewhere
> in
> the middle of the files instead of the bottom.

OK.

> As a rule of thumb for Python packages with tests in Pytest, the
> check
> phase is overriden and Pytest is called manually. When the tests are
> in
> a subfolder inside the module, add a --pyargs <package> parameter to
> the pytest command, see e.g. the python-cartopy package. I could run
> the python-nibabel tests with this change without having to delete
> anything.

OK.

> If the tests still can't run because of missing data, it's fine to
> source from the upstream repository instead of PyPI, or skip the few
> tests that need them or at all if the repository doesn't ship a
> setup.py. If tests are to be disabled, they should also have a
> comment
> with the reason.

For MNE, the test data set is a separate repository without a license,
so I disabled the tests.

> The 'test-less' packages shouldn't be needed AFAICS. Tests should run
> by overriding the check phase as stated above (untested).

The test-less packages are part of a dependency cycle; decopatch
requires them for the tests to run, and they require decopatch or each
other too. If I disable all tests (pytest-* and decopatch) it would
work, but I’m not sure I should do that.

> I also have a few comments about the patches in general:
> 
> > +    (source (origin
> > +              (method url-fetch)
> > +              (uri (pypi-uri "imageio-ffmpeg" version))
> > +              (sha256
> > +               (base32
> > +               
> > "0ff14079izsyxwf6ki68k9a7w5krjlal7lwqvzg2bbddl92l5spj"))))
> 
> Could you style it as
> 
>     (source
>      (origin
>        (method url-fetch)
>        (uri (pypi-uri "imageio-ffmpeg" version))
>        (sha256
>         (base32
> "0ff14079izsyxwf6ki68k9a7w5krjlal7lwqvzg2bbddl92l5spj"))))
> 
> and the other packages too?

OK.

> Gexps should only be used when ungexp (#$) is used. On many patches
> (e.g. python-nitime) ungexp is not being used.

OK, I upgraded python-pooch again and it needs gexps too now.

> 
> When using gexp, it's better to style the arguments as:
> 
> +    (arguments
> +     (list
> +       #:phases
> +       #~(modify-phases %standard-phases
> 
> to save columns (some of the packages exceeded the 78 columns limit),
> instead of
> 
> > +    (arguments
> > +     (list #:phases
> > +           #~(modify-phases %standard-phases
> > 

OK.

> .
> 
> Some of the descriptions are not full sentences (e.g. in python-
> pytest-
> harvest-minimal). Please check that descriptions are full sentences.

I’m not sure I understand. I reworked some descriptions, but didn’t
find non-full sentences. Could you explain what you mean?

> When sending an updated series, use patch versions with --reroll-
> count=4 or -v4.

I didn’t know that option.

> Could you send a v4 with the requested changes?

Sure!

Best regards,

Vivien
From d18443abeb280a554413cd6025f10a0dc886bb8d Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 15:39:12 +0100
Subject: [PATCH v4 01/18] gnu: Add python-imageio-ffmpeg.

* gnu/packages/python-xyz.scm (python-imageio-ffmpeg): New variable.
---
 gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7c1b5e8ed3..f4b8ed67a2 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25433,6 +25433,42 @@ (define-public python-json5
 dumping of JSON5 data structures.")
     (license license:asl2.0)))
 
+(define-public python-imageio-ffmpeg
+  (package
+    (name "python-imageio-ffmpeg")
+    (version "0.4.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "imageio-ffmpeg" version))
+       (sha256
+        (base32
+         "0ff14079izsyxwf6ki68k9a7w5krjlal7lwqvzg2bbddl92l5spj"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'set-ffmpeg-exe
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; There are different strategies to find ffmpeg, we
+             ;; only fix the last resort, "system ffmpeg command"
+             (substitute* "imageio_ffmpeg/_utils.py"
+               (("exe = \"ffmpeg\"")
+                (format #f "exe = ~s"
+                        (search-input-file
+                         inputs "/bin/ffmpeg")))))))))
+    (inputs (list ffmpeg))
+    (home-page "https://github.com/imageio/imageio-ffmpeg")
+    (synopsis "@samp{ffmpeg} wrapper for Python")
+    (description
+     "The purpose of this project is to provide a simple and reliable
+@samp{ffmpeg} wrapper for working with video files.  It implements two simple
+generator functions for reading and writing data from/to ffmpeg, which
+reliably terminate the ffmpeg process when done.  It also takes care of
+publishing platform-specific wheels that include the binary @samp{ffmpeg}
+executables.")
+    (license license:bsd-2)))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")

base-commit: 7c9ad54b0616112c7eea6dd02379616aef206490
-- 
2.34.0

From 3f264d68d2d9e71adfb4eb2da55b5fff72e11ca8 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 15:47:30 +0100
Subject: [PATCH v4 02/18] gnu: Add python-edflib.

* gnu/packages/python-science.scm (python-edflib): New variable.
---
 gnu/packages/python-science.scm | 64 ++++++++++++++++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 8df311baea..09de2da78a 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -61,7 +61,8 @@ (define-module (gnu packages python-science)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
-  #:use-module (guix build-system python))
+  #:use-module (guix build-system python)
+  #:use-module (guix gexp))
 
 (define-public python-scipy
   (package
@@ -1017,3 +1018,64 @@ (define-public python-modin
 libraries, Modin provides seamless integration and compatibility with existing
 pandas code.")
     (license license:asl2.0)))
+
+(define-public python-edflib
+  (package
+    (name "python-edflib")
+    (version "1.0.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gitlab.com/Teuniz/EDFlib-Python.git")
+             (commit "417fc8cc7c47a9b0e39189b34de1fc50be65b72d")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0h3v5kb4yn1ahb7gxb8qrh1m50w1ykb4px4yvvq64kbckn0qrd22"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-tests
+            (lambda _
+              (substitute* "tests/edf_unit_test.py"
+                (("from edfreader") "from EDFlib.edfreader")
+                (("from edfwriter") "from EDFlib.edfwriter"))))
+          ;; XXX: PEP 517 manual build copied from python-isort.
+          (replace 'build
+            (lambda _
+              (setenv "SOURCE_DATE_EPOCH" "315532800")
+              (invoke "python"
+                      "-m"
+                      "build"
+                      "--wheel"
+                      "--no-isolation"
+                      ".")))
+          (replace 'install
+            (lambda _
+              (let ((whl (car (find-files "dist" "\\.whl$"))))
+                (invoke "pip"
+                        "--no-cache-dir"
+                        "--no-input"
+                        "install"
+                        "--no-deps"
+                        "--prefix"
+                        #$output
+                        whl))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke "python" "tests/edf_unit_test.py")))))))
+    (propagated-inputs (list python-numpy python-pypa-build))
+    (home-page "https://www.teuniz.net/edflib_python/")
+    (synopsis "Read and write EDF+/BDF+ files")
+    (description
+     "EDFlib for Python is a programming library to read and write EDF+ and
+BDF+ files.  It also reads old-type EDF/BDF files.  @dfn{EDF} means
+@url{https://www.teuniz.net/edfbrowser/edf%20format%20description.html,
+European Data Format}.  @dfn{BDF} is the
+@url{https://www.teuniz.net/edfbrowser/bdfplus%20format%20description.html,
+24-bit version} of EDF.")
+    (license license:bsd-3)))
-- 
2.34.0

From 5ee84ba74cc1dd7b3ad084639dad02efa500f0c4 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 17:17:11 +0100
Subject: [PATCH v4 03/18] gnu: Add python-eeglabio.

* gnu/packages/python-science.scm (python-eeglabio): New variable.
---
 gnu/packages/python-science.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 09de2da78a..b399a96ead 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -1079,3 +1079,32 @@ (define-public python-edflib
 @url{https://www.teuniz.net/edfbrowser/bdfplus%20format%20description.html,
 24-bit version} of EDF.")
     (license license:bsd-3)))
+
+(define-public python-eeglabio
+  (package
+    (name "python-eeglabio")
+    (version "0.0.1.post6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "eeglabio" version))
+       (sha256
+        (base32
+         "0k70s8lg9b9mcs883kq8jgnj9wmxvb96q54w23f3zw38jjxw46gs"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'restore-requirements.txt
+           (lambda _
+             ;; requirements.txt is not distributed, but it is in the source
+             (call-with-output-file "requirements.txt"
+               (lambda (port)
+                 (format port "numpy
+scipy
+"))))))))
+    (propagated-inputs (list python-numpy python-scipy))
+    (home-page "https://github.com/jackz314/eeglabio")
+    (synopsis "I/O support for EEGLAB files in Python")
+    (description "I/O support for EEGLAB files in Python.")
+    (license license:bsd-3)))
-- 
2.34.0

From 3f4bf1b10ba79748d5969ebac7e19a5ad20b9165 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 17:38:47 +0100
Subject: [PATCH v4 04/18] gnu: Add python-nibabel.

* gnu/packages/python-science.scm (python-nibabel): New variable.
---
 gnu/packages/python-science.scm | 51 +++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index b399a96ead..ad3fdd17fd 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -54,6 +54,7 @@ (define-module (gnu packages python-science)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages statistics)
   #:use-module (gnu packages time)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -1108,3 +1109,53 @@ (define-public python-eeglabio
     (synopsis "I/O support for EEGLAB files in Python")
     (description "I/O support for EEGLAB files in Python.")
     (license license:bsd-3)))
+
+(define-public python-nibabel
+  (package
+    (name "python-nibabel")
+    (version "3.2.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "nibabel" version))
+       (sha256
+        (base32
+         "17n23w7y0hiz2vma5si7wy184d59bp14zd8nr6hi203ldd1gjbsd"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "python" "-m" "pytest" "--pyargs" "nibabel")))))))
+    (propagated-inputs (list python-numpy python-packaging))
+    (native-inputs (list python-coverage
+                         python-gitpython
+                         python-pytest
+                         python-pytest-cov
+                         python-pytest-doctestplus
+                         python-twine))
+    (home-page "https://nipy.org/nibabel/")
+    (synopsis "Access a multitude of neuroimaging data formats")
+    (description
+     "This package provides read +/- write access to some common
+medical and neuroimaging file formats, including:
+@url{http://www.grahamwideman.com/gw/brain/analyze/formatdoc.htm,
+ANALYZE} (plain, SPM99, SPM2 and later),
+@url{https://www.nitrc.org/projects/gifti, GIFTI},
+@url{http://nifti.nimh.nih.gov/nifti-1/, NIfTI1},
+@url{http://nifti.nimh.nih.gov/nifti-2/, NIfTI2},
+@url{https://www.nitrc.org/projects/cifti/, CIFTI-2},
+@url{https://en.wikibooks.org/wiki/MINC/Reference/MINC1_File_Format_Reference,
+MINC1},
+@url{https://en.wikibooks.org/wiki/MINC/Reference/MINC2.0_File_Format_Reference,
+MINC2}, @url{https://afni.nimh.nih.gov/pub/dist/src/README.attributes, AFNI
+BRIK/HEAD},
+@url{https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MghFormat, MGH} and
+@url{http://xmedcon.sourceforge.net/Docs/Ecat, ECAT} as well as Philips
+PAR/REC.  We can read and write @url{https://surfer.nmr.mgh.harvard.edu/,
+FreeSurfer} geometry, annotation and morphometry files.  There is some very
+limited support for @url{http://medical.nema.org/, DICOM}.  NiBabel is the
+successor of @url{http://niftilib.sourceforge.net/pynifti/, PyNIfTI}.")
+    (license license:expat)))
-- 
2.34.0

From 477410e79fc0cb11ee2915d876fbe250d7ec361c Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 19:12:02 +0100
Subject: [PATCH v4 05/18] gnu: Add python-nitime.

* gnu/packages/python-science.scm (python-nitime): New variable.
---
 gnu/packages/python-science.scm | 35 +++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index ad3fdd17fd..66c79b2e69 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -1159,3 +1159,38 @@ (define-public python-nibabel
 limited support for @url{http://medical.nema.org/, DICOM}.  NiBabel is the
 successor of @url{http://niftilib.sourceforge.net/pynifti/, PyNIfTI}.")
     (license license:expat)))
+
+(define-public python-nitime
+  (package
+    (name "python-nitime")
+    (version "0.9")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "nitime" version))
+       (sha256
+        (base32
+         "0x1q6ka8i330yhp5h0h6igfs2gp5dndiybyfkdi45a8zpfnr0zbf"))))
+    (build-system python-build-system)
+    (propagated-inputs (list python-matplotlib python-networkx python-nibabel
+                             python-numpy python-scipy))
+    (native-inputs (list python-cython python-pytest))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'delete-generated-cython
+           (lambda _
+             (delete-file "nitime/_utils.c")))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "pytest" "-vv" "nitime")))))))
+    (home-page "http://nipy.org/nitime/")
+    (synopsis "Nitime: timeseries analysis for neuroscience data")
+    (description
+     "Nitime contains a core of numerical algorithms for
+time-series analysis both in the time and spectral domains, a set of container
+objects to represent time-series, and auxiliary objects that expose a high
+level interface to the numerical machinery and make common analysis tasks easy
+to express with compact and semantically clear code.")
+    (license license:bsd-3)))
-- 
2.34.0

From 6a18d1b1930adb04be6d2d0f9f8d1aa1e54e7141 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 19:20:06 +0100
Subject: [PATCH v4 06/18] gnu: Add python-flake8-array-spacing.

* gnu/packages/python-science.scm (python-flake8-array-spacing): New variable.
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f4b8ed67a2..9c97b246fd 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25469,6 +25469,24 @@ (define-public python-imageio-ffmpeg
 executables.")
     (license license:bsd-2)))
 
+(define-public python-flake8-array-spacing
+  (package
+    (name "python-flake8-array-spacing")
+    (version "0.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "flake8_array_spacing" version))
+       (sha256
+        (base32 "0nyp2x45hg5dkdrn0j2wcd336dnx6csizpfq5fwbk774wrb0lh6d"))))
+    (build-system python-build-system)
+    (propagated-inputs (list python-flake8 python-pycodestyle))
+    (home-page "https://github.com/larsoner/flake8-array-spacing")
+    (synopsis "flake8 plugin to make exceptions for array-like variables")
+    (description "Recast some E2XX errors as A2XX with exceptions for
+array-like variables.")
+    (license license:bsd-3)))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From abbcd5e08f263feeb4130496fde24f28d358190c Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 21:17:39 +0100
Subject: [PATCH v4 07/18] gnu: Add python-makefun.

* gnu/packages/python-xyz.scm (python-makefun): New variable.
---
 gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9c97b246fd..660d6087c1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25487,6 +25487,28 @@ (define-public python-flake8-array-spacing
 array-like variables.")
     (license license:bsd-3)))
 
+(define-public python-makefun
+  (package
+    (name "python-makefun")
+    (version "1.13.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "makefun" version))
+       (sha256
+        (base32
+         "1gqnqvwzig9ym4nyzwy6dzra7sg6339rdaca59fvkfzzf2vbhnwq"))))
+    (build-system python-build-system)
+    (native-inputs (list python-pytest python-pytest-runner
+                         python-setuptools-scm))
+    (home-page "https://github.com/smarie/python-makefun")
+    (synopsis "Small library to dynamically create python functions")
+    (description
+     "@samp{makefun} helps you create functions dynamically, with the
+signature of your choice.  It was largely inspired by @samp{decorator} and
+@samp{functools}, and created mainly to cover some of their limitations.")
+    (license license:bsd-3)))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From 3405f00ad85e4411ddf0df88994ea48bfe9cfcd9 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 22:32:09 +0100
Subject: [PATCH v4 08/18] gnu: Add python-pytest-logging.

* gnu/packages/python-xyz.scm (python-pytest-logging): New variable.
---
 gnu/packages/python-xyz.scm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 660d6087c1..5753101a2b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25509,6 +25509,27 @@ (define-public python-makefun
 @samp{functools}, and created mainly to cover some of their limitations.")
     (license license:bsd-3)))
 
+(define-public python-pytest-logging
+  (package
+    (name "python-pytest-logging")
+    (version "2015.11.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-logging" version))
+       (sha256
+        (base32
+         "15n8fyxvvwmk982vj0m9yl76hn7pp4qqljfmxarbgahqrxgciiff"))))
+    (build-system python-build-system)
+    (propagated-inputs (list python-pytest))
+    (home-page "https://github.com/saltstack/pytest-logging")
+    (synopsis
+     "Logging with a @code{py.test} flag")
+    (description
+     "This package configures logging and allows tweaking the log level with a
+@code{py.test} flag.")
+    (license license:asl2.0)))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From 95c3c667967d7e1a995a8d51d48e122536c6db0b Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 22:32:53 +0100
Subject: [PATCH v4 09/18] gnu: Add a test-less python-decopatch.

* gnu/packages/python-xyz.scm (python-decopatch-minimal): New variable.
---
 gnu/packages/python-xyz.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5753101a2b..f1b68b3e39 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25530,6 +25530,36 @@ (define-public python-pytest-logging
 @code{py.test} flag.")
     (license license:asl2.0)))
 
+;; decopatch requires the next pytest modules if tests are enabled. The pytest
+;; modules require each other for tests.
+
+(define python-decopatch-minimal
+  (package
+    (name "python-decopatch-minimal")
+    (version "1.4.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "decopatch" version))
+       (sha256
+        (base32
+         "0i6i811s2j1z0cl6y177dwsbfxib8dvb5c2jpgklvc2xy4ahhsy6"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f))
+    (propagated-inputs (list python-makefun))
+    (native-inputs (list python-pytest python-pytest-runner
+                         python-setuptools-scm))
+    (home-page "https://github.com/smarie/python-decopatch")
+    (synopsis "Python decorators made easy")
+    (description
+     "Because of a tiny oddity in the python language, writing decorators
+without help can be a pain because you have to handle the no-parenthesis usage
+@url{https://smarie.github.io/python-decopatch/motivation, explicitly}.
+@samp{decopatch} provides a simple way to solve this issue so that writing
+decorators is simple and straightforward.")
+    (license license:bsd-3)))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From d044ab299f7e9f5b4af0f29f0ce85e51d50b76ab Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 22:33:32 +0100
Subject: [PATCH v4 10/18] gnu: Add a test-less python-pytest-harvest.

* gnu/packages/python-xyz.scm (python-pytest-harvest-minimal): New variable.
---
 gnu/packages/python-xyz.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f1b68b3e39..49beaef98e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25560,6 +25560,31 @@ (define python-decopatch-minimal
 decorators is simple and straightforward.")
     (license license:bsd-3)))
 
+(define python-pytest-harvest-minimal
+  (package
+    (name "python-pytest-harvest-minimal")
+    (version "1.10.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-harvest" version))
+       (sha256
+        (base32
+         "092drlh96rhikwqqyfpwqhkzfzd7z8m5gbmjgky8npm81849jbsk"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f))
+    (propagated-inputs (list python-decopatch-minimal python-makefun
+                             python-six))
+    (native-inputs (list python-pytest python-pytest-runner
+                         python-setuptools-scm))
+    (home-page "https://github.com/smarie/python-pytest-harvest")
+    (synopsis "Store data created during your @samp{pytest} tests execution")
+    (description
+     "Store data created during your pytest tests execution, and retrieve it
+at the end of the session, e.g. for applicative benchmarking purposes.")
+    (license license:bsd-3)))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From c03e71a4c7463e02c97501947ff067ff02d3efd0 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 22:34:06 +0100
Subject: [PATCH v4 11/18] gnu: Add a test-less python-pytest-steps.

* gnu/packages/python-xyz.scm (python-pytest-steps-minimal): New variable.
---
 gnu/packages/python-xyz.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 49beaef98e..a00e317864 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25585,6 +25585,30 @@ (define python-pytest-harvest-minimal
 at the end of the session, e.g. for applicative benchmarking purposes.")
     (license license:bsd-3)))
 
+(define python-pytest-steps-minimal
+  (package
+    (name "python-pytest-steps-minimal")
+    (version "1.8.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-steps" version))
+       (sha256
+        (base32
+         "05r2ch7191saj7sw6d47bfa5vnyyj157dl8hvlcc78xx6jyxy46j"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f))
+    (propagated-inputs (list python-makefun python-wrapt python-tabulate
+                             python-pandas))
+    (native-inputs (list python-pytest python-pytest-runner
+                         python-setuptools-scm))
+    (home-page "https://github.com/smarie/python-pytest-steps")
+    (synopsis "Create step-wise / incremental tests in pytest")
+    (description "This package provides support for step-wise / incremental
+tests in pytest.")
+    (license license:bsd-3)))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From bf082faac267456509498d68a28c893fa6589e57 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 22:34:36 +0100
Subject: [PATCH v4 12/18] gnu: Add a test-less python-pytest-cases.

* gnu/packages/python-xyz.scm (python-pytest-cases-minimal): New variable.
---
 gnu/packages/python-xyz.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a00e317864..49e553c567 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25609,6 +25609,38 @@ (define python-pytest-steps-minimal
 tests in pytest.")
     (license license:bsd-3)))
 
+(define python-pytest-cases-minimal
+  (package
+    (name "python-pytest-cases-minimal")
+    (version "3.6.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-cases" version))
+       (sha256
+        (base32
+         "1g3lp4m19fk83kl2b4akwg7wqqaqlfzp4v6qcb0hq27161xyh8yl"))))
+    (build-system python-build-system)
+    (propagated-inputs (list python-decopatch-minimal python-makefun))
+    (native-inputs (list python-pytest
+                         python-pytest-runner
+                         python-setuptools-scm
+                         python-pytest-asyncio
+                         python-pytest-harvest-minimal
+                         python-pytest-steps-minimal))
+    (home-page "https://github.com/smarie/python-pytest-cases")
+    (synopsis "Separate test code from test cases in @samp{pytest}")
+    (description
+     "@samp{pytest-cases} leverages @samp{pytest} and its great
+@samp{@@pytest.mark.parametrize decorator}, so that you can @strong{separate
+your test cases from your test functions}.  In addition, @samp{pytest-cases}
+provides several useful goodies to empower @samp{pytest}.  In particular it
+improves the fixture mechanism to support \"fixture unions\".  This is a
+@strong{major change} in the internal @samp{pytest} engine, unlocking many
+possibilities such as using fixture references as parameter values in a test
+function.")
+    (license license:bsd-3)))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From aac715959af6b765272a07c4521dc44939cdb84c Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 22:35:02 +0100
Subject: [PATCH v4 13/18] gnu: Add python-decopatch.

* gnu/packages/python-xyz.scm (python-decopatch): New variable.
---
 gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 49e553c567..bdb5b9537d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25641,6 +25641,28 @@ (define python-pytest-cases-minimal
 function.")
     (license license:bsd-3)))
 
+(define-public python-decopatch
+  (package
+    (inherit python-decopatch-minimal)
+    (name "python-decopatch")
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (delete-file "decopatch/tests/test_main2.py")
+             (delete-file
+              "decopatch/tests/test_main2_parametrizers.py")
+             (delete-file "decopatch/tests/test_introspection.py")
+             (delete-file
+              "decopatch/tests/test_introspection_base.py")
+             (substitute* "decopatch/tests/test_doc_advanced.py"
+               (("'uses_introspection', \\[True, False\\]")
+                "'uses_introspection', [False]")))))))
+    (native-inputs (list python-pytest python-pytest-runner
+                         python-pytest-cases-minimal python-setuptools-scm
+                         python-pytest-logging))))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From a60c87b706a1b570c4638ec570c43e6b16102d29 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 22:35:28 +0100
Subject: [PATCH v4 14/18] gnu: Add python-pytest-cases.

* gnu/packages/python-xyz.scm (python-pytest-cases): New variable.
---
 gnu/packages/python-xyz.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index bdb5b9537d..730a8723f7 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25663,6 +25663,14 @@ (define-public python-decopatch
                          python-pytest-cases-minimal python-setuptools-scm
                          python-pytest-logging))))
 
+(define-public python-pytest-cases
+  (package
+    (inherit python-pytest-cases-minimal)
+    (name "python-pytest-cases")
+    (arguments '())
+    ;; Propagate the tested decopatch instead of decopatch-minimal
+    (propagated-inputs (list python-decopatch python-makefun))))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From 8cb125505b1f6a5ff79b71e643949ca7f90790b8 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 22:35:49 +0100
Subject: [PATCH v4 15/18] gnu: Add python-pytest-harvest.

* gnu/packages/python-xyz.scm (python-pytest-harvest): New variable.
---
 gnu/packages/python-xyz.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 730a8723f7..0ffd4ef9c6 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25671,6 +25671,25 @@ (define-public python-pytest-cases
     ;; Propagate the tested decopatch instead of decopatch-minimal
     (propagated-inputs (list python-decopatch python-makefun))))
 
+(define-public python-pytest-harvest
+  (package
+    (inherit python-pytest-harvest-minimal)
+    (name "python-pytest-harvest")
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'move-pytests-plugins
+           (lambda _
+             (rename-file "pytest_harvest/tests/conftest.py"
+                          "conftest.py"))))))
+    (native-inputs (list python-pytest
+                         python-pytest-runner
+                         python-setuptools-scm
+                         python-pytest-cases
+                         python-tabulate
+                         python-pandas))
+    (propagated-inputs (list python-decopatch python-makefun python-six))))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From 1ad97680bf40f4431145e0e6d7307ec032110ed9 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 22:36:06 +0100
Subject: [PATCH v4 16/18] gnu: Add python-pytest-steps.

* gnu/packages/python-xyz.scm (python-pytest-steps): New variable.
---
 gnu/packages/python-xyz.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0ffd4ef9c6..daefd5cc00 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25690,6 +25690,21 @@ (define-public python-pytest-harvest
                          python-pandas))
     (propagated-inputs (list python-decopatch python-makefun python-six))))
 
+(define-public python-pytest-steps
+  (package
+    (inherit python-pytest-steps-minimal)
+    (name "python-pytest-steps")
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'move-pytests-plugins
+           (lambda _
+             (rename-file "pytest_steps/tests/conftest.py"
+                          "conftest.py"))))))
+    (native-inputs (list python-pytest python-pytest-runner
+                         python-setuptools-scm python-pytest-cases
+                         python-pytest-harvest))))
+
 (define-public python-frozendict
   (package
     (name "python-frozendict")
-- 
2.34.0

From 3f69dbd7fe590c06473031c02acc166a44dcf269 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 23:00:37 +0100
Subject: [PATCH v4 17/18] gnu: python-pooch: Update to 1.6.0.

* gnu/packages/python-xyz.scm (python-pooch): Update to 1.6.0.
[native-inputs]: Add python-setuptools-scm.
---
 gnu/packages/python-xyz.scm | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index daefd5cc00..963a7b9d1b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -22273,18 +22273,44 @@ (define-public pybind11
 (define-public python-pooch
   (package
     (name "python-pooch")
-    (version "1.3.0")
+    (version "1.6.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pooch" version))
        (sha256
-        (base32 "1618adsg9r8fsv422sv35z1i723q3a1iir5v7dv2sklh4pl4im1h"))))
+        (base32 "0i1zmd0v7n3yx167j18ldidfiih9n734pdjvn3999mhdn720xljp"))))
     (build-system python-build-system)
     (arguments
-     `(#:tests? #f)) ;requires online data
+     (list
+      #:tests? #f ;requires online data
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; XXX: PEP 517 manual build copied from python-isort.
+          (replace 'build
+            (lambda _
+              (setenv "SOURCE_DATE_EPOCH" "315532800")
+              (invoke "python"
+                      "-m"
+                      "build"
+                      "--wheel"
+                      "--no-isolation"
+                      ".")))
+          (replace 'install
+            (lambda _
+              (let ((whl (car (find-files "dist" "\\.whl$"))))
+                (invoke "pip"
+                        "--no-cache-dir"
+                        "--no-input"
+                        "install"
+                        "--no-deps"
+                        "--prefix"
+                        #$output
+                        whl)))))))
     (propagated-inputs
      (list python-appdirs python-packaging python-requests))
+    (native-inputs
+     (list python-pypa-build python-setuptools-scm))
     (home-page "https://github.com/fatiando/pooch")
     (synopsis "Manage your Python library's sample data files")
     (description
-- 
2.34.0

From f1deca828dddb258791c98ef52be14a8cf6c6c22 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 20 Jan 2022 23:21:25 +0100
Subject: [PATCH v4 18/18] gnu: Add python-mne.

* gnu/packages/python-science.scm (python-mne): New variable.
---
 gnu/packages/python-science.scm | 45 +++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 66c79b2e69..61ab831457 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -39,6 +39,7 @@ (define-module (gnu packages python-science)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages image-processing)
+  #:use-module (gnu packages jupyter)
   #:use-module (gnu packages machine-learning)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages mpi)
@@ -1194,3 +1195,47 @@ (define-public python-nitime
 level interface to the numerical machinery and make common analysis tasks easy
 to express with compact and semantically clear code.")
     (license license:bsd-3)))
+
+(define-public python-mne
+  (package
+    (name "python-mne")
+    (version "0.24.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "mne" version))
+       (sha256
+        (base32
+         "039h0pwcvl4ywfa4ij7w6x61czd322csqr59yhzfil3a7b8gzjrq"))))
+    (build-system python-build-system)
+    (arguments
+     ;; The test data is distributed in a separate repository without a
+     ;; license, https://github.com/mne-tools/mne-testing-data
+     `(#:tests? #f))
+    (propagated-inputs (list python-numpy python-scipy))
+    (native-inputs (list python-check-manifest
+                         python-codespell
+                         python-edflib
+                         python-eeglabio
+                         python-flake8
+                         python-flake8-array-spacing
+                         python-imageio-ffmpeg
+                         python-nbclient
+                         python-nitime
+                         python-numpydoc
+                         python-pooch
+                         python-pydocstyle
+                         python-pytest
+                         python-pytest-cov
+                         python-pytest-harvest
+                         python-pytest-timeout
+                         python-sphinx-gallery
+                         python-twine
+                         python-wheel))
+    (home-page "https://mne.tools/dev/")
+    (synopsis "MNE-Python project for MEG and EEG data analysis")
+    (description
+     "Open-source Python package for exploring, visualizing, and
+analyzing human neurophysiological data: MEG, EEG, sEEG, ECoG, NIRS, and
+more.")
+    (license license:bsd-3)))
-- 
2.34.0