[med-svn] [python-biopython] 02/05: Apply two upstream patches to deal with change in BWA output

Andreas Tille tille at debian.org
Tue Nov 7 10:51:49 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository python-biopython.

commit 314130a1006bbd1ce5fed2c0abdc83c4f5707efe
Author: Andreas Tille <tille at debian.org>
Date:   Tue Nov 7 13:16:28 2017 +0100

    Apply two upstream patches to deal with change in BWA output
---
 debian/changelog                                   |  2 +
 .../0dbcdbaa00b2749f82bd7936128d1fd45c82deca.patch | 60 ++++++++++++++++++++++
 .../24aba217c82522eb4cfbfc0d73197a6c3f96fb8a.patch | 54 +++++++++++++++++++
 debian/patches/series                              |  2 +
 4 files changed, 118 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index ebb9974..f40627c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ python-biopython (1.70+dfsg-3) UNRELEASED; urgency=medium
 
   * Copy *.rst doc files.
     Closes: #872222
+  * Apply two upstream patches to deal with change in BWA output
+    Closes: #880236
 
  -- Andreas Tille <tille at debian.org>  Tue, 07 Nov 2017 09:57:50 +0100
 
diff --git a/debian/patches/0dbcdbaa00b2749f82bd7936128d1fd45c82deca.patch b/debian/patches/0dbcdbaa00b2749f82bd7936128d1fd45c82deca.patch
new file mode 100644
index 0000000..6d26b31
--- /dev/null
+++ b/debian/patches/0dbcdbaa00b2749f82bd7936128d1fd45c82deca.patch
@@ -0,0 +1,60 @@
+From: Saket Choudhary <saketkc at gmail.com>
+Date: Tue, 31 Oct 2017 17:47:28 -0700
+Subject: [PATCH] Fix BWA tests to use returncode
+Origin: https://github.com/biopython/biopython/issues/1431
+Bug-Debian: https://bugs.debian.org/880236
+
+Upstream changes to stdout and stderr are flaky and hence
+returncode should be checked instead.
+
+Fixes #1431
+
+Signed-off-by: Saket Choudhary <saketkc at gmail.com>
+---
+ Tests/test_BWA_tool.py | 22 ++++++++++++++--------
+ 1 file changed, 14 insertions(+), 8 deletions(-)
+
+--- a/Tests/test_BWA_tool.py
++++ b/Tests/test_BWA_tool.py
+@@ -91,15 +91,20 @@ class BwaTestCase(unittest.TestCase):
+         cmdline = BwaIndexCommandline(bwa_exe)
+         cmdline.set_parameter("infile", self.reference_file)
+         cmdline.set_parameter("algorithm", "bwtsw")
++        try:
++            stdout, stderr = cmdline()
++        except ApplicationError as err:
++            self.assertTrue(err.returncode == 0,
++                            "FASTA indexing failed:\n%s\nStdout:%s\nStderr:%s\n"
++                            % (cmdline, stdout, stderr))
++
++
+         stdout, stderr = cmdline()
+         for extension in self.reference_extensions:
+             index_file = self.reference_file + "." + extension
+             self.assertTrue(os.path.exists(index_file),
+                             "Index File %s not found"
+                             % (index_file))
+-        self.assertTrue(stdout.startswith("[bwt_gen]"),
+-                        "FASTA indexing failed:\n%s\nStdout:%s"
+-                        % (cmdline, stdout))
+ 
+     def do_aln(self, in_file, out_file):
+         """Test for generating sai files given the reference and read file"""
+@@ -107,11 +112,12 @@ class BwaTestCase(unittest.TestCase):
+         cmdline.set_parameter("reference", self.reference_file)
+         cmdline.read_file = in_file
+         self.assertTrue(os.path.isfile(in_file))
+-        stdout, stderr = cmdline(stdout=out_file)
+-
+-        self.assertTrue("fail to locate the index" not in stderr,
+-                        "Error aligning sequence to reference:\n%s\nStderr:%s"
+-                        % (cmdline, stderr))
++        try:
++            stdout, stderr = cmdline(stdout=out_file)
++        except ApplicationError as err:
++            self.assertTrue(err.returncode == 0,
++                            "Error aligning sequence to reference:\n%s\nStdout:%s\nStderr:%s\n"
++                            % (cmdline, stdout, stderr))
+ 
+     def create_fasta_index(self):
+         """Creates index for fasta file.
diff --git a/debian/patches/24aba217c82522eb4cfbfc0d73197a6c3f96fb8a.patch b/debian/patches/24aba217c82522eb4cfbfc0d73197a6c3f96fb8a.patch
new file mode 100644
index 0000000..45363fc
--- /dev/null
+++ b/debian/patches/24aba217c82522eb4cfbfc0d73197a6c3f96fb8a.patch
@@ -0,0 +1,54 @@
+From: Saket Choudhary <saketkc at gmail.com>
+Date: Thu, 2 Nov 2017 20:20:06 -0700
+Subject: [PATCH] Fix BWA tests to check for messages in both stdout and stderr
+Origin: https://github.com/biopython/biopython/issues/1431
+Bug-Debian: https://bugs.debian.org/880236
+
+---
+ Tests/test_BWA_tool.py | 22 ++++++++--------------
+ 1 file changed, 8 insertions(+), 14 deletions(-)
+
+--- a/Tests/test_BWA_tool.py
++++ b/Tests/test_BWA_tool.py
+@@ -91,20 +91,15 @@ class BwaTestCase(unittest.TestCase):
+         cmdline = BwaIndexCommandline(bwa_exe)
+         cmdline.set_parameter("infile", self.reference_file)
+         cmdline.set_parameter("algorithm", "bwtsw")
+-        try:
+-            stdout, stderr = cmdline()
+-        except ApplicationError as err:
+-            self.assertTrue(err.returncode == 0,
+-                            "FASTA indexing failed:\n%s\nStdout:%s\nStderr:%s\n"
+-                            % (cmdline, stdout, stderr))
+-
+-
+         stdout, stderr = cmdline()
+         for extension in self.reference_extensions:
+             index_file = self.reference_file + "." + extension
+             self.assertTrue(os.path.exists(index_file),
+                             "Index File %s not found"
+                             % (index_file))
++        self.assertTrue('Finished constructing BWT' in str(stdout)+str(stderr),
++                        "FASTA indexing failed:\n%s\nStdout:%s\nStderr:%s\n"
++                        % (cmdline, stdout, stderr))
+ 
+     def do_aln(self, in_file, out_file):
+         """Test for generating sai files given the reference and read file"""
+@@ -112,12 +107,11 @@ class BwaTestCase(unittest.TestCase):
+         cmdline.set_parameter("reference", self.reference_file)
+         cmdline.read_file = in_file
+         self.assertTrue(os.path.isfile(in_file))
+-        try:
+-            stdout, stderr = cmdline(stdout=out_file)
+-        except ApplicationError as err:
+-            self.assertTrue(err.returncode == 0,
+-                            "Error aligning sequence to reference:\n%s\nStdout:%s\nStderr:%s\n"
+-                            % (cmdline, stdout, stderr))
++        stdout, stderr = cmdline(stdout=out_file)
++
++        self.assertTrue("fail to locate the index" not in str(stderr)+str(stdout),
++                        "Error aligning sequence to reference:\n%s\nStdout:%s\nStderr:%s\n"
++                        % (cmdline, stdout, stderr))
+ 
+     def create_fasta_index(self):
+         """Creates index for fasta file.
diff --git a/debian/patches/series b/debian/patches/series
index f9f0bf7..8e035f9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,5 @@
 remove_mathml-qname.patch
 privacy_breach.patch
 #test_phenotype_fit_on_arm64.patch
+0dbcdbaa00b2749f82bd7936128d1fd45c82deca.patch
+24aba217c82522eb4cfbfc0d73197a6c3f96fb8a.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-biopython.git



More information about the debian-med-commit mailing list