diff mbox series

[bug#46955,3/3] gnu: python-cooler: Update to 0.8.11.

Message ID 20210603232503.29253-3-madalinionel.patrascu@mdc-berlin.de
State Accepted
Headers show
Series [bug#46955,1/3] gnu: Add python-sparse. | expand

Commit Message

Mădălin Ionel Patrașcu June 3, 2021, 11:25 p.m. UTC
* gnu/packages/bioinformatics.scm (python-cooler): Update to 0.8.11.
---
 gnu/packages/bioinformatics.scm | 39 ++++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 6 deletions(-)

Comments

M June 5, 2021, 10:06 a.m. UTC | #1
A comment about a build phase.

> [...]
> +         (replace 'check
> +           (lambda _
> +             (invoke "python" "-m" "pytest" "-v")
> +            #t)))))

This needs to be something like

+ (replace 'check
+   (lambda* (#:key tests? #:allow-other-keys)
+     (when tests?
+       (invoke "python" "-m" "pytest" "-v"))))

By respecting 'tests?', the --without-tests build transformation can be used.
(Try "guix build python-cooler --without-tests=python-cooler").
This can also be important for cross-compilation (dunno if it applies here
though).

Trailing #t are not required anymore. The warning that results if it is removed
will disappear once core-updates is merged.

Greetings,
Maxime.
Mădălin Ionel Patrașcu June 6, 2021, 12:03 a.m. UTC | #2
Hi Maxime,


Thanks for the explanation, now these things are clear to me!

I applied Maxime's advice and I have made some changes on two patches 
(python-sparse and python-cooler). Because of this reason, I will send 
again the whole series of patches and I will wait for a full review of them.

Thanks, Maxime!

On 05.06.2021 12:06, Maxime Devos wrote:
> A comment about a build phase.
>
>> [...]
>> +         (replace 'check
>> +           (lambda _
>> +             (invoke "python" "-m" "pytest" "-v")
>> +            #t)))))
> This needs to be something like
>
> + (replace 'check
> +   (lambda* (#:key tests? #:allow-other-keys)
> +     (when tests?
> +       (invoke "python" "-m" "pytest" "-v"))))
>
> By respecting 'tests?', the --without-tests build transformation can be used.
> (Try "guix build python-cooler --without-tests=python-cooler").
> This can also be important for cross-compilation (dunno if it applies here
> though).
>
> Trailing #t are not required anymore. The warning that results if it is removed
> will disappear once core-updates is merged.
>
> Greetings,
> Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 94d15cc4c0..55e25ab486 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -11591,15 +11591,35 @@  fasta subsequences.")
 (define-public python-cooler
   (package
     (name "python-cooler")
-    (version "0.8.7")
+    (version "0.8.11")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "cooler" version))
        (sha256
         (base32
-         "01g6gqix9ba27sappz6nfyiwabzrlf8i5fn8kwcz8ra356cq9crp"))))
+         "1i96fmpsimj4wrx51rxn8lw2gqxf5a2pvrj5rwdd6ivnm3pmhyrn"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-tests
+           (lambda _
+             (substitute* "tests/test_create.py"
+              (("def test_roundtrip")
+                 (string-append "@pytest.mark.skip(reason=\"requires network "
+                                "access to genome.ucsc.edu\")\n"
+                                "def test_roundtrip")))
+             (substitute* "tests/test_util.py"
+              (("def test_fetch_chromsizes")
+                 (string-append "@pytest.mark.skip(reason=\"requires network "
+                                "access to genome.ucsc.edu\")\n"
+                                "def test_fetch_chromsizes")))
+            #t))
+         (replace 'check
+           (lambda _
+             (invoke "python" "-m" "pytest" "-v")
+            #t)))))
     (propagated-inputs
      `(("python-asciitree" ,python-asciitree)
        ("python-biopython" ,python-biopython)
@@ -11615,11 +11635,18 @@  fasta subsequences.")
        ("python-pysam" ,python-pysam)
        ("python-pyyaml" ,python-pyyaml)
        ("python-scipy" ,python-scipy)
-       ("python-simplejson" ,python-simplejson)))
+       ("python-simplejson" ,python-simplejson)
+       ("python-six" ,python-six)
+       ("python-sparse" ,python-sparse)))
     (native-inputs
-     `(("python-mock" ,python-mock)
-       ("python-pytest" ,python-pytest)))
-    (home-page "https://github.com/mirnylab/cooler")
+     `(("python-codecov" ,python-codecov)
+       ("python-ipytree" ,python-ipytree)
+       ("python-mock" ,python-mock)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-flake8" ,python-pytest-flake8)))
+    ;;almost all the projects of the Mirnylab are moved under Open2C umbrella
+    (home-page "https://github.com/open2c/cooler")
     (synopsis "Sparse binary format for genomic interaction matrices")
     (description
      "Cooler is a support library for a sparse, compressed, binary persistent