GNU bug report logs - #34456
[PATCH] gnu: python-pybedtools: Update to 0.8.0 and fix build.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Tue, 12 Feb 2019 15:33:02 UTC

Severity: normal

Tags: patch

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34456 in the body.
You can then email your comments to 34456 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#34456; Package guix-patches. (Tue, 12 Feb 2019 15:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 12 Feb 2019 15:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <guix-patches <at> gnu.org>
Subject: [PATCH] gnu: python-pybedtools: Update to 0.8.0 and fix build.
Date: Tue, 12 Feb 2019 10:32:03 -0500
[0001-gnu-python-pybedtools-Update-to-0.8.0-and-fix-build.patch (text/x-patch, attachment)]
From 40db2b4eae5ca61a3134cdaf7b156ed1ae9f7415 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Date: Sun, 10 Feb 2019 23:39:25 -0500
Subject: [PATCH] gnu: python-pybedtools: Update to 0.8.0 and fix build.

* gnu/packages/bioinformatics.scm (python-pybedtools): Update to 0.8.0.
[phases]{disable-broken-tests}: Do not disable "test_issue_157" and
"test_to_dataframe" tests.  Disable the "test_getting_example_beds".
{remove-cython-generated-files}: Add phase.
{generate-cython-extensions}: Add phase.
{check}: Move from python2-pybedtools to here.  Add a scripts
subdirectory of the build directory to the PATH, so that the tests can call
them.  Invoke pytest rather than nosetests.
[modules]: Move from python2-pybedtools to here.
[propagated-inputs]: Depend on the current BEDTOOLS rather than version 1.26.
[native-inputs]: Replace python-nose by python-pytest and add python-psutil.
---
 gnu/packages/bioinformatics.scm | 114 +++++++++++++++++++-------------
 1 file changed, 67 insertions(+), 47 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 279d52ae9..d6db02188 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua <at> nextjournal.com>
 ;;; Copyright © 2018 Gábor Boskovits <boskovits <at> gmail.com>
 ;;; Copyright © 2018 Mădălin Ionel Patrașcu <madalinionel.patrascu <at> mdc-berlin.de>
