[med-svn] [Git][med-team/bowtie2][master] 2 commits: Use 2to3 to port to Python3

Andreas Tille gitlab at salsa.debian.org
Wed Sep 4 15:00:10 BST 2019



Andreas Tille pushed to branch master at Debian Med / bowtie2


Commits:
f563928b by Andreas Tille at 2019-09-04T13:21:43Z
Use 2to3 to port to Python3

- - - - -
a96c63da by Andreas Tille at 2019-09-04T13:22:06Z
Remove obsolete fields Name, Contact from debian/upstream/metadata.
- - - - -


4 changed files:

- debian/changelog
- + debian/patches/2to3.patch
- debian/patches/series
- debian/upstream/metadata


Changes:

=====================================
debian/changelog
=====================================
@@ -2,17 +2,20 @@ bowtie2 (2.3.5.1-1) UNRELEASED; urgency=medium
 
   * Team upload
 
-
   [ Michael R. Crusoe ]
   * bowtie-examples: set Multi-Arch: foreign
-  * Standards-Version: 4.3.0
 
   [ Steffen Moeller ]
   * debhelper-compat 12
   * Standards-Version: 4.4.0
   * New upstream version - yet fails to build -> crash
 
- -- Michael R. Crusoe <michael.crusoe at gmail.com>  Mon, 24 Dec 2018 04:19:34 -0800
+  [ Andreas Tille ]
+  * Use 2to3 to port to Python3
+    Closes: #936233
+  * Remove obsolete fields Name, Contact from debian/upstream/metadata.
+
+ -- Andreas Tille <tille at debian.org>  Wed, 04 Sep 2019 15:18:29 +0200
 
 bowtie2 (2.3.4.3-1) unstable; urgency=medium
 


=====================================
debian/patches/2to3.patch
=====================================
@@ -0,0 +1,239 @@
+Description: Use 2to3 to port to Python3
+Bug-Debian: https://bugs.debian.org/936233
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Wed, 04 Sep 2019 15:18:29 +0200
+
+--- a/Makefile
++++ b/Makefile
+@@ -481,11 +481,11 @@ bowtie2.bat:
+ 
+ bowtie2-build.bat:
+ 	echo "@echo off" > bowtie2-build.bat
+-	echo "python %~dp0/bowtie2-build %*" >> bowtie2-build.bat
++	echo "python3 %~dp0/bowtie2-build %*" >> bowtie2-build.bat
+ 
+ bowtie2-inspect.bat:
+ 	echo "@echo off" > bowtie2-inspect.bat
+-	echo "python %~dp0/bowtie2-inspect %*" >> bowtie2-inspect.bat
++	echo "python3 %~dp0/bowtie2-inspect %*" >> bowtie2-inspect.bat
+ 
+ .PHONY: bowtie2-src-pkg
+ bowtie2-src-pkg: $(SRC_PKG_LIST)
+--- a/scripts/sa.py
++++ b/scripts/sa.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ 
+ """
+ sa.py
+@@ -15,7 +15,7 @@ import struct
+ def loadBowtieSa(fh):
+ 	""" Load a .sa file from handle into an array of ints """
+ 	nsa = struct.unpack('I', fh.read(4))[0]
+-	return [ struct.unpack('I', fh.read(4))[0] for i in xrange(0, nsa) ]
++	return [ struct.unpack('I', fh.read(4))[0] for i in range(0, nsa) ]
+ 
+ def loadBowtieSaFilename(fn):
+ 	""" Load a .sa file from filename into an array of ints """
+@@ -58,7 +58,7 @@ if __name__ == "__main__":
+ 		# Suffix array is in sas; note that $ is considered greater than all
+ 		# other characters
+ 		if ref is not None:
+-			for i in xrange(1, len(sas)):
++			for i in range(1, len(sas)):
+ 				sa1, sa2 = sas[i-1], sas[i]
+ 				assert sa1 != sa2
+ 				# Sanity check that suffixes are really in order
+@@ -76,4 +76,4 @@ if __name__ == "__main__":
+ 			assert sas[-1] == len(ref)
+ 	
+ 	go()
+-	
+\ No newline at end of file
++	
+--- a/scripts/test/README.md
++++ b/scripts/test/README.md
+@@ -17,7 +17,7 @@ They use the Python infrastructure in th
+ 
+ From root:
+ 
+-    python scripts/test/regressions.py --verbose
++    python3 scripts/test/regressions.py --verbose
+ 
+ Val Antonescu originally set these up.
+ 
+@@ -27,7 +27,7 @@ Builds an index consisting of both human
+ 
+ From root:
+ 
+-    python scripts/test/large_idx.py --verbose
++    python3 scripts/test/large_idx.py --verbose
+ 
+ #### Randomized tests
+ 
+--- a/scripts/test/benchmark/benchmarks.py
++++ b/scripts/test/benchmark/benchmarks.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """
+ A few items to deal with sets of benchmarks.
+ """
+@@ -57,7 +57,7 @@ class Benchmarks(object):
+         self.set_idx = 0
+         return self
+ 
+-    def next(self):
++    def __next__(self):
+         if self.set_idx == len(self.values):
+             raise StopIteration
+ 
+@@ -250,7 +250,7 @@ class TestAccuracy(Runable):
+                     delta = [0, 1]
+                     logging.debug("%s: missed (pos:%d vs %d)" % (q_name, orig[1], rec.pos))
+                 try:
+-                    mapq_summary[rec.mapq] = map(sum, zip(delta, mapq_summary[rec.mapq]))
++                    mapq_summary[rec.mapq] = list(map(sum, list(zip(delta, mapq_summary[rec.mapq]))))
+                 except KeyError:
+                     mapq_summary[rec.mapq] = delta
+ 
+--- a/scripts/test/benchmark/run.py
++++ b/scripts/test/benchmark/run.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """
+    Runs benchmark sets specified in JSON files.
+ 
+--- a/scripts/test/benchmark/samreader.py
++++ b/scripts/test/benchmark/samreader.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """
+ A reader of SAM format.
+ 
+@@ -49,7 +49,7 @@ class SamHeader(object):
+         self.curr_idx = 0
+         return self
+ 
+-    def next(self):
++    def __next__(self):
+         if self.curr_idx == len(self.header_lines):
+             raise StopIteration
+             
+@@ -114,7 +114,7 @@ class SamReader(object):
+         self._source_fh.seek(self.header.end_header_pointer)
+         return self
+ 
+-    def next(self):
++    def __next__(self):
+         line = self._source_fh.readline()
+         if not line:
+             raise StopIteration
+--- a/scripts/test/bt2face.py
++++ b/scripts/test/bt2face.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ 
+ import os
+ import logging
+--- a/scripts/test/btdata.py
++++ b/scripts/test/btdata.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """
+ Note: This would look so much better replaced by XML or at least JSON. But 
+       is not worth to do it for now.
+@@ -6,7 +6,7 @@ Note: This would look so much better rep
+ 
+ import os
+ import gzip
+-import urllib2
++import urllib.request, urllib.error, urllib.parse
+ import logging
+ 
+ 
+@@ -66,14 +66,14 @@ class LargeTestsData(object):
+     def init_data(self):
+         """ Try and init the data we need.
+         """
+-        for genome,gdata in self.genomes.iteritems():
++        for genome,gdata in self.genomes.items():
+             gn_path  = os.path.join(self.data_dir_path,genome)
+             gn_fasta = os.path.join(gn_path,gdata['ref_name'])
+             if not os.path.exists(gn_fasta):
+                 self._get_genome(genome)
+                 self._build_genome(genome)
+         
+-        for genome,gdata in self.joint_genomes.iteritems():
++        for genome,gdata in self.joint_genomes.items():
+             gn_path  = os.path.join(self.data_dir_path,genome)
+             gn_fasta = os.path.join(gn_path,gdata['ref_name'])
+             if not os.path.exists(gn_fasta):
+@@ -103,7 +103,7 @@ class LargeTestsData(object):
+             
+             try:
+                 f = open(fname,'wb')
+-                u = urllib2.urlopen(uri)
++                u = urllib.request.urlopen(uri)
+                 f.write(u.read())
+             except:
+                 f.close()
+--- a/scripts/test/dataface.py
++++ b/scripts/test/dataface.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ 
+ import os
+ import logging
+--- a/scripts/test/large_idx.py
++++ b/scripts/test/large_idx.py
+@@ -1,8 +1,8 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ 
+ import os
+ import gzip
+-import urllib2
++import urllib.request, urllib.error, urllib.parse
+ import inspect
+ import unittest
+ import logging
+@@ -69,7 +69,7 @@ class TestLargeIndex(unittest.TestCase):
+    
+ def get_suite():
+     tests = ['test_human','test_mouse','test_large_index']
+-    return unittest.TestSuite(map(TestLargeIndex,tests))
++    return unittest.TestSuite(list(map(TestLargeIndex,tests)))
+ 
+     
+             
+--- a/scripts/test/regressions.py
++++ b/scripts/test/regressions.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ 
+ import os
+ import inspect
+--- a/bowtie2-build
++++ b/bowtie2-build
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python3
+ 
+ """
+  Copyright 2014, Ben Langmead <langmea at cs.jhu.edu>
+--- a/bowtie2-inspect
++++ b/bowtie2-inspect
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python3
+ 
+ """
+  Copyright 2014, Ben Langmead <langmea at cs.jhu.edu>


