pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-aggnog-mapper: Patch for python 3



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Mon Nov 5 18:25:42 2018 -0600
Changeset:	161ebef58c04a1949673a8c21a6095c55036c2e8

Modified Files:
	py-eggnog-mapper/PLIST
	py-eggnog-mapper/distinfo
Added Files:
	py-eggnog-mapper/patches/patch-eggnogmapper_annota.py
	py-eggnog-mapper/patches/patch-eggnogmapper_common.py
	py-eggnog-mapper/patches/patch-eggnogmapper_search.py
	py-eggnog-mapper/patches/patch-eggnogmapper_server.py

Log Message:
py-aggnog-mapper: Patch for python 3

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=161ebef58c04a1949673a8c21a6095c55036c2e8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-eggnog-mapper/PLIST                             | 34 ++++++++--------
 py-eggnog-mapper/distinfo                          |  4 ++
 .../patches/patch-eggnogmapper_annota.py           | 18 +++++++++
 .../patches/patch-eggnogmapper_common.py           | 15 +++++++
 .../patches/patch-eggnogmapper_search.py           | 47 ++++++++++++++++++++++
 .../patches/patch-eggnogmapper_server.py           | 24 +++++++++++
 6 files changed, 125 insertions(+), 17 deletions(-)

diffs:
diff --git a/py-eggnog-mapper/PLIST b/py-eggnog-mapper/PLIST
index 542027fd23..55ec22d216 100644
--- a/py-eggnog-mapper/PLIST
+++ b/py-eggnog-mapper/PLIST
@@ -4,29 +4,29 @@ ${PYSITELIB}/eggnogmapper-1.0-py${PYVERSSUFFIX}.egg-info/SOURCES.txt
 ${PYSITELIB}/eggnogmapper-1.0-py${PYVERSSUFFIX}.egg-info/dependency_links.txt
 ${PYSITELIB}/eggnogmapper-1.0-py${PYVERSSUFFIX}.egg-info/top_level.txt
 ${PYSITELIB}/eggnogmapper/__init__.py
-${PYSITELIB}/eggnogmapper/__init__.pyc
 ${PYSITELIB}/eggnogmapper/__init__.pyo
-${PYSITELIB}/eggnogmapper/annota.py
-${PYSITELIB}/eggnogmapper/annota.pyc
+${PYSITELIB}/eggnogmapper/__init__.pyc
 ${PYSITELIB}/eggnogmapper/annota.pyo
-${PYSITELIB}/eggnogmapper/annota_mongo.py
-${PYSITELIB}/eggnogmapper/annota_mongo.pyc
+${PYSITELIB}/eggnogmapper/annota.pyc
 ${PYSITELIB}/eggnogmapper/annota_mongo.pyo
-${PYSITELIB}/eggnogmapper/common.py
-${PYSITELIB}/eggnogmapper/common.pyc
+${PYSITELIB}/eggnogmapper/annota_mongo.pyc
 ${PYSITELIB}/eggnogmapper/common.pyo
-${PYSITELIB}/eggnogmapper/search.py
-${PYSITELIB}/eggnogmapper/search.pyc
+${PYSITELIB}/eggnogmapper/common.pyc
 ${PYSITELIB}/eggnogmapper/search.pyo
-${PYSITELIB}/eggnogmapper/seqio.py
-${PYSITELIB}/eggnogmapper/seqio.pyc
+${PYSITELIB}/eggnogmapper/search.pyc
 ${PYSITELIB}/eggnogmapper/seqio.pyo
-${PYSITELIB}/eggnogmapper/server.py
-${PYSITELIB}/eggnogmapper/server.pyc
+${PYSITELIB}/eggnogmapper/seqio.pyc
 ${PYSITELIB}/eggnogmapper/server.pyo
-${PYSITELIB}/eggnogmapper/utils.py
-${PYSITELIB}/eggnogmapper/utils.pyc
+${PYSITELIB}/eggnogmapper/server.pyc
 ${PYSITELIB}/eggnogmapper/utils.pyo
