forked from christianbrodbeck/Eelbrain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
74 lines (63 loc) · 2.36 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
"""
setup.py
========
This is the setup.py script for Eelbrain.
http://docs.python.org/distutils/index.html
"""
# Setuptools bootstrap module
# http://pythonhosted.org//setuptools/setuptools.html
from ez_setup import use_setuptools
use_setuptools()
import re
import sys
from setuptools import setup, find_packages, Extension
import numpy as np
# version must be in X.X.X format, e.g., "0.0.3dev"
with open('eelbrain/__init__.py') as fid:
text = fid.read()
match = re.search("__version__ = '([.\w]+)'", text)
if match is None:
raise ValueError("No valid version string found in:\n\n" + text)
version = match.group(1)
if version.count('.') != 2 and not version.endswith('dev'):
raise ValueError("Invalid version string extracted: %r" % version)
if len(sys.argv) > 1:
arg = sys.argv[1]
else:
arg = None
# Cython extensions
ext = [Extension("eelbrain._stats.opt", ["eelbrain/_stats/opt.c"])]
# basic setup arguments
kwargs = dict(name='eelbrain',
version=version,
description="MEG/EEG analysis tools",
url="https://pythonhosted.org/eelbrain",
author="Christian Brodbeck",
author_email='christianbrodbeck@nyu.edu',
license='GPL3',
long_description=open('README.txt').read(),
install_requires=['keyring >= 5',
'tex >= 1.8',
'docutils >= 0.11',
'mne >= 0.8',
'nibabel >= 2.0'],
extras_require={'full': ['numpy >= 1.8',
'scipy >= 0.11.0',
'matplotlib >= 1.1'],
'dev': ['cython >= 0.21',
'sphinx >= 1.1',
'numpydoc >= 0.5'],
'plot.brain': ['mayavi >= 4.3.1',
# 'pysurfer >= 0.5'
# PySurfer breaks the setup because it raises an error when nibabel is not installed
]},
include_dirs=[np.get_include()],
packages=find_packages(),
ext_modules=ext,
)
# Either PIL or Pillow is fine...
try:
import PIL
except ImportError:
kwargs['install_requires'].append('pillow')
setup(**kwargs)