-
Notifications
You must be signed in to change notification settings - Fork 24
/
setup.py
executable file
·167 lines (134 loc) · 4.61 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" setup.py
Packaging for dax
"""
from glob import glob
import os
from setuptools import setup, find_packages
import subprocess
def git_version():
def _minimal_ext_cmd(cmd):
env = {}
for k in ['SYSTEMROOT', 'PATH', 'HOME']:
v = os.environ.get(k)
if v is not None:
env[k] = v
out = subprocess.check_output(cmd, stderr=subprocess.STDOUT, env=env)
return out
try:
out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
GIT_REVISION = out.strip().decode('ascii')
except OSError:
GIT_REVISION = "Unknown"
return GIT_REVISION
def write_git_revision_py(filename='dax/git_revision.py'):
cnt = """
# THIS FILE IS GENERATED BY SETUP.PY
git_revision = '%(git_revision)s'
"""
GIT_REVISION = git_version()
with open(filename, 'w') as f:
f.write(cnt % {'git_revision': GIT_REVISION})
def get_version():
basedir = os.path.dirname(__file__)
with open(os.path.join(basedir, 'dax/version.py')) as f:
VERSION = None
version_ns = {}
exec(f.read(), version_ns)
VERSION = version_ns['VERSION']
return VERSION
raise RuntimeError("No version found")
def readme():
with open('README.md') as f:
return f.read()
description = 'Distributed Automation for XNAT'
# Note: this long_description is actually a copy/paste from the top-level
# README.txt, so that it shows up nicely on PyPI. So please remember to edit
# it only in one place and sync it correctly.
long_description = """
========================================================
DAX: Distributed Automation for XNAT
========================================================
*DAX*, is a python package developed at Vanderbilt University, Nashville, TN,
USA. It's available on github at: https://github.com/VUIIS/dax.
XNAT provides a flexible imaging informatics software platform to
organize and manage imaging data.
*DAX*, an open-source initiative under the umbrella of Vanderbilt University
Institute of Imaging Science (VUIIS), is a Python project that provides a
uniform interface to run pipelines on a cluster by grabbing data from a XNAT
database via RESTApi Calls.
*DAX* allows you to:
* extract information from XNAT via scripts (bin/Xnat_tools/Xnat...)
* create pipelines (spiders/processors) to run pipelines on your data
* build a project on XNAT with pipelines (assessors)
* launch pipelines on your cluster and upload results back to xnat
* interact with XNAT via python using commands in XnatUtils.
"""
NAME = 'dax'
MAINTAINER = 'VUIIS CCI'
MAINTAINER_EMAIL = '[email protected]'
DESCRIPTION = description
LONG_DESCRIPTION = long_description
URL = "http://github.com/VUIIS/dax"
DOWNLOAD_URL = "http://github.com/VUIIS/dax"
LICENSE = 'MIT'
CLASSIFIERS = [
# As from http://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Programming Language :: Python :: 3.7",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis"]
AUTHOR = MAINTAINER
AUTHOR_EMAIL = MAINTAINER_EMAIL
PLATFORMS = ["MacOs",
"Linux"]
VERSION = get_version()
# versions
SPHINX_MIN_VERSION = '4'
PYXNAT_MIN_VERSION = '1.1.0.2'
REQUIRES = [
'pyxnat>=%s' % PYXNAT_MIN_VERSION,
'pyyaml',
'pycap',
'pandas',
'fpdf2',
'PyPDF2',
'yamale']
DOCS_REQUIRES = [
'Sphinx>=%s' % SPHINX_MIN_VERSION]
TESTS_REQUIRES = ['nose']
BIDS_REQUIRES = ['cubids-bond-fork', 'nibabel']
if __name__ == '__main__':
write_git_revision_py()
setup(name=NAME,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
version=get_version(),
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
url=URL,
download_url=DOWNLOAD_URL,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
platforms=PLATFORMS,
license=LICENSE,
packages=find_packages(),
include_package_data=True,
test_suite='nose.collector',
tests_require=TESTS_REQUIRES,
install_requires=REQUIRES,
python_requires='~=3.6',
zip_safe=True,
scripts=glob(os.path.join('bin', '*', '*')),
classifiers=CLASSIFIERS,
extras_require={
'docs': DOCS_REQUIRES,
'bids': BIDS_REQUIRES,
})