On Fri, Jul 28, 2017 at 01:37:54PM -0700, Steve Langasek wrote:
> One additional patch required: the previous version built fine locally in a
> terminal, but when dispatched to a builder, the build failed because the
> test suite is testing functions that only output anything when stdin is a
> tty.  Since this is clearly deliberate behavior in the code, I'm updating
> the test suite to match.

Well, and one more.  This package now built fine, but the autopkgtests
correctly caught that the python2 module was unusable because library
dependencies could not be resolved.  Adding some compat symlinks solves
this.

The python3 package was unaffected by this because python3 has native
support for the collision-free library naming.

Attached is now a complete debdiff.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
[email protected]                                     [email protected]
diff -Nru python-pysam-0.10.0+ds/debian/control 
python-pysam-0.11.2.2/debian/control
--- python-pysam-0.10.0+ds/debian/control       2017-05-04 06:06:21.000000000 
-0700
+++ python-pysam-0.11.2.2/debian/control        2017-07-28 18:55:54.000000000 
-0700
@@ -8,6 +8,7 @@
 Priority: optional
 Build-Depends:
        debhelper (>= 9),
+       dh-exec,
        dh-python,
        libhts-dev (>= 1.3.2),
        zlib1g-dev,
diff -Nru 
python-pysam-0.10.0+ds/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch
 
python-pysam-0.11.2.2/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch
--- 
python-pysam-0.10.0+ds/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch
  2017-05-04 06:06:21.000000000 -0700
+++ 
python-pysam-0.11.2.2/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch
   1969-12-31 16:00:00.000000000 -0800
