Andreas Tille pushed to branch master at Debian Med / lastz


Commits:
264748ed by Andreas Tille at 2020-06-15T15:07:58+02:00
2to3 for test scripts, Build-Depends: python3

- - - - -


2 changed files:

- debian/control
- debian/patches/2to3.patch


Changes:

=====================================
debian/control
=====================================
@@ -3,7 +3,8 @@ Section: science
 Priority: optional
 Maintainer: Debian Med Packaging Team 
<[email protected]>
 Uploaders: Andreas Tille <[email protected]>
-Build-Depends: debhelper-compat (= 13)
+Build-Depends: debhelper-compat (= 13),
+               python3 <!nocheck>
 Standards-Version: 4.5.0
 Vcs-Browser: https://salsa.debian.org/med-team/lastz
 Vcs-Git: https://salsa.debian.org/med-team/lastz.git


=====================================
debian/patches/2to3.patch
=====================================
@@ -31,6 +31,17 @@ Description: 2to3 for test suite
  """
  Compare two axt files, reporting differences but ignoring some trivial ones
  ---------------------------------------------------------------------------
+@@ -36,8 +36,8 @@ def main():
+ 
+       # compare the files
+ 
+-      axt1 = file(axt1Filename,"rt")
+-      axt2 = file(axt2Filename,"rt")
++      axt1 = open(axt1Filename,"rt")
++      axt2 = open(axt2Filename,"rt")
+       different = compare_files(axt1,axt2,sortEm=sortEm)
+       axt1.close()
+       axt2.close()
 @@ -56,11 +56,11 @@ def main():
                        % (axt1Filename,axt2Filename)
  
@@ -54,6 +65,15 @@ Description: 2to3 for test suite
  """
  Build a "hashed sequence index" (hsx) file for a fasta file
  -----------------------------------------------------------
+@@ -165,7 +165,7 @@ def main():
+                       f = sys.stdin
+               else:
+                       try:
+-                              f = file(fileName,"rt")
++                              f = open(fileName,"rt")
+                       except IOError:
+                               assert (False), "unable to open %s" % fileName
+ 
 @@ -183,26 +183,26 @@ def main():
  
                        if (length == 0):
@@ -275,6 +295,15 @@ Description: 2to3 for test suite
  """
  Given a list of intervals, mask those bases in the fasta sequence(s).
  """
+@@ -69,7 +69,7 @@ def main():
+ 
+       # read the intervals
+ 
+-      f = file(intervalsFile,"rt")
++      f = open(intervalsFile,"rt")
+ 
+       chromToIntervals = {}
+ 
 @@ -130,12 +130,12 @@ def main():
                        prevEnd = end
                if (prevEnd < len(seq)):   newSeq += [seq[prevEnd:]]
@@ -298,7 +327,16 @@ Description: 2to3 for test suite
  """
  Compare two gfa files, reporting differences but ignoring some trivial ones
  ---------------------------------------------------------------------------
-@@ -43,12 +43,12 @@ def main():
+@@ -36,19 +36,19 @@ def main():
+ 
+       # compare the files
+ 
+-      gfa1 = file(gfa1Filename,"rt")
+-      gfa2 = file(gfa2Filename,"rt")
++      gfa1 = open(gfa1Filename,"rt")
++      gfa2 = open(gfa2Filename,"rt")
+ 
+       if (sortEm): (different,lineNum) = compare_unsorted_files(gfa1,gfa2)
        else:        (different,lineNum) = compare_sorted_files  (gfa1,gfa2)
  
        if (different):
@@ -342,7 +380,7 @@ Description: 2to3 for test suite
  """
  "Hashed sequence index" (hsx) file reader (for a fasta file)
  -------------------------------------------------------------------
-@@ -87,9 +87,9 @@ class HsxFile(object):
+@@ -87,13 +87,13 @@ class HsxFile(object):
                else:               self.debug = debug
                self.open()
  