+;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -612,16 +613,22 @@ intended to behave exactly the same as the original BWK awk.")
 (define-public python-pybedtools
   (package
     (name "python-pybedtools")
-    (version "0.7.10")
+    (version "0.8.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "pybedtools" version))
               (sha256
                (base32
-                "0l2b2wrnj85azfqgr0zwr60f7j58vlla1hcgxvr9rwikpl8j72ji"))))
+                "1xl454ijvd4dzfvqgfahad49b49j7qy710fq9xh1rvk42z6x5ssf"))))
     (build-system python-build-system)
     (arguments
-     `(#:phases
+     `(#:modules ((ice-9 ftw)
+                  (srfi srfi-1)
+                  (srfi srfi-26)
+                  (guix build utils)
+                  (guix build python-build-system))
+       ;; See https://github.com/daler/pybedtools/issues/192
+       #:phases
        (modify-phases %standard-phases
          ;; See https://github.com/daler/pybedtools/issues/261
          (add-after 'unpack 'disable-broken-tests
@@ -631,21 +638,59 @@ intended to behave exactly the same as the original BWK awk.")
              (substitute* "pybedtools/test/test_scripts.py"
                (("def test_venn_mpl")
                 "def _do_not_test_venn_mpl"))
-             ;; Requires internet access.
              (substitute* "pybedtools/test/test_helpers.py"
+               ;; Requires internet access.
                (("def test_chromsizes")
-                "def _do_not_test_chromsizes"))
-             ;; FIXME: these two fail for no good reason.
-             (substitute* "pybedtools/test/test1.py"
-               (("def test_issue_157")
-                "def _do_not_test_issue_157")
-               (("def test_to_dataframe")
-                "def _do_not_test_to_dataframe"))
-             #t)))))
-    (propagated-inputs
-     ;; Tests don't pass with Bedtools 2.27.1.
-     ;; See https://github.com/daler/pybedtools/issues/260
-     `(("bedtools" ,bedtools-2.26)
+                "def _do_not_test_chromsizes")
+               ;; Broken as a result of the workaround used in the check phase
+               ;; (see: https://github.com/daler/pybedtools/issues/192).
+               (("def test_getting_example_beds")
+                "def _do_not_test_getting_example_beds"))
+             #t))
+         ;; TODO: Remove phase after it's part of PYTHON-BUILD-SYSTEM.
+         ;; build system.
+         ;; Force the Cythonization of C++ files to guard against compilation
+         ;; problems.
+         (add-after 'unpack 'remove-cython-generated-files
+           (lambda _
+             (let ((cython-sources (map (cut string-drop-right <> 4)
+                                        (find-files "." "\\.pyx$")))
+                   (c/c++-files (find-files "." "\\.(c|cpp|cxx)$")))
+               (define (strip-extension filename)
+                 (string-take filename (string-index-right filename #\.)))
+               (define (cythonized? c/c++-file)
+                 (member (strip-extension c/c++-file) cython-sources))
+               (for-each delete-file (filter cythonized? c/c++-files))
+               #t)))
+         (add-after 'remove-cython-generated-files 'generate-cython-extensions
+           (lambda _
+             (invoke "python" "setup.py" "cythonize")))
+         (replace 'check
+           (lambda _
+             (let* ((cwd (getcwd))
+                    (build-root-directory (string-append cwd "/build/"))
+                    (build (string-append
+                            build-root-directory
+                            (find (cut string-prefix? "lib" <>)
+                                  (scandir (string-append
+                                            build-root-directory)))))
+                    (scripts (string-append
+                              build-root-directory
+                              (find (cut string-prefix? "scripts" <>)
+                                    (scandir build-root-directory)))))
+               (setenv "PYTHONPATH"
+                       (string-append build ":" (getenv "PYTHONPATH")))
+               ;; Executable scripts such as 'intron_exon_reads.py' must be
+               ;; available in the PATH.
+               (setenv "PATH"
+                       (string-append scripts ":" (getenv "PATH"))))
+             ;; The tests need to be run from elsewhere...
+             (mkdir-p "/tmp/test")
+             (copy-recursively "pybedtools/test" "/tmp/test")
+             (with-directory-excursion "/tmp/test"
+               (invoke "pytest")))))))
+    (propagated-inputs
+     `(("bedtools" ,bedtools)
        ("samtools" ,samtools)
        ("python-matplotlib" ,python-matplotlib)
        ("python-pysam" ,python-pysam)
@@ -654,9 +699,11 @@ intended to behave exactly the same as the original BWK awk.")
      `(("python-numpy" ,python-numpy)
        ("python-pandas" ,python-pandas)
        ("python-cython" ,python-cython)
-       ("python-nose" ,python-nose)
-       ("kentutils" ,kentutils) ; for bedGraphToBigWig
-       ("python-six" ,python-six)))
+       ("kentutils" ,kentutils)         ; for bedGraphToBigWig
+       ("python-six" ,python-six)
+       ;; For the test suite.
+       ("python-pytest" ,python-pytest)
+       ("python-psutil" ,python-psutil)))
     (home-page "https://pythonhosted.org/pybedtools/")
     (synopsis "Python wrapper for BEDtools programs")
     (description
@@ -667,34 +714,7 @@ Python.")
     (license license:gpl2+)))
 
 (define-public python2-pybedtools
-  (let ((pkg (package-with-python2 python-pybedtools)))
-    (package (inherit pkg)
-      (arguments
-       `(#:modules ((ice-9 ftw)
-                    (srfi srfi-1)
-                    (srfi srfi-26)
-                    (guix build utils)
-                    (guix build python-build-system))
-         ;; See https://github.com/daler/pybedtools/issues/192
-         ,@(substitute-keyword-arguments (package-arguments pkg)
-             ((#:phases phases)
-              `(modify-phases ,phases
-                 (replace 'check
-                   (lambda _
-                     (let ((cwd (getcwd)))
-                       (setenv "PYTHONPATH"
-                               (string-append cwd "/build/"
-                                              (find (cut string-prefix? "lib" <>)
-                                                    (scandir (string-append cwd "/build")))
-                                              ":" (getenv "PYTHONPATH"))))
-                     ;; The tests need to be run from elsewhere...
-                     (mkdir-p "/tmp/test")
-                     (copy-recursively "pybedtools/test" "/tmp/test")
-                     (with-directory-excursion "/tmp/test"
-                       (invoke "nosetests"
-                               ;; This test fails for unknown reasons
-                               "--exclude=.*test_getting_example_beds"))
-                     #t))))))))))
+  (package-with-python2 python-pybedtools))
 
 (define-public python-biom-format
   (package
-- 
2.20.1





Reply sent to Ricardo Wurmus <rekado <at> elephly.net>:
You have taken responsibility. (Tue, 12 Feb 2019 16:19:01 GMT) Full text and rfc822 format available.

Notification sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
bug acknowledged by developer. (Tue, 12 Feb 2019 16:19:02 GMT) Full text and rfc822 format available.

Message #10 received at 34456-done <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 34456-done <at> debbugs.gnu.org
Subject: Re: [bug#34456] [PATCH] gnu: python-pybedtools: Update to 0.8.0 and
 fix build.
Date: Tue, 12 Feb 2019 17:18:34 +0100
Hi Maxim,

> From 40db2b4eae5ca61a3134cdaf7b156ed1ae9f7415 Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
> Date: Sun, 10 Feb 2019 23:39:25 -0500
> Subject: [PATCH] gnu: python-pybedtools: Update to 0.8.0 and fix build.

Thank you, pushed to master with 155194d97.

(I should have checked the commit message before pushing.  The From,
Date, and Subject headers made it into the commit message.  This is the
second time this has happened to me.  Sorry!)

-- 
Ricardo





Information forwarded to guix-patches <at> gnu.org:
bug#34456; Package guix-patches. (Tue, 12 Feb 2019 17:48:01 GMT) Full text and rfc822 format available.

Message #13 received at 34456-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 34456-done <at> debbugs.gnu.org
Subject: Re: [bug#34456] [PATCH] gnu: python-pybedtools: Update to 0.8.0 and
 fix build.
Date: Tue, 12 Feb 2019 12:47:47 -0500
Hello Ricardo,

Ricardo Wurmus <rekado <at> elephly.net> writes:

> Hi Maxim,
>
>> From 40db2b4eae5ca61a3134cdaf7b156ed1ae9f7415 Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
>> Date: Sun, 10 Feb 2019 23:39:25 -0500
>> Subject: [PATCH] gnu: python-pybedtools: Update to 0.8.0 and fix build.
>
> Thank you, pushed to master with 155194d97.
>
> (I should have checked the commit message before pushing.  The From,
> Date, and Subject headers made it into the commit message.  This is the
> second time this has happened to me.  Sorry!)

No problem, and thanks for the prompt review!

Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 13 Mar 2019 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.