forked from pyhrf/pyhrf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·137 lines (121 loc) · 4.78 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
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from glob import glob
from importlib import import_module
install_requires = [("numpy", "1.6"),
("scipy", "0.9"),
("nibabel", "1.1"),
("sympy", "0.7"),
("nipy", "0.3.0")]
missing_package = []
for package in install_requires:
try:
import_module(package[0])
except ImportError:
missing_package.append(package)
if missing_package != []:
print "Package(s) {0} must be installed prior PyHRF installation.".\
format(", ".join([">=".join(package) for package in missing_package]))
sys.exit(1)
try:
import setuptools
except ImportError:
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages, Extension
import numpy as np
cExtensions = [
Extension('pyhrf.jde.intensivecalc',
['src/pyhrf/jde/intensivecalc.c'],
[np.get_include()]),
Extension('pyhrf.boldsynth.pottsfield.pottsfield_c',
['src/pyhrf/boldsynth/pottsfield/pottsField.c'],
[np.get_include()]),
Extension('pyhrf.vbjde.UtilsC',
['src/pyhrf/vbjde/utilsmodule.c'],
[np.get_include()]),
Extension('pyhrf.cparcellation',
['src/pyhrf/cparcellation.c'],
[np.get_include()]),
]
setup(
name = "pyhrf",
version = "0.4",
description = ("PyHRF is a set of tools to analyze fMRI data and "
"specifically study hemodynamics."),
long_description = open("README.rst").read(),
author = ("Thomas VINCENT, Philippe CIUCIU, Solveig BADILLO, Florence "
"FORBES, Aina FRAU, Thomas PERRET"),
author_email = "[email protected]",
maintainer = "Thomas PERRET",
maintainer_email = "[email protected]",
url = "http://pyhrf.org",
packages = find_packages("python"),
setup_requires = ["numpy>=1.0",
"scipy>=0.9",
"nibabel>=1.1",
"sympy>=0.7"],
include_package_data = True,
scripts = glob('./bin/*'),
install_requires = ["numpy>=1.6",
"scipy>=0.9",
"matplotlib>=1.1,<1.4",
"nibabel>=1.1",
"sympy>=0.7",
"nipy==0.3.0"],
extras_require = {"Ward": ["scikit-learn>=0.10"],
"parallel": ["joblib>=0.5"],
"cluster": ["soma-workflow"],
"simulation": ["Pillow>=2.3"],
"parcellation": ["munkres>=1.0"],
"pipelines": ["pygraphviz>=1.1"],
"graph": ["python-graph-core>=1.8"]},
package_dir = {'' : 'python'},
# include_dirs = [np.get_include()],
ext_modules = cExtensions,
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 2 :: Only",
"Programming Language :: C",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
],
license = "CeCILLv2",
platforms = ["linux"],
zip_safe = False,
)
# optional deps and description of associated feature:
optional_deps = {
"sklearn": "(scikit-learn) -- spatial ward parcellation",
"joblib": "local parallel feature (eg pyhrf_jde_estim -x local)",
"soma_workflow": "cluster parallel feature (eg pyhrf_jde_estim -x cluster)",
"PIL": "loading of image file as simulation maps",
"munkres": "computation of distance between parcellations",
"pygraph": "(python-graph-core) -- save plot of simulation pipelines",
"pygraphviz": "optimized graph operations and outputs",
}
def check_opt_dep(dep_name, dep_descrip):
"""
Return a message telling if dependency *dep_name* is available
with an import
"""
try:
__import__(dep_name)
except ImportError:
return "%s *NOT IMPORTABLE*, %s will *NOT* be available" %(dep_name,
dep_descrip)
return "%s is importable, %s will be available" %(dep_name, dep_descrip)
print "Optional dependencies:"
print "\n".join(["- "+ check_opt_dep(dn, dd) for dn, dd in optional_deps.items()])
print ("\nIf the installation was successfull, you may run "
'"pyhrf_maketests" to run package tests.\n')