forked from nipreps/fmriprep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
100 lines (90 loc) · 2.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: oesteban
# @Date: 2015-11-19 16:44:27
""" fmriprep setup script """
def main():
""" Install entry-point """
from io import open
from os import path as op
from inspect import getfile, currentframe
from setuptools import setup, find_packages
from setuptools.extension import Extension
from numpy import get_include
from fmriprep.info import (
__packagename__,
__version__,
__author__,
__email__,
__maintainer__,
__license__,
__description__,
__longdesc__,
__url__,
DOWNLOAD_URL,
CLASSIFIERS,
REQUIRES,
SETUP_REQUIRES,
LINKS_REQUIRES,
TESTS_REQUIRES,
EXTRA_REQUIRES,
)
pkg_data = {
'fmriprep': [
'data/*.json',
'data/*.nii.gz',
'data/*.mat',
'data/itkIdentityTransform.txt',
'viz/*.tpl',
'viz/*.json'
]
}
root_dir = op.dirname(op.abspath(getfile(currentframe())))
version = None
cmdclass = {}
if op.isfile(op.join(root_dir, 'fmriprep', 'VERSION')):
with open(op.join(root_dir, 'fmriprep', 'VERSION')) as vfile:
version = vfile.readline().strip()
pkg_data['fmriprep'].insert(0, 'VERSION')
if version is None:
import versioneer
version = versioneer.get_version()
cmdclass = versioneer.get_cmdclass()
extensions = [Extension(
"fmriprep.utils.maths",
["fmriprep/utils/maths.pyx"],
include_dirs=[get_include(), "/usr/local/include/"],
library_dirs=["/usr/lib/"]),
]
setup(
name=__packagename__,
version=__version__,
description=__description__,
long_description=__longdesc__,
author=__author__,
author_email=__email__,
maintainer=__maintainer__,
maintainer_email=__email__,
url=__url__,
license=__license__,
classifiers=CLASSIFIERS,
download_url=DOWNLOAD_URL,
# Dependencies handling
setup_requires=SETUP_REQUIRES,
install_requires=REQUIRES,
tests_require=TESTS_REQUIRES,
extras_require=EXTRA_REQUIRES,
dependency_links=LINKS_REQUIRES,
package_data=pkg_data,
entry_points={'console_scripts': [
'fmriprep=fmriprep.cli.run:main',
'fmriprep-boldmask=fmriprep.cli.fmriprep_bold_mask:main',
'sample_openfmri=fmriprep.cli.sample_openfmri:main'
]},
packages=find_packages(exclude=("tests",)),
zip_safe=False,
ext_modules=extensions,
cmdclass=cmdclass,
)
if __name__ == '__main__':
main()