[med-svn] [Git][med-team/libsonlib][master] Attempt to fix import issues with python tests

Shayan Doust gitlab at salsa.debian.org
Fri Jun 26 17:33:55 BST 2020



Shayan Doust pushed to branch master at Debian Med / libsonlib


Commits:
5145d390 by Shayan Doust at 2020-06-26T17:33:28+01:00
Attempt to fix import issues with python tests

- - - - -


1 changed file:

- debian/patches/2to3.patch


Changes:

=====================================
debian/patches/2to3.patch
=====================================
@@ -4,33 +4,15 @@ Description: Port to Python3
 
 --- libsonlib.orig/treeTest.py
 +++ libsonlib/treeTest.py
-@@ -7,16 +7,16 @@
- import unittest
- import random
- 
--from tree import remodelTreeRemovingRoot
--from tree import binaryTree_depthFirstNumbers
--from tree import mapTraversalIDsBetweenTrees
--from tree import BinaryTree
--from bioio import printBinaryTree
--from bioio import newickTreeParser
--from misc import close
--from tree import moveRoot
--from tree import calculateDupsAndLossesByReconcilingTrees
--from tree import calculateProbableRootOfGeneTree
-+from .tree import remodelTreeRemovingRoot
-+from .tree import binaryTree_depthFirstNumbers
-+from .tree import mapTraversalIDsBetweenTrees
-+from .tree import BinaryTree
-+from .bioio import printBinaryTree
-+from .bioio import newickTreeParser
-+from .misc import close
-+from .tree import moveRoot
-+from .tree import calculateDupsAndLossesByReconcilingTrees
-+from .tree import calculateProbableRootOfGeneTree
- from sonLib.bioio import TestStatus
+@@ -17,7 +17,7 @@
+ from tree import moveRoot
+ from tree import calculateDupsAndLossesByReconcilingTrees
+ from tree import calculateProbableRootOfGeneTree
+-from sonLib.bioio import TestStatus
++from bioio import TestStatus
  
  class TestCase(unittest.TestCase):
+     
 @@ -29,29 +29,29 @@
          unittest.TestCase.tearDown(self)
          
@@ -110,29 +92,19 @@ Description: Port to Python3
              geneTree = getRandomTree()
 --- libsonlib.orig/allTests.py
 +++ libsonlib/allTests.py
-@@ -5,16 +5,16 @@
- #Released under the MIT license, see LICENSE.txt
- import unittest
- 
--import bioioTest
--import cigarsTest
--import treeTest
--import kvdbTest
-+from . import bioioTest
-+from . import cigarsTest
-+from . import treeTest
-+from . import kvdbTest
- import socket
- try:
-     import networkx as NX
-     networkx_installed = True
--    import nxtreeTest
--    import nxnewickTest
-+    from . import nxtreeTest
-+    from . import nxnewickTest
+@@ -18,9 +18,9 @@
  except ImportError:
      networkx_installed = False
  
+-from sonLib.bioio import system
+-from sonLib.bioio import parseSuiteTestOptions
+-from sonLib.bioio import getLogLevelString
++from bioio import system
++from bioio import parseSuiteTestOptions
++from bioio import getLogLevelString
+ 
+ 
+ class TestCase(unittest.TestCase):        
 --- libsonlib.orig/sonLib_daemonize.py
 +++ libsonlib/sonLib_daemonize.py
 @@ -66,7 +66,7 @@
@@ -146,15 +118,20 @@ Description: Port to Python3
      if pid > 0:
 --- libsonlib.orig/nxnewick.py
 +++ libsonlib/nxnewick.py
-@@ -14,7 +14,7 @@
+@@ -13,11 +13,11 @@
+ import math
  import random
  from string import whitespace as ws
- from sonLib.misc import close
--import bioio
-+from . import bioio
+-from sonLib.misc import close
++from misc import close
+ import bioio
  import networkx as NX
  from optparse import OptionParser
