-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
146 lines (127 loc) · 3.7 KB
/
setup.py
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# BEGIN_COPYRIGHT
# END_COPYRIGHT
"""
Biobank: large scale biomedical computation on OMERO.
Biobank is a framework built upon OMERO that provides compact and
efficient ways to handle the computational aspects of large scale
biomedical studies.
"""
import datetime, os
# from setuptools import setup
from distutils.core import setup
from distutils.errors import DistutilsSetupError
from distutils.command.build_py import build_py as du_build_py
from distutils.command.sdist import sdist as du_sdist
from distutils.dep_util import newer, newer_group
import build_configuration
CURRENT_YEAR = datetime.datetime.now().year
DESCRIPTION, LONG_DESCRIPTION = __doc__.strip().split("\n", 1)
LONG_DESCRIPTION = LONG_DESCRIPTION.strip()
URL = "https://github.com/crs4/omero.biobank"
# DOWNLOAD_URL = ""
LICENSE = 'GPL'
CLASSIFIERS = [
"Programming Language :: Python",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Operating System :: POSIX :: Linux",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Intended Audience :: Science/Research",
]
PLATFORMS = ["Linux"]
try:
with open("NAME") as f:
NAME = f.read().strip()
with open("VERSION") as f:
VERSION = f.read().strip()
except IOError:
raise DistutilsSetupError("failed to read name/version info")
AUTHOR_INFO = [
("Gianmauro Cuccuru", "[email protected]"),
("Simone Leo", "[email protected]"),
("Luca Lianas", "[email protected]"),
("Gianluigi Zanetti", "[email protected]"),
]
MAINTAINER_INFO = [
("Simone Leo", "[email protected]"),
("Luca Lianas", "[email protected]"),
]
AUTHOR = ", ".join(t[0] for t in AUTHOR_INFO)
AUTHOR_EMAIL = ", ".join("<%s>" % t[1] for t in AUTHOR_INFO)
MAINTAINER = ", ".join(t[0] for t in MAINTAINER_INFO)
MAINTAINER_EMAIL = ", ".join("<%s>" % t[1] for t in MAINTAINER_INFO)
def write_authors(filename="AUTHORS"):
if not newer(__file__, filename):
return
with open(filename, "w") as f:
f.write("%s is developed by:\n" % NAME)
for name, email in AUTHOR_INFO:
f.write(" * %s <%s>\n" % (name, email))
f.write("and maintained by:\n")
for name, email in MAINTAINER_INFO:
f.write(" * %s <%s>\n" % (name, email))
def write_version(filename="bl/vl/version.py"):
if not newer("VERSION", filename):
return
with open(filename, "w") as f:
f.write("# GENERATED BY setup.py\n")
f.write("version='%s'\n" % VERSION)
def write_config():
target = build_configuration.PYTHON_OUT_FN
build_conf_file = os.path.splitext(build_configuration.__file__)[0] + '.py'
if newer_group([__file__, build_conf_file], target):
build_configuration.main([])
class build_py(du_build_py):
def run(self):
write_version()
write_config()
du_build_py.run(self)
class sdist(du_sdist):
def run(self):
write_authors()
du_sdist.run(self)
setup(
name=NAME,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
url=URL,
## download_url=DOWNLOAD_URL,
license=LICENSE,
classifiers=CLASSIFIERS,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
platforms=PLATFORMS,
version=VERSION,
packages=[
'bl',
'bl.vl',
'bl.vl.utils',
'bl.vl.kb',
'bl.vl.kb.galaxy',
'bl.vl.kb.serialize',
'bl.vl.kb.drivers',
'bl.vl.kb.drivers.omero',
'bl.vl.individual',
'bl.vl.genotype',
'bl.vl.graph',
'bl.vl.graph.drivers',
'bl.vl.app',
'bl.vl.app.importer',
'bl.vl.app.kb_query',
'bl.vl.app.snp_manager',
'bl.vl.app.workflow_wrapper',
],
cmdclass={
"sdist": sdist,
"build_py": build_py
},
requires=[
'omero',
'pygraph (>=1.8.0)',
'numpy',
'pika',
'voluptuous (>=0.7.1)',
'bulbs (>=0.3)',
],
)