forked from nipy/heudiconv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·61 lines (52 loc) · 1.58 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
#!/usr/bin/env python
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the Heudiconv package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
from os.path import sep as pathsep
from os.path import join as opj
from os.path import splitext
from setuptools import findall
from setuptools import setup, find_packages
def get_version():
return [l.split('=', 1)[1].strip(" '\n")
for l in open(opj('bin', 'heudiconv'))
if l.startswith('__version__')][0]
def findsome(subdir, extensions):
"""Find files under subdir having specified extensions
Leading directory (datalad) gets stripped
"""
return [
f.split(pathsep, 1)[1] for f in findall(subdir)
if splitext(f)[-1].lstrip('.') in extensions
]
requires = {
'core': [
'nibabel',
# TODO: migrate more from requirements.txt
],
'tests': [
'six',
'nose',
],
}
requires['full'] = sum(list(requires.values()), [])
if __name__ == '__main__':
setup(
name="heudiconv",
author="The Heudiconv Team and Contributors",
#author_email="team@???",
version=get_version(),
description="Heuristic DICOM Converter",
scripts=[
opj('bin', 'heudiconv')
],
install_requires=requires['core'],
extras_require=requires,
package_data={
'heudiconv_heuristics':
findsome('heuristics', {'py'})
}
)