@@ -355,6 +393,11 @@ Description: 2to3 for test suite
        msBit5      = 0x80 << (4*8)
  
        def open(self):
+-              self.file = file(self.fileName,"rb")
++              self.file = open(self.fileName,"rb")
+ 
+               self.magic = magic = struct.unpack(">L",self.file.read(4))[0]
+               if   (magic == HsxFile.magicBig):    self.byteOrder = ">" # 
(big endian)
 @@ -168,22 +168,22 @@ class HsxFile(object):
  
        def get_sequence(self,name):
@@ -408,8 +451,9 @@ Description: 2to3 for test suite
                if (seqFile == None):
                        if ("fetch" in self.debug):
 -                              print >>sys.stderr, "[  opening %s]" % 
seqFileName
+-                      seqFile = file(seqFileName,"rt")
 +                              print("[  opening %s]" % seqFileName, 
file=sys.stderr)
-                       seqFile = file(seqFileName,"rt")
++                      seqFile = open(seqFileName,"rt")
                        self.fileTable[fileIx] = (seqFileName,seqFile)
                if ("fetch" in self.debug):
 -                      print >>sys.stderr, "[  reading from %s:%012X]" \
@@ -463,6 +507,30 @@ Description: 2to3 for test suite
  """
  Compare two lav files, reporting differences but ignoring some trivial ones
  ---------------------------------------------------------------------------
+@@ -31,8 +31,8 @@ def main():
+ 
+       # compare the files
+ 
+-      lav1 = file(lav1Filename,"rt")
+-      lav2 = file(lav2Filename,"rt")
++      lav1 = open(lav1Filename,"rt")
++      lav2 = open(lav2Filename,"rt")
+ 
+       different = True
+       stanza    = None
+@@ -49,9 +49,9 @@ def main():
+               line2 = line2.rstrip()
+ 
+               if (stanza != None):
+-                      if (line1 == "}") != (line2 == "}"): break
+-                      if (line1 == "}") and (line2 == "}"):
+-                              stanza = None
++                      if (line1 == "}") != (line2 == "}"): break
++                      if (line1 == "}") and (line2 == "}"):
++                              stanza = None
+                               continue
+                       stanzaIx += 1
+ 
 @@ -79,12 +79,12 @@ def main():
                        stanzaIx = 0
  
@@ -561,6 +629,15 @@ Description: 2to3 for test suite
  """
  Select a subset of sequences from a fasta file indexed by an hsx file
  ---------------------------------------------------------------------
+@@ -44,7 +44,7 @@ def main():
+                               usage("missing a value in %s=" % arg)
+ 
+               if (arg == "--names") and (val != None):
+-                      f = file(val)
++                      f = open(val)
+                       seqNames += [line.strip() for line in f]
+                       f.close()
+               elif (arg == "--nowarn") and (val == None):
 @@ -75,11 +75,11 @@ def main():
        for name in seqNames:
                seq = hsx.get_sequence(name)
@@ -584,7 +661,7 @@ Description: 2to3 for test suite
  """
  Convert probabilities to a LASTZ scores file (including quantum scores)
  -----------------------------------------------------------------------
-@@ -263,16 +263,16 @@ def main():
+@@ -263,27 +263,27 @@ def main():
        ##########
  
        if ("debug" in debug):
@@ -606,8 +683,11 @@ Description: 2to3 for test suite
  
        ##########
        # write quantum code file
-@@ -282,8 +282,8 @@ def main():
-               codeF = file(codeName,"wt")
+       ##########
+       
+       if (codeName != None):
+-              codeF = file(codeName,"wt")
++              codeF = open(codeName,"wt")
                for sym in symbols:
                        p = symProb[sym]
 -                      print >>codeF, "%s\t%s" \



View it on GitLab: 
https://salsa.debian.org/med-team/lastz/-/commit/264748ed6f68369b8398d175b4d3245c126b6cbc

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/lastz/-/commit/264748ed6f68369b8398d175b4d3245c126b6cbc
You're receiving this email because of your account on salsa.debian.org.


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to