[med-svn] [Git][med-team/metastudent][master] 4 commits: Modify rules and control to build using python3 build system
Shayan Doust
gitlab at salsa.debian.org
Tue Sep 17 16:58:58 BST 2019
Shayan Doust pushed to branch master at Debian Med / metastudent
Commits:
0bceb543 by Shayan Doust at 2019-09-16T19:52:51Z
Modify rules and control to build using python3 build system
- - - - -
81c5a960 by Shayan Doust at 2019-09-16T19:53:28Z
2to3 patch
- - - - -
35ee9679 by Shayan Doust at 2019-09-16T19:57:23Z
2to3 patch
- - - - -
e031130c by Shayan Doust at 2019-09-16T19:58:22Z
Debhelper version 12
- - - - -
5 changed files:
- debian/compat
- debian/control
- + debian/patches/2to3.patch
- debian/patches/series
- debian/rules
Changes:
=====================================
debian/compat
=====================================
@@ -1 +1 @@
-11
+12
=====================================
debian/control
=====================================
@@ -4,9 +4,9 @@ Uploaders: Tobias Hamp <hampt at rostlab.org>,
Laszlo Kajan <lkajan at debian.org>
Section: science
Priority: optional
-Build-Depends-Indep: debhelper (>= 11~),
+Build-Depends-Indep: debhelper (>= 12~),
dh-python,
- python,
+ python3-all,
javahelper,
default-jdk
Standards-Version: 4.2.1
@@ -18,8 +18,8 @@ Package: metastudent
Architecture: all
Depends: ${misc:Depends},
${perl:Depends},
- ${python:Depends},
- python,
+ ${python3:Depends},
+ python3,
blast2,
default-jre,
libgo-perl (>= 0.15-3),
=====================================
debian/patches/2to3.patch
=====================================
@@ -0,0 +1,319 @@
+Description: use 2to3 to port python2 files to python3
+Author: Shayan Doust <hello at shayandoust.me>
+Bug-Debian: https://bugs.debian.org/937017
+Last-Update: 2019-09-16
+---
+
+Index: metastudent/metastudentPkg/Logger.py
+===================================================================
+--- metastudent.orig/metastudentPkg/Logger.py 2019-09-16 20:56:44.666912957 +0100
++++ metastudent/metastudentPkg/Logger.py 2019-09-16 20:56:44.662912926 +0100
+@@ -23,9 +23,9 @@
+ @classmethod
+ def log(cls, msg, level=0):
+ if level==0:
+- print msg
++ print(msg)
+ else:
+- print >> sys.stderr,msg
++ print(msg, file=sys.stderr)
+
+ #cls.internalLogger.info(msg)
+
+Index: metastudent/metastudentPkg/commons.py
+===================================================================
+--- metastudent.orig/metastudentPkg/commons.py 2019-09-16 20:56:44.666912957 +0100
++++ metastudent/metastudentPkg/commons.py 2019-09-16 20:56:44.662912926 +0100
+@@ -10,6 +10,7 @@
+ import shlex
+ import time
+ from multiprocessing.pool import Pool
++from functools import reduce
+
+ mfRoot = "GO:0003674"
+ bpRoot = "GO:0008150"
+@@ -30,12 +31,12 @@
+
+ def p(string):
+ if not silent:
+- print string
++ print(string)
+
+ def getPkgPath():
+ myPath=""
+ if hasattr(sys, "frozen"):
+- myPath = os.path.dirname(unicode(sys.executable, sys.getfilesystemencoding( )))
++ myPath = os.path.dirname(str(sys.executable, sys.getfilesystemencoding( )))
+ else:
+ myPath = os.path.dirname(os.path.abspath(__file__))
+ return myPath
+@@ -116,7 +117,7 @@
+ fastaFile = open(fastaFilePath,'w')
+ fastaFile.write("\n".join(newLines))
+ fastaFile.close()
+- except (IOError, os.error), why:
++ except (IOError, os.error) as why:
+ Logger.log("Error reading/writing fasta file " + str(why))
+
+
+@@ -131,11 +132,11 @@
+
+
+
+- termsToScoresLocal = dict([(key,val) for (key,val) in termsToScores.iteritems() if key in go.fullClosureKeys])
++ termsToScoresLocal = dict([(key,val) for (key,val) in termsToScores.items() if key in go.fullClosureKeys])
+
+
+
+- allNodes = frozenset(go.getAllParents(termsToScoresLocal.keys()) | set(termsToScoresLocal.keys()) )
++ allNodes = frozenset(go.getAllParents(list(termsToScoresLocal.keys())) | set(termsToScoresLocal.keys()) )
+
+
+
+@@ -157,11 +158,11 @@
+
+
+
+- if bpRoot in termsToScoresLocal.keys():
++ if bpRoot in list(termsToScoresLocal.keys()):
+ del termsToScoresLocal[bpRoot]
+- if mfRoot in termsToScoresLocal.keys():
++ if mfRoot in list(termsToScoresLocal.keys()):
+ del termsToScoresLocal[mfRoot]
+- if ccRoot in termsToScoresLocal.keys():
++ if ccRoot in list(termsToScoresLocal.keys()):
+ del termsToScoresLocal[ccRoot]
+
+ return termsToScoresLocal
+@@ -241,7 +242,7 @@
+ for root in allValues - set(self.fullClosure.keys()):
+ self.fullClosure[root] = set([])
+
+- self.fullClosureKeys = frozenset(self.fullClosure.keys())
++ self.fullClosureKeys = frozenset(list(self.fullClosure.keys()))
+
+ def getAllParents(self, terms):
+ returnTerms = set([])
+@@ -323,7 +324,7 @@
+ def toOutputLines(self):
+ lines = []
+ for targetId in self.targetsSorted:
+- for term, scorei in sorted(self.targetToTermToScore[targetId].items(), key=lambda x: x[1], reverse=True):
++ for term, scorei in sorted(list(self.targetToTermToScore[targetId].items()), key=lambda x: x[1], reverse=True):
+ lines.append("%s\t%s\t%.2f\n" % (decodeFastaHeader(targetId), term, scorei) )
+ return lines
+
+@@ -331,7 +332,7 @@
+ def toOutputLinesWithNames(self):
+ lines = []
+ for targetId in self.targetsSorted:
+- for term, scorei in sorted(self.targetToTermToScore[targetId].items(), key=lambda x: x[1], reverse=True):
++ for term, scorei in sorted(list(self.targetToTermToScore[targetId].items()), key=lambda x: x[1], reverse=True):
+ lines.append("%s\t%s\t%.2f\t%s\n" % (decodeFastaHeader(targetId), term, scorei, self.go.termToName.get(term, "n/a") ))
+ return lines
+
+Index: metastudent/metastudentPkg/lib/groupA/parser/group2_goParserSwissprot.py
+===================================================================
+--- metastudent.orig/metastudentPkg/lib/groupA/parser/group2_goParserSwissprot.py 2019-09-16 20:56:44.666912957 +0100
++++ metastudent/metastudentPkg/lib/groupA/parser/group2_goParserSwissprot.py 2019-09-16 20:56:44.662912926 +0100
+@@ -37,17 +37,17 @@
+ outfile.write(go+'\n'+sq+'\n')
+ sqCounter+=1
+ if (sqCounter%50000 == 0 and sqCounter!=0):
+- print("%(sqCounter)d Sequences written into %(outfile)s" % {
++ print(("%(sqCounter)d Sequences written into %(outfile)s" % {
+ 'sqCounter': sqCounter,
+- 'outfile': outfileName})
++ 'outfile': outfileName}))
+ go = ''
+ sq = ''
+ break
+ else:
+ sq = sq + line.lstrip()
+- print("%(sqCounter)d Sequences written into %(outfile)s\nfinished" % {
++ print(("%(sqCounter)d Sequences written into %(outfile)s\nfinished" % {
+ 'sqCounter': sqCounter,
+- 'outfile': outfileName})
++ 'outfile': outfileName}))
+ # close outfile
+ outfile.close()
+
+Index: metastudent/metastudentPkg/lib/groupA/parser/group2_goStatistics.py
+===================================================================
+--- metastudent.orig/metastudentPkg/lib/groupA/parser/group2_goStatistics.py 2019-09-16 20:56:44.666912957 +0100
++++ metastudent/metastudentPkg/lib/groupA/parser/group2_goStatistics.py 2019-09-16 20:56:44.662912926 +0100
+@@ -36,11 +36,11 @@
+ goPerSeqDiamFloored = int(math.floor(goPerSeqDiam))
+
+ # output of the statistics
+- print("%s protein sequences with GO term found" % seqCount)
+- print("%s protein sequences with just one GO found" % seqWithOneGo)
+- print("%(goPSDF)s GOs per sequence averagely found (%(goPSD)s)" % {
++ print(("%s protein sequences with GO term found" % seqCount))
++ print(("%s protein sequences with just one GO found" % seqWithOneGo))
++ print(("%(goPSDF)s GOs per sequence averagely found (%(goPSD)s)" % {
+ 'goPSDF': goPerSeqDiamFloored,
+- 'goPSD': goPerSeqDiam})
++ 'goPSD': goPerSeqDiam}))
+
+
+
+Index: metastudent/metastudentPkg/runMethods.py
+===================================================================
+--- metastudent.orig/metastudentPkg/runMethods.py 2019-09-16 20:56:44.666912957 +0100
++++ metastudent/metastudentPkg/runMethods.py 2019-09-16 20:56:44.662912926 +0100
+@@ -5,9 +5,9 @@
+ '''
+
+ import os
+-import commands
+-from Logger import Logger
+-from BlastWrapper import blastallParameters, createBlastPGPCommand
++import subprocess
++from .Logger import Logger
++from .BlastWrapper import blastallParameters, createBlastPGPCommand
+ from metastudentPkg.commons import p, splitBigFastaFile
+ import sys
+ import shlex
+@@ -37,7 +37,7 @@
+ #
+ # executeCommandInSGELocalAsyncJoin()
+
+- s, o = commands.getstatusoutput(blastCommand)
++ s, o = subprocess.getstatusoutput(blastCommand)
+ if s != 0:
+ Logger.log("!!!Error!!! " + blastCommand)
+ Logger.log(s)
+@@ -77,15 +77,15 @@
+ else:
+ logFile = open(logPath, 'a')
+
+- s, o = commands.getstatusoutput(commandString)
++ s, o = subprocess.getstatusoutput(commandString)
+ if True:#s != 0:
+ logFile.write("Command: " + commandString + "\n")
+ logFile.write(str(s)+"\n")
+ logFile.write(o+"\n")
+ if s != 0:
+- print >> sys.stderr,"!!!Error!!! " + commandString
+- print >> sys.stderr,str(s)
+- print >> sys.stderr,o
++ print("!!!Error!!! " + commandString, file=sys.stderr)
++ print(str(s), file=sys.stderr)
++ print(o, file=sys.stderr)
+ #raise
+ logFile.close()
+
+@@ -136,15 +136,15 @@
+ else:
+ logFile = open(logPath, 'a')
+
+- s, o = commands.getstatusoutput(commandString)
++ s, o = subprocess.getstatusoutput(commandString)
+ if True:#s != 0:
+ logFile.write("Command: " + commandString + "\n")
+ logFile.write(str(s) + "\n")
+ logFile.write(o+ "\n")
+ if s != 0:
+- print >> sys.stderr,"!!!Error!!! " + commandString
+- print >> sys.stderr,str(s)
+- print >> sys.stderr,o
++ print("!!!Error!!! " + commandString, file=sys.stderr)
++ print(str(s), file=sys.stderr)
++ print(o, file=sys.stderr)
+ #raise
+ logFile.close()
+
+@@ -180,7 +180,7 @@
+ "./CafaWrapper3.pl %s %s %s %s" % (blastOutputFilePath, outputFilePath, scoring, tmpDirPath)]
+ commandString = ";".join(commandsi)
+ if debug:
+- print >> sys.stderr, commandString
++ print(commandString, file=sys.stderr)
+ os.chdir(currCwd)
+
+ logFile=None
+@@ -190,15 +190,15 @@
+ else:
+ logFile = open(logPath, 'a')
+
+- s, o = commands.getstatusoutput(commandString)
++ s, o = subprocess.getstatusoutput(commandString)
+ if True:#s != 0:
+ logFile.write("Command: " + commandString)
+ logFile.write(str(s))
+ logFile.write(o)
+ if s != 0:
+- print >> sys.stderr, "!!!Error!!! " + commandString
+- print >> sys.stderr,str(s)
+- print >> sys.stderr,o
++ print("!!!Error!!! " + commandString, file=sys.stderr)
++ print(str(s), file=sys.stderr)
++ print(o, file=sys.stderr)
+ #raise
+ logFile.close()
+
+Index: metastudent/setup.py
+===================================================================
+--- metastudent.orig/setup.py 2019-09-16 20:56:44.666912957 +0100
++++ metastudent/setup.py 2019-09-16 20:56:44.662912926 +0100
+@@ -11,13 +11,13 @@
+ import tempfile
+
+
+-print 'Creating man page metastudent.1...'
++print('Creating man page metastudent.1...')
+ childP = Popen(["pod2man", "-c", "'User Commands'", "-r", "'%s'", "-name", "METASTUDENT", "metastudent", "metastudent.1"], stdout=PIPE, stderr=PIPE)
+ stdout, stderr = childP.communicate()
+ if childP.poll() != 0:
+- print >> sys.stderr, "Error: pod2man failed"
+- print >> sys.stderr, "Stdout: %s" % (stdout)
+- print >> sys.stderr, "Stderr: %s" % (stderr)
++ print("Error: pod2man failed", file=sys.stderr)
++ print("Stdout: %s" % (stdout), file=sys.stderr)
++ print("Stderr: %s" % (stderr), file=sys.stderr)
+ sys.exit(1)
+
+
+@@ -38,32 +38,32 @@
+ for path, dirs, files in os.walk(os.path.join(pkgPath, "lib")):
+ if "/.svn" not in path:
+ for dir in dirs:
+- os.chmod(os.path.join(path, dir),0755)
++ os.chmod(os.path.join(path, dir),0o755)
+ for filename in files:
+ if not filename.endswith(".java"):
+ filenameSplit = filename.split(".")
+ if len(filenameSplit) > 2 and "."+filenameSplit[-1] in exeSuffixes:
+- os.chmod(os.path.join(path, filename),0755)
++ os.chmod(os.path.join(path, filename),0o755)
+ else:
+- os.chmod(os.path.join(path, filename),0644)
++ os.chmod(os.path.join(path, filename),0o644)
+ dataFiles.append(os.path.relpath(os.path.join(path, filename), pkgPath))
+ if filename in executables:
+- os.chmod(os.path.join(path, filename),0755)
++ os.chmod(os.path.join(path, filename),0o755)
+
+ metastudentPath=""
+ if hasattr(sys, "frozen"):
+- metastudentPath=os.path.dirname(unicode(sys.executable, sys.getfilesystemencoding( )))
++ metastudentPath=os.path.dirname(str(sys.executable, sys.getfilesystemencoding( )))
+ else:
+ metastudentPath = os.path.dirname(os.path.abspath(__file__))
+ for filei in os.listdir(metastudentPath):
+ fileAbs = os.path.join(metastudentPath, filei)
+ if os.path.isdir(fileAbs):
+- os.chmod(os.path.join(metastudentPath, filei),0755)
++ os.chmod(os.path.join(metastudentPath, filei),0o755)
+ else:
+- os.chmod(os.path.join(metastudentPath, filei),0644)
++ os.chmod(os.path.join(metastudentPath, filei),0o644)
+
+-os.chmod(os.path.join(metastudentPath, "metastudent"),0755);
+-os.chmod(os.path.join(metastudentPath, "setup.py"),0755);
++os.chmod(os.path.join(metastudentPath, "metastudent"),0o755);
++os.chmod(os.path.join(metastudentPath, "setup.py"),0o755);
+
+ #metastudentPath=""
+ #if hasattr(sys, "frozen"):
=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
+2to3.patch
01_fix_blastp.patch
=====================================
debian/rules
=====================================
@@ -8,7 +8,7 @@ JAVA_HOME=/usr/lib/jvm/default-java
include /usr/share/dpkg/default.mk
%:
- dh $@ --with javahelper --with python2
+ dh $@ --with javahelper --with python3 --buildsystem=pybuild
override_dh_auto_clean:
dh_auto_clean
View it on GitLab: https://salsa.debian.org/med-team/metastudent/compare/d6f700ae1c393aae6c8e1cfa19b5895751c21a71...e031130c8a962bc8ded7677d38901fb0611030a1
--
View it on GitLab: https://salsa.debian.org/med-team/metastudent/compare/d6f700ae1c393aae6c8e1cfa19b5895751c21a71...e031130c8a962bc8ded7677d38901fb0611030a1
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/20190917/dc7b6118/attachment-0001.html>
More information about the debian-med-commit
mailing list