- from sonLib.nxtree import NXTree
+-from sonLib.nxtree import NXTree
++from nxtree import NXTree
+ 
+ 
+ class NXNewick(object):
 @@ -187,15 +187,15 @@
      parser.parseFile(args[0])
      NX.drawing.nx_agraph.write_dot(parser.nxTree.nxDg, args[1])
@@ -179,17 +156,6 @@ Description: Port to Python3
  if __name__ == '__main__':    
 --- libsonlib.orig/bioio.py
 +++ libsonlib/bioio.py
-@@ -16,8 +16,8 @@
- import shutil
- from argparse import ArgumentParser
- from optparse import OptionParser, OptionContainer, OptionGroup
--from tree import BinaryTree
--from misc import close
-+from .tree import BinaryTree
-+from .misc import close
- import subprocess
- import array
- import string
 @@ -421,14 +421,14 @@
  def getRandomAlphaNumericString(length=10):
      """Returns a random alpha numeric string of the given length.
@@ -350,58 +316,15 @@ Description: Port to Python3
  #########################################################
 --- libsonlib.orig/bioioTest.py
 +++ libsonlib/bioioTest.py
-@@ -11,32 +11,32 @@
- import random
- import math
+@@ -33,7 +33,7 @@
+ from bioio import PairwiseAlignment
+ from bioio import getRandomPairwiseAlignment
  
--from bioio import getTempFile
--from bioio import getTempDirectory
--from bioio import TempFileTree
--from bioio import getRandomAlphaNumericString
-+from .bioio import getTempFile
-+from .bioio import getTempDirectory
-+from .bioio import TempFileTree
-+from .bioio import getRandomAlphaNumericString
- 
--from bioio import fastaRead
--from bioio import fastaWrite 
--from bioio import fastqRead
--from bioio import fastqWrite 
--from bioio import getRandomSequence
-+from .bioio import fastaRead
-+from .bioio import fastaWrite 
-+from .bioio import fastqRead
-+from .bioio import fastqWrite 
-+from .bioio import getRandomSequence
- 
--from bioio import pWMRead
--from bioio import pWMWrite
-+from .bioio import pWMRead
-+from .bioio import pWMWrite
- 
--from bioio import newickTreeParser
--from bioio import printBinaryTree
-+from .bioio import newickTreeParser
-+from .bioio import printBinaryTree
- 
--from bioio import cigarRead
--from bioio import cigarWrite
--from bioio import PairwiseAlignment
--from bioio import getRandomPairwiseAlignment
-+from .bioio import cigarRead
-+from .bioio import cigarWrite
-+from .bioio import PairwiseAlignment
-+from .bioio import getRandomPairwiseAlignment
- 
- from sonLib.bioio import TestStatus
- 
--from bioio import system
--from bioio import logger
-+from .bioio import system
-+from .bioio import logger
+-from sonLib.bioio import TestStatus
++from bioio import TestStatus
  
- class TestCase(unittest.TestCase):
-     
+ from bioio import system
+ from bioio import logger
 @@ -61,12 +61,12 @@
      #########################################################
      
@@ -537,24 +460,17 @@ Description: Port to Python3
      unittest.main()
 --- libsonlib.orig/cigarsTest.py
 +++ libsonlib/cigarsTest.py
-@@ -10,12 +10,12 @@
- import sys
- import random
- 
--from bioio import getTempFile
-+from .bioio import getTempFile
- 
--from bioio import cigarRead
--from bioio import cigarWrite
--from bioio import getRandomPairwiseAlignment
--from bioio import system
-+from .bioio import cigarRead
-+from .bioio import cigarWrite
-+from .bioio import getRandomPairwiseAlignment
-+from .bioio import system
- from sonLib.bioio import TestStatus
- from sonLib.bioio import logger
+@@ -16,8 +16,8 @@
+ from bioio import cigarWrite
+ from bioio import getRandomPairwiseAlignment
+ from bioio import system
+-from sonLib.bioio import TestStatus
+-from sonLib.bioio import logger
++from bioio import TestStatus
++from bioio import logger
  
+ class TestCase(unittest.TestCase):
+     
 @@ -36,9 +36,9 @@
          """
          tempFile = getTempFile()
