diff mbox series

[bug#53402] Rebase it for the new python packages

Message ID ecd331465d03183053f8f9597253c81f9079aa14.camel@planete-kraus.eu
State New
Headers show
Series [bug#53402] Rebase it for the new python packages | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Vivien Kraus Feb. 6, 2022, 2:49 p.m. UTC
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

Comments

Vinicius Monego Feb. 6, 2022, 8:06 p.m. UTC | #1
Em dom, 2022-02-06 às 15:49 +0100, Vivien escreveu:
> Hello, thank you for your review!
> 

Thanks for the v4.

[...]

> 
> > 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.

I noticed that some of the tests aren't running, like in flake8-array-
spacing. If the check phase ends with "Ran 0 tests" then the tests are
not being collected.

If there are no tests to be collected, the package should have a
#:tests? #f along with a comment saying that there are no tests. If
there are tests to run, the check phase will have to be overriden to
run them.

For imageio-ffmpeg there are tests in github but not PyPI. I tried to
source from github but most tests require online data. In that case
#:tests? #f should be added with an explanation.

> 
> > 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.
> 

OK. I tried to download the test dataset from within the mne module and
they don't have a license agreement or anything, while to download
individiual datasets the user has to agree to the (non-free) terms. I
wonder if that's acceptable for merging in Guix?

In [1] I found that there are more base dependencies that aren't listed
in the pypi importer. They should be added to propagated-inputs. If
tests can't run, then native-inputs can be removed.

> > 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.
> 

OK, it seems that they have a web of dependencies on each other. This
is the first time I see such a case.

Usually, pytest modules should go into python-check.scm, not python-
xyz.scm.

> > 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.
> 

The base32 line was truncated in the mail, the hash should be in the
same line of 'base32'. But I can fix that.

[...]

> 
> > 
> > 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?
> 

Full sentences are made of a subject + predicate. This one:

+    (description "I/O support for EEGLAB files in Python.")

doesn't have a subject.

Usually the subject in the description is the package's name itself or
"This package...". e.g. "EEGLABIO is a library..." or "This package
provides I/O support..."

Something else to avoid in descriptions is marketing talk, such as
'simple and reliable' in python-imageio-ffmpeg.

[...]

The package modules you changed are also missing your copyright line.

Vinicius

[1]
https://github.com/mne-tools/mne-python/blob/main/requirements_base.txt

> 
> 
> Sure!
> 
> Best regards,
> 
> Vivien
diff mbox series

Patch

From f1deca828dddb258791c98ef52be14a8cf6c6c22 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
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