-
Notifications
You must be signed in to change notification settings - Fork 47
/
setup.py
58 lines (52 loc) · 1.82 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
from setuptools import setup, find_packages
try:
from pip.req import parse_requirements
except ImportError:
from pip._internal.req import parse_requirements
try:
from pip.download import PipSession
except ImportError:
from pip._internal.download import PipSession
import os
# Get __version__ and set other constants.
# Source: https://stackoverflow.com/a/16084844
with open(os.path.join('src', 'cloudbrain', 'version.py'), 'r') as f:
exec (f.read())
URL = 'https://github.com/cloudbrain/cloudbrain'
DOWNLOAD_URL = '%s/archive/%s.tar.gz' % (URL, __version__)
DESCRIPTION = open('README.rst').read()
# Helper function for requirements parsing by requirement type
def parse_reqs(req_type):
reqs_file = os.path.join('requirements', '%s.txt' % req_type)
install_reqs = parse_requirements(reqs_file, session=PipSession())
reqs = [str(ir.req) for ir in install_reqs]
return reqs
# Get requirements for all types
REQUIREMENT_TYPES = ['core', 'analytics', 'muse']
reqs = {req_type: parse_reqs(req_type) for req_type in REQUIREMENT_TYPES}
setup(name='cloudbrain',
version=__version__,
description='Platform for wearable data analysis.',
author='Marion Le Borgne',
author_email='[email protected]',
url=URL,
download_url=DOWNLOAD_URL,
package_dir={'': 'src'},
packages=find_packages('src'),
install_requires=reqs['core'],
long_description=DESCRIPTION,
test_suite='nose.collector',
include_package_data=True,
package_data={
"cloudbrain.core": ["*.json"],
"cloudbrain.schema": ["*.json"]
},
extras_require={
'muse:python_version>="3"': reqs['muse'],
'analytics': reqs['analytics']
},
entry_points={
'console_scripts':
['cloudbrain=cloudbrain.run:main']
}
)