@@ -570,6 +486,15 @@ Description: Port to Python3
              keepProbs = random.random() > 0.5
 --- libsonlib.orig/tree.py
 +++ libsonlib/tree.py
+@@ -10,7 +10,7 @@
+ import math
+ import random
+ 
+-from sonLib.misc import close
++from misc import close
+ #import bioio
+ 
+ #########################################################
 @@ -69,7 +69,7 @@
          return mid+1, leafNo+1
      traverse(binaryTree)
@@ -786,24 +711,6 @@ Description: Port to Python3
      def fn4(newTree):
          if newTree.internal:
              fn4(newTree.left)
-@@ -596,7 +596,7 @@
-     """
-     Node is mid order number
-     """
--    import bioio
-+    from . import bioio
-     assert root.traversalID.mid != node
-     hash = {}
-     def fn(bT):
-@@ -632,7 +632,7 @@
-     """
-     Removes the old root and places the new root at the mid point along the given branch
-     """
--    import bioio
-+    from . import bioio
-     if root.traversalID.mid == branch:
-         return bioio.newickTreeParser(bioio.printBinaryTree(root, True))
-     def fn2(tree, seq):
 @@ -703,7 +703,7 @@
              if nodes.issubset(a[speciesTree.right.traversalID.mid]):
                  return fn2(nodes, speciesTree.right)
@@ -850,3 +757,53 @@ Description: Port to Python3
  
  ${binPath}/sonLib_daemonize.py : sonLib_daemonize.py cP
  	cp sonLib_daemonize.py ${binPath}/sonLib_daemonize.py
+--- libsonlib.orig/kvdbTest.py
++++ libsonlib/kvdbTest.py
+@@ -10,7 +10,7 @@
+ import sys
+ import socket
+ 
+-from sonLib.bioio import system
++from bioio import system
+ 
+ class TestCase(unittest.TestCase):
+     
+--- libsonlib.orig/misc.py
++++ libsonlib/misc.py
+@@ -21,7 +21,7 @@
+     """
+     function for finding external location
+     """
+-    import sonLib.bioio
++    import bioio
+     i = os.path.abspath(sonLib.bioio.__file__)
+     return os.path.split(os.path.split(os.path.split(i)[0])[0])[0]
+ 
+--- libsonlib.orig/nxnewickTest.py
++++ libsonlib/nxnewickTest.py
+@@ -9,9 +9,9 @@
+ import re
+ from string import whitespace as ws
+ 
+-from sonLib.nxnewick import NXNewick
+-from sonLib.bioio import TestStatus
+-from sonLib.bioio import logger
++from nxnewick import NXNewick
++from bioio import TestStatus
++from bioio import logger
+ 
+ class TestCase(unittest.TestCase):
+     
+--- libsonlib.orig/nxtreeTest.py
++++ libsonlib/nxtreeTest.py
+@@ -9,8 +9,8 @@
+ import copy
+ 
+ import networkx as NX
+-from sonLib.nxtree import NXTree
+-from sonLib.bioio import TestStatus
++from nxtree import NXTree
++from bioio import TestStatus
+ 
+ class TestCase(unittest.TestCase):
+     



View it on GitLab: https://salsa.debian.org/med-team/libsonlib/-/commit/5145d390a8cde350f916a0e40804d405cae6f684

-- 
View it on GitLab: https://salsa.debian.org/med-team/libsonlib/-/commit/5145d390a8cde350f916a0e40804d405cae6f684
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/20200626/2a83cd0c/attachment-0001.html>


More information about the debian-med-commit mailing list