@@ -1,29 +0,0 @@
-Description: Exclude test tyring to access remote ftpserver
-Bug-Debian: https://bugs.debian.org/861496
-Author: Andreas Tille <[email protected]>
-Last-Update: Thu, 04 May 2017 12:50:22 +0200
-
---- a/tests/faidx_test.py
-+++ b/tests/faidx_test.py
-@@ -216,21 +216,5 @@ class TestFastxFileWithEmptySequence(uni
-         self.assertEqual(ref_num, l)
- 
- 
--class TestRemoteFileFTP(unittest.TestCase):
--    '''test remote access.
--    '''
--
--    url = 
"ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/technical/reference/GRCh38_reference_genome/GRCh38_full_analysis_set_plus_decoy_hla.fa";
--
--
--    def testFTPView(self):
--        if not checkURL(self.url):
--            return
--        with pysam.Fastafile(self.url) as f:
--            self.assertEqual(
--                len(f.fetch("chr1", 0, 1000)),
--                1000)
--
--
- if __name__ == "__main__":
-     unittest.main()
diff -Nru python-pysam-0.10.0+ds/debian/patches/htslib-external-config.patch 
python-pysam-0.11.2.2/debian/patches/htslib-external-config.patch
--- python-pysam-0.10.0+ds/debian/patches/htslib-external-config.patch  
2017-05-04 06:06:21.000000000 -0700
+++ python-pysam-0.11.2.2/debian/patches/htslib-external-config.patch   
1969-12-31 16:00:00.000000000 -0800
@@ -1,15 +0,0 @@
-Description: Do not use internal htslib library
-Author: Afif Elghraoui <[email protected]>
-Forwarded: not-needed
-Last-Update: 2017-01-26
---- python-pysam.orig/setup.py
-+++ python-pysam/setup.py
-@@ -255,7 +255,7 @@
- else:
-     raise ValueError("unknown HTSLIB value '%s'" % HTSLIB_MODE)
- 
--internal_htslib_libraries = 
[os.path.splitext("chtslib{}".format(sysconfig.get_config_var('SO')))[0]]
-+internal_htslib_libraries = []
- 
- # build config.py
- with open(os.path.join("pysam", "config.py"), "w") as outf:
diff -Nru python-pysam-0.10.0+ds/debian/patches/no-usage-test-without-tty.patch 
python-pysam-0.11.2.2/debian/patches/no-usage-test-without-tty.patch
--- python-pysam-0.10.0+ds/debian/patches/no-usage-test-without-tty.patch       
1969-12-31 16:00:00.000000000 -0800
+++ python-pysam-0.11.2.2/debian/patches/no-usage-test-without-tty.patch        
2017-07-28 13:36:09.000000000 -0700
@@ -0,0 +1,21 @@
+Description: skip usage() tests on autobuilders
+ The usage() functions check whether stdin is a tty before displaying usage
+ information.  Therefore, we should not test this code when running on an
+ autobuilder without a tty.
+ .
+ Clever allocation of a pty from within the test suite itself for purposes
+ of testing this path is left as an exercise for the reader.
+Author: Steve Langasek <[email protected]>
+
+Index: python-pysam-0.11.2.2/tests/samtools_test.py
+===================================================================
+--- python-pysam-0.11.2.2.orig/tests/samtools_test.py
++++ python-pysam-0.11.2.2/tests/samtools_test.py
+@@ -245,6 +245,7 @@
+             self.check_statement(statement)
+ 
+     @unittest.skipIf(sys.platform == "darwin", "not supported, pattern does 
not match")
++    @unittest.skipIf(not sys.stdin.isatty(), "skipping usage tests, stdin is 
not a tty")
+     def testUsage(self):
+         if self.executable == "bcftools":
+             # bcftools usage messages end with exit(1)
diff -Nru python-pysam-0.10.0+ds/debian/patches/pysam_stdout_linkage.patch 
python-pysam-0.11.2.2/debian/patches/pysam_stdout_linkage.patch
--- python-pysam-0.10.0+ds/debian/patches/pysam_stdout_linkage.patch    
1969-12-31 16:00:00.000000000 -0800
+++ python-pysam-0.11.2.2/debian/patches/pysam_stdout_linkage.patch     
2017-07-28 10:12:35.000000000 -0700
@@ -0,0 +1,28 @@
+Description: fix missing symbols in libcsamtools and libcbcftools libraries
+ Building on Ubuntu fails because a couple of the .sos wind up with
+ unresolved references to symbols found elsewhere in the tree.  Fix their
+ linkage so that they load cleanly.
+Author: Steve Langasek <[email protected]>
+
+Index: python-pysam-0.11.2.2/setup.py
+===================================================================
+--- python-pysam-0.11.2.2.orig/setup.py
++++ python-pysam-0.11.2.2/setup.py
+@@ -463,6 +463,7 @@
+ csamtools = Extension(
+     "pysam.libcsamtools",
+     [source_pattern % "samtools"] +
++    ["pysam/pysam_util.c"] +
+     glob.glob(os.path.join("samtools", "*.pysam.c")) +
+     htslib_sources +
+     os_c_files,
+@@ -484,7 +485,8 @@
+     library_dirs=["pysam"] + htslib_library_dirs,
+     include_dirs=["bcftools", "pysam", "."] +
+     include_os + htslib_include_dirs,
+-    libraries=external_htslib_libraries + internal_htslib_libraries,
++    libraries=external_htslib_libraries + internal_htslib_libraries + \
++    [os.path.splitext("csamtools{}".format(suffix))[0]],
+     language="c",
+     extra_compile_args=extra_compile_args,
+     define_macros=define_macros
diff -Nru python-pysam-0.10.0+ds/debian/patches/rpath.patch 
python-pysam-0.11.2.2/debian/patches/rpath.patch
--- python-pysam-0.10.0+ds/debian/patches/rpath.patch   2017-05-04 
06:06:21.000000000 -0700
+++ python-pysam-0.11.2.2/debian/patches/rpath.patch    1969-12-31 
16:00:00.000000000 -0800
@@ -1,32 +0,0 @@
-Description: Disable setting rpath
-Author: Afif Elghraoui <[email protected]>
-Forwarded: not-needed
-Last-Update: 2016-03-05
---- python-pysam.orig/cy_build.py
-+++ python-pysam/cy_build.py
-@@ -57,7 +57,7 @@
-             ext._init_func(ext)
- 
-         if not self.inplace:
--            ext.library_dirs.append(os.path.join(self.build_lib, "pysam"))
-+            pass
- 
-         if sys.platform == 'darwin':
-             relative_module_path = ext.name.replace(".", os.sep) + 
get_config_vars()["SO"]
-@@ -85,6 +85,5 @@
-             if not ext.extra_link_args:
-                 ext.extra_link_args = []
- 
--            ext.extra_link_args += ['-Wl,-rpath,$ORIGIN']
-                                     
-         build_ext.build_extension(self, ext)
---- python-pysam.orig/setup.py
-+++ python-pysam/setup.py
-@@ -353,7 +353,6 @@
-     shared_htslib_sources +
-     os_c_files,
-     library_dirs=htslib_library_dirs,
--    runtime_library_dirs=htslib_library_dirs,
-     include_dirs=["pysam", "."] + include_os + htslib_include_dirs,
-     libraries=external_htslib_libraries,
-     language="c",
diff -Nru python-pysam-0.10.0+ds/debian/patches/series 
python-pysam-0.11.2.2/debian/patches/series
--- python-pysam-0.10.0+ds/debian/patches/series        2017-05-04 
06:06:21.000000000 -0700
+++ python-pysam-0.11.2.2/debian/patches/series 2017-07-28 13:32:34.000000000 
-0700
@@ -1,3 +1,2 @@
-rpath.patch
-htslib-external-config.patch
-exclude_test_tyring_to_access_remote_ftpserver.patch
+pysam_stdout_linkage.patch
+no-usage-test-without-tty.patch
diff -Nru python-pysam-0.10.0+ds/debian/python-pysam.links 
python-pysam-0.11.2.2/debian/python-pysam.links
--- python-pysam-0.10.0+ds/debian/python-pysam.links    1969-12-31 
16:00:00.000000000 -0800
+++ python-pysam-0.11.2.2/debian/python-pysam.links     2017-07-28 
19:53:07.000000000 -0700
@@ -0,0 +1,3 @@
+#!/usr/bin/dh-exec
+/usr/lib/python2.7/dist-packages/pysam/libcsamtools.${DEB_HOST_GNU_TYPE}.so 
/usr/lib/python2.7/dist-packages/pysam/libcsamtools.so
+/usr/lib/python2.7/dist-packages/pysam/libcbcftools.${DEB_HOST_GNU_TYPE}.so 
/usr/lib/python2.7/dist-packages/pysam/libcbcftools.so

Attachment: signature.asc
Description: PGP signature

Reply via email to