[med-svn] [Git][med-team/python-pybedtools][master] 2 commits: Add back test_issue_178 after upstream provided a patch

Andreas Tille gitlab at salsa.debian.org
Mon Mar 12 10:09:28 UTC 2018


Andreas Tille pushed to branch master at Debian Med / python-pybedtools


Commits:
1ddd1ca6 by Andreas Tille at 2017-11-09T12:01:45+01:00
Add back test_issue_178 after upstream provided a patch

- - - - -
57355f02 by Andreas Tille at 2017-11-09T12:11:30+01:00
Team upload to unstable

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/c8dff864dbc942bb7adb3e719b0702f7e3989d36.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,9 @@
-python-pybedtools (0.7.10-2) UNRELEASED; urgency=medium
+python-pybedtools (0.7.10-2) unstable; urgency=medium
 
-  * Provide link to upstream issue for failed test
+  * Team upload
+  * Add back test_issue_178 after upstream provided a patch
 
- -- Andreas Tille <tille at debian.org>  Wed, 08 Nov 2017 09:25:08 +0100
+ -- Andreas Tille <tille at debian.org>  Thu, 09 Nov 2017 12:01:51 +0100
 
 python-pybedtools (0.7.10-1) unstable; urgency=medium
 


=====================================
debian/patches/c8dff864dbc942bb7adb3e719b0702f7e3989d36.patch
=====================================
--- /dev/null
+++ b/debian/patches/c8dff864dbc942bb7adb3e719b0702f7e3989d36.patch
@@ -0,0 +1,151 @@
+From: Ryan Dale <dalerr at niddk.nih.gov>
+Date: Wed, 8 Nov 2017 15:35:02 -0500
+Subject: [PATCH] address #227
+
+---
+ pybedtools/contrib/bigwig.py | 62 +++++++++++++++++++++++++++++++++++++-------
+ pybedtools/test/test1.py     | 36 ++++++++++++++-----------
+ 2 files changed, 73 insertions(+), 25 deletions(-)
+
+--- a/pybedtools/contrib/bigwig.py
++++ b/pybedtools/contrib/bigwig.py
+@@ -48,8 +48,17 @@ def bedgraph_to_bigwig(bedgraph, genome,
+         bedgraph.fn,
+         genome_file,
+         output]
+-    p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+-    stdout, stderr = p.communicate()
++    try:
++        p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
++        stdout, stderr = p.communicate()
++    except FileNotFoundError:
++        raise FileNotFoundError(
++            "bedGraphToBigWig was not found on the path. This is an external "
++            "tool from UCSC which can be downloaded from "
++            "http://hgdownload.soe.ucsc.edu/admin/exe/. Alternatatively, use "
++            "`conda install ucsc-bedgraphtobigwig`"
++        )
++
+     if p.returncode:
+         raise ValueError("cmds: %s\nstderr:%s\nstdout:%s"
+                          % (" ".join(cmds), stderr, stdout))
+@@ -72,8 +81,16 @@ def bigwig_to_bedgraph(fn, chrom=None, s
+     outfn = pybedtools.BedTool._tmp()
+     cmds.append(outfn)
+ 
+-    p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+-    stdout, stderr = p.communicate()
++    try:
++        p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
++        stdout, stderr = p.communicate()
++    except FileNotFoundError:
++        raise FileNotFoundError(
++            "bigWigToBedGraph was not found on the path. This is an external "
++            "tool from UCSC which can be downloaded from "
++            "http://hgdownload.soe.ucsc.edu/admin/exe/. Alternatatively, use "
++            "`conda install ucsc-bedgraphtobigwig`"
++        )
+     if p.returncode:
+         raise ValueError("cmds: %s\nstderr:%s\nstdout:%s"
+                          % (" ".join(cmds), stderr, stdout))
+@@ -87,8 +104,17 @@ def wig_to_bigwig(wig, genome, output):
+         wig.fn,
+         genome_file,
+         output]
+-    subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+-    stdout, stderr = p.communicate()
++
++    try:
++        p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
++        stdout, stderr = p.communicate()
++    except FileNotFoundError:
++        raise FileNotFoundError(
++            "bigWigToBedGraph was not found on the path. This is an external "
++            "tool from UCSC which can be downloaded from "
++            "http://hgdownload.soe.ucsc.edu/admin/exe/. Alternatatively, use "
++            "`conda install ucsc-bedgraphtobigwig`"
++        )
+     if p.returncode:
+         raise ValueError('cmds: %s\nstderr:%s\nstdout:%s'
+                          % (' '.join(cmds), stderr, stdout))
+@@ -120,15 +146,31 @@ def bam_to_bigwig(bam, genome, output, s
+         x.fn,
+         genome_file,
+         output]
+-    p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
+-    stdout, stderr = p.communicate()
++    try:
++        p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
++        stdout, stderr = p.communicate()
++    except FileNotFoundError:
++        raise FileNotFoundError(
++            "bedGraphToBigWig was not found on the path. This is an external "
++            "tool from UCSC which can be downloaded from "
++            "http://hgdownload.soe.ucsc.edu/admin/exe/. Alternatatively, use "
++            "`conda install ucsc-bedgraphtobigwig`"
++        )
+ 
+     if p.returncode and  'bedSort' in stderr:
+         print('BAM header was not sorted; sorting bedGraph')
+         y = x.sort()
+         cmds[1] = y.fn
+-        p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
+-        stdout, stderr = p.communicate()
++        try:
++            p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
++            stdout, stderr = p.communicate()
++        except FileNotFoundError:
++            raise FileNotFoundError(
++                "bedSort was not found on the path. This is an external "
++                "tool from UCSC which can be downloaded from "
++                "http://hgdownload.soe.ucsc.edu/admin/exe/. Alternatatively, use "
++                "`conda install ucsc-bedgraphtobigwig`"
++            )
+ 
+     if p.returncode:
+         raise ValueError('cmds: %s\nstderr: %s\nstdout: %s'
+--- a/pybedtools/test/test1.py
++++ b/pybedtools/test/test1.py
+@@ -2104,21 +2104,27 @@ def test_issue_196():
+ 
+ 
+ def test_issue_178():
+-    fn = pybedtools.example_filename('gdc.othersort.bam')
+-    pybedtools.contrib.bigwig.bam_to_bigwig(fn, genome='dm3', output='tmp.bw')
+-    x = pybedtools.contrib.bigwig.bigwig_to_bedgraph('tmp.bw')
+-    assert x == fix(
+-        '''
+-        chr2L   70      75      1
+-        chr2L   140     145     1
+-        chr2L   150     155     1
+-        chr2L   160     165     1
+-        chr2L   210     215     1
+-        chrX    10      15      1
+-        chrX    70      75      1
+-        chrX    140     145     1
+-        ''')
+-    os.unlink('tmp.bw')
++    try:
++        fn = pybedtools.example_filename('gdc.othersort.bam')
++        pybedtools.contrib.bigwig.bam_to_bigwig(fn, genome='dm3', output='tmp.bw')
++        x = pybedtools.contrib.bigwig.bigwig_to_bedgraph('tmp.bw')
++        assert x == fix(
++            '''
++            chr2L   70      75      1
++            chr2L   140     145     1
++            chr2L   150     155     1
++            chr2L   160     165     1
++            chr2L   210     215     1
++            chrX    10      15      1
++            chrX    70      75      1
++            chrX    140     145     1
++            ''')
++        os.unlink('tmp.bw')
++
++    # If bedGraphToBigWig is not on the path, see
++    # https://github.com/daler/pybedtools/issues/227
++    except FileNotFoundError:
++        pass
+ 
+ def test_issue_203():
+     x = pybedtools.example_bedtool('x.bed')


=====================================
debian/patches/series
=====================================
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ enable-package-data
 disable-write-version
 disable-test-156
 rename-scripts
+c8dff864dbc942bb7adb3e719b0702f7e3989d36.patch


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -5,9 +5,8 @@ DH_VERBOSE := 1
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 export PYBUILD_NAME=pybedtools
 export MATPLOTLIBRC=$(CURDIR)/debian/
-# test_issue_178 fails, issue opened at upstream
-#   https://github.com/daler/pybedtools/issues/227
-export PYBUILD_TEST_ARGS=--attr '!url' --exclude='(test_issue_178)'
+# Add back test_issue_178 after upstream provided a patch https://github.com/daler/pybedtools/pull/228
+export PYBUILD_TEST_ARGS=--attr '!url' # --exclude='(test_issue_178)'
 export PYBUILD_BEFORE_TEST=cp {dir}/debian/mpl-expected.png {build_dir}/pybedtools/test/
 export HOME=$(shell echo $$PWD"/fakehome")
 



View it on GitLab: https://salsa.debian.org/med-team/python-pybedtools/compare/f2ad9e590dd66dd14d811c1e5c1995062d6e2278...57355f023cf5fb0cad5ec0fefc0334b5be8dcd2c

---
View it on GitLab: https://salsa.debian.org/med-team/python-pybedtools/compare/f2ad9e590dd66dd14d811c1e5c1995062d6e2278...57355f023cf5fb0cad5ec0fefc0334b5be8dcd2c
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/debian-med-commit/attachments/20180312/163f0f21/attachment-0001.html>


More information about the debian-med-commit mailing list