-${PYSITELIB}/eggnogmapper/version.py
-${PYSITELIB}/eggnogmapper/version.pyc
+${PYSITELIB}/eggnogmapper/utils.pyc
 ${PYSITELIB}/eggnogmapper/version.pyo
+${PYSITELIB}/eggnogmapper/version.pyc
+${PYSITELIB}/eggnogmapper/annota.py
+${PYSITELIB}/eggnogmapper/annota_mongo.py
+${PYSITELIB}/eggnogmapper/common.py
+${PYSITELIB}/eggnogmapper/search.py
+${PYSITELIB}/eggnogmapper/seqio.py
+${PYSITELIB}/eggnogmapper/server.py
+${PYSITELIB}/eggnogmapper/utils.py
+${PYSITELIB}/eggnogmapper/version.py
diff --git a/py-eggnog-mapper/distinfo b/py-eggnog-mapper/distinfo
index e2433f2155..0da4c303e3 100644
--- a/py-eggnog-mapper/distinfo
+++ b/py-eggnog-mapper/distinfo
@@ -4,3 +4,7 @@ SHA1 (eggnog-mapper-1.0.3.tar.gz) = 8018f0f2556c31b9b7b5d99dcaffe55518c4becc
 RMD160 (eggnog-mapper-1.0.3.tar.gz) = 819cc711a801c234694aedddf1e3475b9919440c
 SHA512 (eggnog-mapper-1.0.3.tar.gz) = 4d53f8455dc4edf4587a75359cc9b884758f2541c9d9a02994fa009b43aecb6e8ed8dafb4b02906709b6c1c6d8fb0e059000cba59cad70d01d482fb5b4fbb8bf
 Size (eggnog-mapper-1.0.3.tar.gz) = 37713129 bytes
