diff --git a/.gitignore b/.gitignore index 15dba31cdd8cf..0fa4ff2a97057 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ env logs build +dist *.pyc docs/_* diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000000000..382f763835969 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include flux/www/static * +recursive-include flux/www/templates * diff --git a/docs/conf.py b/docs/conf.py index 93b6eb787f169..e76c55883a8b8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,11 +14,12 @@ import sys import os +from flux import settings # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.environ['FLUX_HOME'] + "/src/flux") +sys.path.insert(0, settings.FLUX_HOME + "/src/flux") # -- General configuration ------------------------------------------------ diff --git a/flux b/flux deleted file mode 100755 index cdabcf506ee0b..0000000000000 --- a/flux +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -source $FLUX_HOME/init.sh -python src/flux/bin/flux_bin.py $* diff --git a/src/flux/__init__.py b/flux/__init__.py similarity index 100% rename from src/flux/__init__.py rename to flux/__init__.py diff --git a/flux/bin/flux b/flux/bin/flux new file mode 100755 index 0000000000000..55ee4cabea6ad --- /dev/null +++ b/flux/bin/flux @@ -0,0 +1,3 @@ +#!/bin/bash +source $FLUX_HOME/init.sh +python $FLUX_HOME/flux/bin/flux_bin.py $* diff --git a/src/flux/bin/flux_bin.py b/flux/bin/flux_bin.py similarity index 100% rename from src/flux/bin/flux_bin.py rename to flux/bin/flux_bin.py diff --git a/src/flux/executors/__init__.py b/flux/executors/__init__.py similarity index 100% rename from src/flux/executors/__init__.py rename to flux/executors/__init__.py diff --git a/src/flux/executors/base_executor.py b/flux/executors/base_executor.py similarity index 100% rename from src/flux/executors/base_executor.py rename to flux/executors/base_executor.py diff --git a/src/flux/hooks/__init__.py b/flux/hooks/__init__.py similarity index 100% rename from src/flux/hooks/__init__.py rename to flux/hooks/__init__.py diff --git a/src/flux/hooks/base_hook.py b/flux/hooks/base_hook.py similarity index 100% rename from src/flux/hooks/base_hook.py rename to flux/hooks/base_hook.py diff --git a/src/flux/hooks/mysql_hook.py b/flux/hooks/mysql_hook.py similarity index 100% rename from src/flux/hooks/mysql_hook.py rename to flux/hooks/mysql_hook.py diff --git a/src/flux/macros.py b/flux/macros.py similarity index 100% rename from src/flux/macros.py rename to flux/macros.py diff --git a/src/flux/models.py b/flux/models.py similarity index 100% rename from src/flux/models.py rename to flux/models.py diff --git a/src/flux/operators/__init__.py b/flux/operators/__init__.py similarity index 100% rename from src/flux/operators/__init__.py rename to flux/operators/__init__.py diff --git a/src/flux/operators/base_sensor_operator.py b/flux/operators/base_sensor_operator.py similarity index 100% rename from src/flux/operators/base_sensor_operator.py rename to flux/operators/base_sensor_operator.py diff --git a/src/flux/operators/bash_operator.py b/flux/operators/bash_operator.py similarity index 100% rename from src/flux/operators/bash_operator.py rename to flux/operators/bash_operator.py diff --git a/src/flux/operators/dummy_operator.py b/flux/operators/dummy_operator.py similarity index 100% rename from src/flux/operators/dummy_operator.py rename to flux/operators/dummy_operator.py diff --git a/src/flux/operators/mysql_operator.py b/flux/operators/mysql_operator.py similarity index 100% rename from src/flux/operators/mysql_operator.py rename to flux/operators/mysql_operator.py diff --git a/src/flux/settings.py b/flux/settings.py similarity index 86% rename from src/flux/settings.py rename to flux/settings.py index 751245310389c..5214d2904cf7b 100644 --- a/src/flux/settings.py +++ b/flux/settings.py @@ -4,11 +4,10 @@ from sqlalchemy import create_engine if 'FLUX_HOME' not in os.environ: - raise Exception( - "Looks like someone forgot to set their FLUX_HOME env variable.") + os.environ['FLUX_HOME'] = os.path.join(os.path.dirname(__file__), "..") FLUX_HOME = os.environ['FLUX_HOME'] -BASE_FOLDER = FLUX_HOME + '/src/flux' +BASE_FOLDER = FLUX_HOME + '/flux' if BASE_FOLDER not in sys.path: sys.path.append(BASE_FOLDER) DAGS_FOLDER = FLUX_HOME + '/dags' diff --git a/src/flux/utils.py b/flux/utils.py similarity index 100% rename from src/flux/utils.py rename to flux/utils.py diff --git a/src/www/__init__.py b/flux/www/__init__.py similarity index 100% rename from src/www/__init__.py rename to flux/www/__init__.py diff --git a/src/www/app.py b/flux/www/app.py similarity index 100% rename from src/www/app.py rename to flux/www/app.py diff --git a/src/www/static/d3.v3.min.js b/flux/www/static/d3.v3.min.js similarity index 100% rename from src/www/static/d3.v3.min.js rename to flux/www/static/d3.v3.min.js diff --git a/src/www/static/dagre-d3.min.js b/flux/www/static/dagre-d3.min.js similarity index 100% rename from src/www/static/dagre-d3.min.js rename to flux/www/static/dagre-d3.min.js diff --git a/src/www/static/dagre.css b/flux/www/static/dagre.css similarity index 100% rename from src/www/static/dagre.css rename to flux/www/static/dagre.css diff --git a/src/www/static/docs b/flux/www/static/docs similarity index 100% rename from src/www/static/docs rename to flux/www/static/docs diff --git a/src/www/static/favicon.ico b/flux/www/static/favicon.ico similarity index 100% rename from src/www/static/favicon.ico rename to flux/www/static/favicon.ico diff --git a/src/www/static/graph.css b/flux/www/static/graph.css similarity index 100% rename from src/www/static/graph.css rename to flux/www/static/graph.css diff --git a/src/www/static/highcharts-more.js b/flux/www/static/highcharts-more.js similarity index 100% rename from src/www/static/highcharts-more.js rename to flux/www/static/highcharts-more.js diff --git a/src/www/static/highcharts.js b/flux/www/static/highcharts.js similarity index 100% rename from src/www/static/highcharts.js rename to flux/www/static/highcharts.js diff --git a/src/www/static/main.css b/flux/www/static/main.css similarity index 100% rename from src/www/static/main.css rename to flux/www/static/main.css diff --git a/src/www/static/screenshots/gantt.png b/flux/www/static/screenshots/gantt.png similarity index 100% rename from src/www/static/screenshots/gantt.png rename to flux/www/static/screenshots/gantt.png diff --git a/src/www/static/screenshots/graph.png b/flux/www/static/screenshots/graph.png similarity index 100% rename from src/www/static/screenshots/graph.png rename to flux/www/static/screenshots/graph.png diff --git a/src/www/static/screenshots/tree.png b/flux/www/static/screenshots/tree.png similarity index 100% rename from src/www/static/screenshots/tree.png rename to flux/www/static/screenshots/tree.png diff --git a/src/www/static/tree.css b/flux/www/static/tree.css similarity index 100% rename from src/www/static/tree.css rename to flux/www/static/tree.css diff --git a/src/www/templates/admin/chart.html b/flux/www/templates/admin/chart.html similarity index 100% rename from src/www/templates/admin/chart.html rename to flux/www/templates/admin/chart.html diff --git a/src/www/templates/admin/code.html b/flux/www/templates/admin/code.html similarity index 100% rename from src/www/templates/admin/code.html rename to flux/www/templates/admin/code.html diff --git a/src/www/templates/admin/dag.html b/flux/www/templates/admin/dag.html similarity index 100% rename from src/www/templates/admin/dag.html rename to flux/www/templates/admin/dag.html diff --git a/src/www/templates/admin/gantt.html b/flux/www/templates/admin/gantt.html similarity index 100% rename from src/www/templates/admin/gantt.html rename to flux/www/templates/admin/gantt.html diff --git a/src/www/templates/admin/graph.html b/flux/www/templates/admin/graph.html similarity index 100% rename from src/www/templates/admin/graph.html rename to flux/www/templates/admin/graph.html diff --git a/src/www/templates/admin/index.html b/flux/www/templates/admin/index.html similarity index 100% rename from src/www/templates/admin/index.html rename to flux/www/templates/admin/index.html diff --git a/src/www/templates/admin/master.html b/flux/www/templates/admin/master.html similarity index 100% rename from src/www/templates/admin/master.html rename to flux/www/templates/admin/master.html diff --git a/src/www/templates/admin/tree.html b/flux/www/templates/admin/tree.html similarity index 100% rename from src/www/templates/admin/tree.html rename to flux/www/templates/admin/tree.html diff --git a/init.sh b/init.sh index 903076780c5d4..eb5415e5cc6c4 100644 --- a/init.sh +++ b/init.sh @@ -1,3 +1,3 @@ #!/bin/bash source $FLUX_HOME/env/bin/activate -export PYTHONPATH=$FLUX_HOME/src +export PYTHONPATH=$FLUX_HOME diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000000..364788bf410d9 --- /dev/null +++ b/setup.py @@ -0,0 +1,16 @@ +import os +from distutils.core import setup +from pip.req import parse_requirements + +req_filepath = os.path.join(os.path.dirname(__file__), "/requirements.txt") +install_reqs = parse_requirements(req_filepath) + +setup( + name='flux', + version='0.1', + packages=['flux'], + install_requires=install_reqs, + author='Maxime Beauchemin', + author_email='maximebeauchemin@gmail.com', +) +