From patchwork Tue Feb 12 15:32:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 1066 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8816816C02; Tue, 12 Feb 2019 15:33:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id EF24F16BF7 for ; Tue, 12 Feb 2019 15:33:38 +0000 (GMT) Received: from localhost ([127.0.0.1]:41386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gta42-00062m-EO for patchwork@mira.cbaines.net; Tue, 12 Feb 2019 10:33:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gta3V-0005mQ-JU for guix-patches@gnu.org; Tue, 12 Feb 2019 10:33:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gta3U-0001ug-5v for guix-patches@gnu.org; Tue, 12 Feb 2019 10:33:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45754) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gta3S-0001rZ-W9 for guix-patches@gnu.org; Tue, 12 Feb 2019 10:33:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gta3S-0004bM-MU for guix-patches@gnu.org; Tue, 12 Feb 2019 10:33:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34456] [PATCH] gnu: python-pybedtools: Update to 0.8.0 and fix build. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 12 Feb 2019 15:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34456 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34456@debbugs.gnu.org X-Debbugs-Original-To: guix-patches Received: via spool by submit@debbugs.gnu.org id=B.154998554717636 (code B ref -1); Tue, 12 Feb 2019 15:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Feb 2019 15:32:27 +0000 Received: from localhost ([127.0.0.1]:45035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gta2o-0004aG-Ao for submit@debbugs.gnu.org; Tue, 12 Feb 2019 10:32:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33223) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gta2i-0004Zy-UQ for submit@debbugs.gnu.org; Tue, 12 Feb 2019 10:32:20 -0500 Received: from lists.gnu.org ([209.51.188.17]:39841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gta2d-0000ai-Md for submit@debbugs.gnu.org; Tue, 12 Feb 2019 10:32:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gta2c-00056S-3V for guix-patches@gnu.org; Tue, 12 Feb 2019 10:32:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gta2a-0000X2-FQ for guix-patches@gnu.org; Tue, 12 Feb 2019 10:32:10 -0500 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]:46183) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gta2a-0000VS-8c for guix-patches@gnu.org; Tue, 12 Feb 2019 10:32:08 -0500 Received: by mail-qk1-x72c.google.com with SMTP id i5so4203747qkd.13 for ; Tue, 12 Feb 2019 07:32:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version :content-disposition:content-transfer-encoding; bh=DlIJjaJd+lgTy7xBsMRbc7AWKzFXQ2XH2ltDFiR1H78=; b=JHwBn24ay3CeB5mKcbcQOf5hDAigqFqkjLwznONGGAY4wgv0GplfVQnDZq2kqA5guP 9f6SoWsQtqbdS98AljlP0uSbxG8oaCGaaFGiyAiw32ooXR0Xbq5glBjLn7DSyyKk0SOd 1/iBiitzXMVerAqhE02ip9cMOq82/SAkMV7MCldx1iJRFdzR1D+cX3wS/kOD8tYw6TvF yzQH5AkqQos4CcdfVo5K5ldrfJ7Fkl1S0xXZmgnuEbJaV/mfqV+4fuJdPVR+3sfLYpzQ E4RJq3sjv8adftFNEftT55dlf+X5FxJIhbehCkrvi63gYVKTsSkkJYEXC285ikJ7aOvR qdPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-disposition:content-transfer-encoding; bh=DlIJjaJd+lgTy7xBsMRbc7AWKzFXQ2XH2ltDFiR1H78=; b=KRmabP3npbff054DqzX5MhJDCWKzAy/TrvXLb9FvEaK2io3dEriLCDJ5qSEm9/4Bdv klhGKJZRWYEJTAzAxucf/hDHyWJ89rH4V6wfBUrDZpmaDaoo1rnzdI5W7swrpnZYn+DE WVKhVHP2O/ELq4ps3rlOy+KF93V0sfA0DxAodQqTHFf6dNtvkWbhyf4RCYkXaBHfbt1Q TBg6eB2gGCZ0hNtT8OMVyQVO6u/Cpd9GlXwxa9hljDFFqejxK2L+PwadGooe2kENdzQx ALAd6KXR1xx387/d1FFiC9UrKu9xsOWE+ZD6oPmPOQWGmx7CnxQ5amNcy2xgc6/qfDPV FQ4A== X-Gm-Message-State: AHQUAuZzQzVwN8vhukgJ96o2Ovso3NsIjju4WrYRZfIhgjfFROoZV1jc XZ5haTOdKtcI6gfS9pANLjMunHX6 X-Google-Smtp-Source: AHgI3Ibej//EoBQ6avqDJROe91JJUoVxUNoIuQjuiBhumtH5SOSfWxKVmQRQj1AWh0SIFKl07O3E4g== X-Received: by 2002:a37:9d56:: with SMTP id g83mr2993150qke.351.1549985527220; Tue, 12 Feb 2019 07:32:07 -0800 (PST) Received: from kwak (mtl.savoirfairelinux.net. [208.88.110.46]) by smtp.gmail.com with ESMTPSA id c9sm11142140qkj.61.2019.02.12.07.32.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Feb 2019 07:32:06 -0800 (PST) From: Maxim Cournoyer Date: Tue, 12 Feb 2019 10:32:03 -0500 Message-ID: <87d0nx10r0.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Disposition: attachment; filename=0001-gnu-python-pybedtools-Update-to-0.8.0-and-fix-build.patch X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From 40db2b4eae5ca61a3134cdaf7b156ed1ae9f7415 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer 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 ;;; Copyright © 2018 Gábor Boskovits ;;; Copyright © 2018 Mădălin Ionel Patrașcu +;;; Copyright © 2019 Maxim Cournoyer ;;; ;;; 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