+SHA1 (patch-eggnogmapper_annota.py) = b967e669ac5dccf5cc5559d76d8c4b905c4721eb
+SHA1 (patch-eggnogmapper_common.py) = 02ebe44f13ccd9dde302d579596b37abb2d8f35c
+SHA1 (patch-eggnogmapper_search.py) = 7efa9ee391998546cf9d1a0b2feca1b72844cb48
+SHA1 (patch-eggnogmapper_server.py) = 778f31acde15e2cbc49e3a2eb9e68d6d5ed1d89e
diff --git a/py-eggnog-mapper/patches/patch-eggnogmapper_annota.py b/py-eggnog-mapper/patches/patch-eggnogmapper_annota.py
new file mode 100644
index 0000000000..280b64621c
--- /dev/null
+++ b/py-eggnog-mapper/patches/patch-eggnogmapper_annota.py
@@ -0,0 +1,18 @@
+$NetBSD$
+
+# Support python 3
+
+--- eggnogmapper/annota.py.orig	2018-11-06 00:14:05 UTC
++++ eggnogmapper/annota.py
+@@ -269,9 +269,9 @@ def get_annotated_orthologs(target_membe
+     cmd3 = 'SELECT name, pname, go, kegg FROM member WHERE name in (%s);' % in_clause
+     t1 = time.time()
+     db.execute(cmd3)
+-    print time.time() - t1
++    print(time.time() - t1)
+     functions = {e[0]: e[1:] for e in db.fetchall()}
+-    print time.time() - t1
++    print(time.time() - t1)
+ 
+     #print len(all_orthologs), list(all_orthologs)[:10], in_clause[:10]
+     #print len([b for a,b in functions.iteritems() if b[0] ])
diff --git a/py-eggnog-mapper/patches/patch-eggnogmapper_common.py b/py-eggnog-mapper/patches/patch-eggnogmapper_common.py
new file mode 100644
index 0000000000..924a22523d
--- /dev/null
+++ b/py-eggnog-mapper/patches/patch-eggnogmapper_common.py
@@ -0,0 +1,15 @@
+$NetBSD$
+
+# Support python 3
+
+--- eggnogmapper/common.py.orig	2018-11-06 00:14:59 UTC
++++ eggnogmapper/common.py
+@@ -105,7 +105,7 @@ def set_data_path(data_path):
+ def show_binaries():
+     for e in (HMMSEARCH, HMMSCAN, HMMSTAT, HMMPGMD, PHMMER, DIAMOND, DATA_PATH,
+               get_fasta_path(), get_hmmdb_path(), get_eggnogdb_file(), get_oglevels_file(), get_eggnog_dmnd_db()):
+-        print "% 65s" %e, pexists(e)
++        print("% 65s" %e, pexists(e))
+ 
+ def get_call_info():
+     text = []
diff --git a/py-eggnog-mapper/patches/patch-eggnogmapper_search.py b/py-eggnog-mapper/patches/patch-eggnogmapper_search.py
new file mode 100644
index 0000000000..165605b31b
--- /dev/null
+++ b/py-eggnog-mapper/patches/patch-eggnogmapper_search.py
@@ -0,0 +1,47 @@
+$NetBSD$
+
+# Support python 3
+
+--- eggnogmapper/search.py.orig	2017-11-15 10:45:47 UTC
++++ eggnogmapper/search.py
+@@ -28,7 +28,7 @@ B62_IDENTITIES = {'A': 4, 'B': 4, 'C': 9
+ def safe_cast(v):
+     try:
+         return float(v)
+-    except ValueError:
++    except(ValueError):
+         return v.strip()
+ 
+ 
+@@ -57,7 +57,7 @@ def scan_hits(data, address="127.0.0.1",
+     s = socket.socket()
+     try:
+         s.connect((address, port))
+-    except Exception, e:
++    except(Exception, e):
+         print(address, port, e)
+         raise
+     s.sendall(data)
+@@ -191,7 +191,7 @@ def iter_hits(source, translate, query_t
+ 
+     try:
+         max_hits = int(max_hits)
+-    except Exception:
++    except(Exception):
+         max_hits = None
+ 
+     if scantype == 'mem' and query_type == "seq":
+@@ -225,11 +225,11 @@ def hmmscan(query_file, translate, datab
+     OUT = NamedTemporaryFile(dir=tempdir)
+     if translate or maxseqlen:
+         if translate:
+-            print 'translating query input file'
++            print('translating query input file')
+         Q = NamedTemporaryFile()
+         for name, seq in seqio.iter_fasta_seqs(query_file, translate=translate):
+             if maxseqlen is None or len(seq) <= maxseqlen:
+-                print >>Q, ">%s\n%s" % (name, seq)
++                print(">%s\n%s" % (name, seq)) >> Q
+         Q.flush()
+         query_file = Q.name
+ 
diff --git a/py-eggnog-mapper/patches/patch-eggnogmapper_server.py b/py-eggnog-mapper/patches/patch-eggnogmapper_server.py
new file mode 100644
index 0000000000..750a4d6525
--- /dev/null
+++ b/py-eggnog-mapper/patches/patch-eggnogmapper_server.py
@@ -0,0 +1,24 @@
+$NetBSD$
+
+# Support python 3
+
+--- eggnogmapper/server.py.orig	2018-11-06 00:18:53 UTC
++++ eggnogmapper/server.py
+@@ -30,7 +30,7 @@ def server_functional(host, port, dbtype
+     if server_up(host, port):
+         try:
+             search.get_hits("test", "TESTSEQ", host, port, dbtype)
+-        except Exception, e:
++        except(Exception, e):
+             #print 'Server not ready', e
+             return False
+         else:
+@@ -94,7 +94,7 @@ def generate_idmap(dbpath):
+     if dbpath.endswith(".h3f"):
+         dbpath = dbpath.replace(".h3f", "")
+     cmd = """%s %s |grep -v '#'|awk '{print $1" "$2}' > %s""" %(HMMSTAT, dbpath, dbpath+'.idmap')
+-    print colorify(cmd, "cyan")
++    print(colorify(cmd, "cyan"))
+     print('Generating idmap in '+dbpath+'.idmap')
+     return os.system(cmd) == 0
+     


Home | Main Index | Thread Index | Old Index