=====================================
debian/patches/series
=====================================
@@ -4,3 +4,4 @@ hardening.patch
 reproducible.patch
 skip_test_requiring_non-free_libmath-random-perl.patch
 do-not-rebuild-during-test.patch
+2to3.patch


=====================================
debian/upstream/metadata
=====================================
@@ -1,5 +1,3 @@
-Contact: Ben Langmead <blangmea at jhsph.edu>
-Name: Bowtie2
 Reference:
   Author: Ben Langmead and Steven L Salzberg
   Title: Fast gapped-read alignment with Bowtie 2
@@ -12,11 +10,11 @@ Reference:
   URL: http://www.nature.com/nmeth/journal/v9/n4/abs/nmeth.1923.html
   ISSN: 1548-7105
 Registry:
-  - Name: SEQwiki
-    Entry: Bowtie
-  - Name: SciCrunch
-    Entry: SCR_005476
-  - Name: OMICtools
-    Entry: OMICS_31633
-  - Name: bio.tools
-    Entry: bowtie2
+- Name: SEQwiki
+  Entry: Bowtie
+- Name: SciCrunch
+  Entry: SCR_005476
+- Name: OMICtools
+  Entry: OMICS_31633
+- Name: bio.tools
+  Entry: bowtie2



View it on GitLab: https://salsa.debian.org/med-team/bowtie2/compare/2321febd4e3b249d2bb401e654914b8380b703aa...a96c63da908426d3d7d81640e3304eb8be5dfc48

-- 
View it on GitLab: https://salsa.debian.org/med-team/bowtie2/compare/2321febd4e3b249d2bb401e654914b8380b703aa...a96c63da908426d3d7d81640e3304eb8be5dfc48
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190904/b3b1c961/attachment-0001.html>


More information about the debian-med-commit mailing list