Skip to content

Commit

Permalink
make analytics install optional
Browse files Browse the repository at this point in the history
  • Loading branch information
marionleborgne committed Sep 7, 2017
1 parent 787ac39 commit f3061dd
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Features
========

CloudBrain is a platform for real-time sensor data analysis and
visualization.
visualization.

- **Stream sensor data** in a unified format.
- **Store sensor data** in a central database.
- **Analyze sensor data** to find patterns.
- **Stream sensor data** in a unified format.
- **Store sensor data** in a central database.
- **Analyze sensor data** to find patterns.
- **Visualize sensor data** and patterns in real-time.

.. figure:: https://raw.githubusercontent.com/cloudbrain/cloudbrain/master/docs/images/features.png
Expand All @@ -30,9 +30,9 @@ Setup
Optional
--------

Optional CloudBrain modules can be installed:

- Muse source module: ``pip install .[muse] --user`` *(Python ``3.*`` only)*
Optional CloudBrain modules can be installed:
- Analytics modules: ``pip install .[analytics] --user``
- Muse source module: ``pip install .[muse] --user`` *(Python ``3.*`` only)*

Run the tests
-------------
Expand Down
3 changes: 3 additions & 0 deletions requirements/analytics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
scipy==0.18.1
numpy==1.11.2
mne==0.10.0
5 changes: 1 addition & 4 deletions requirements.txt → requirements/core.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
simplejson==3.8.2
pika==0.10
numpy==1.11.2
scipy==0.18.1
pyserial==2.7
mne==0.10.0
requests[security]==2.18.1
pyserial==2.7
1 change: 1 addition & 0 deletions requirements/muse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-osc==1.6
23 changes: 16 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@
import os

# Get __version__ and set other constants.
exec(open(os.path.join('src', 'cloudbrain',
'version.py')).read())
# 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()

# Requirements
install_reqs = parse_requirements('requirements.txt', session=PipSession())
reqs = [str(ir.req) for ir in install_reqs]
# 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__,
Expand All @@ -23,7 +31,7 @@
download_url=DOWNLOAD_URL,
package_dir={'': 'src'},
packages=find_packages('src'),
install_requires=reqs,
install_requires=reqs['core'],
long_description=DESCRIPTION,
test_suite='nose.collector',
tests_require=['mock==1.0.1', 'nose'],
Expand All @@ -33,7 +41,8 @@
"cloudbrain.schema": ["*.json"]
},
extras_require={
'muse:python_version>="3"': ['python-osc==1.6'],
'muse:python_version>="3"': reqs['muse'],
'analytics': reqs['analytics']
},
entry_points = {
'console_scripts':
Expand Down

0 comments on commit f3061dd

Please sign in to comment.