File: setup.py

package info (click to toggle)
metastudent 2.0.1-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 95,636 kB
  • sloc: java: 3,287; perl: 2,089; python: 1,423; ruby: 242; sh: 39; makefile: 19
file content (110 lines) | stat: -rwxr-xr-x 4,365 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/python

from distutils.core import setup
from subprocess import Popen, PIPE
import sys
from metastudentPkg.version import VERSION
import os

from metastudentPkg.commons import getPkgPath
import shutil
import tempfile


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("Error: pod2man failed", file=sys.stderr)
    print("Stdout: %s" % (stdout), file=sys.stderr)
    print("Stderr: %s" % (stderr), file=sys.stderr)
    sys.exit(1)


pkgPath = getPkgPath()
dataFiles = []
exeSuffixes = set([".rb", ".py", ".pl", ".sh", ".class", ".jar", ".exe"])
executables = set(["CafaWrapper3.pl", "exercise3.pl",
                   "knn_weighted", "treehandler.pl"])
# for path, dirs, files in os.walk(os.path.join(pkgPath, "data")):
#	if "/.svn" not in path and "dataset_201012" not in path:
#		for filename in files:
#			filenameSplit = filename.split(".")
#			if len(filenameSplit) > 2 and "."+filenameSplit[-1] in exeSuffixes:
#				os.chmod(os.path.join(path, filename),0755)
#			else:
#				os.chmod(os.path.join(path, filename),0644)
#			dataFiles.append(os.path.relpath(os.path.join(path, filename), pkgPath))

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), 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), 0o755)
                else:
                    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), 0o755)

metastudentPath = ""
if hasattr(sys, "frozen"):
    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), 0o755)
    else:
        os.chmod(os.path.join(metastudentPath, filei), 0o644)

os.chmod(os.path.join(metastudentPath, "metastudent"), 0o755)
os.chmod(os.path.join(metastudentPath, "setup.py"), 0o755)

# metastudentPath=""
# if hasattr(sys, "frozen"):
#	metastudentPath=os.path.dirname(unicode(sys.executable, sys.getfilesystemencoding( )))
# else:
#	metastudentPath = os.path.dirname(os.path.abspath(__file__))
#dataPackagePath = os.path.join(sys.prefix, "share", "metastudent-data")
#defaultConfigFilePath = os.path.join(metastudentPath, "metastudentrc.default")
#defaultConfigFile = open(defaultConfigFilePath)
#defaultConfigFileContent = defaultConfigFile.read()
#defaultConfigFileContent.replace("XX_DATAPATH_XX", dataPackagePath)
# defaultConfigFile.close()
#
#defaultConfigFile = open(defaultConfigFilePath, 'w')
# defaultConfigFile.write(defaultConfigFileContent)
# defaultConfigFile.close()


setup(name='metastudent',
      fullname="metastudent",
      version=VERSION,
      description="Predict GO terms from sequence",
      long_description="Metastudent predicts the putative GO terms for a protein using only its sequence.",
      maintainer="Tobias Hamp",
      maintainer_email="hampt@rostlab.org",
      author="Tobias Hamp",
      author_email="hampt@rostlab.org",
      url="www.rostlab.org",
      license="GPL",
      keywords=["GO", "term", "prediction", "BLAST",
                "ontology", "protein", "sequence"],
      scripts=["metastudent"],
      data_files=[	("share/metastudent", ["metastudentrc.default"]),
                   ("share/doc/metastudent/examples",
                    ["test.fasta", "test.result.BPO.txt", "test.result.MFO.txt", "test.result.CCO.txt"]),
                   ("share/man/man1", ["metastudent.1"])
                   ],
      packages=['metastudentPkg'],
      package_data={'metastudentPkg': dataFiles}
      )