Commit 912fc3b2 authored by Fabrice  ALLAIN's avatar Fabrice ALLAIN
Browse files

First attempt to change aria nested tree for setuptools installation

parent 5dade88e
......@@ -4,7 +4,7 @@
.idea
build/
dist/
ariaec.egg-info/
aria.egg-info/
.eggs/
docs/_static/
docs/_templates/
......
......@@ -4,3 +4,5 @@ include *.md
include COPYRIGHT
prune examples-dev*
prune examples*
recursively-exclude examples-dev *
recursively-exclude examples *
\ No newline at end of file
......@@ -79,6 +79,13 @@ def get_aria_root():
"""
import os
import aria
print("test")
print(__name__)
print("test2")
print(pkgr.resource_filename(__name__, 'data2'))
ext_paths = ('data', 'templates/xml', 'templates/csh', 'cns/toppar',
'cns/protocols', 'cns/protocols/analysis')
# First we check if aria is installed as a python package. In this case,
# we need to check if data and cns directories are in the aria module (could
# probably change in the future if we modify aria tree structure and setup
......@@ -119,12 +126,12 @@ def get_aria_root():
aria_path = os.environ[ARIA_ENV]
missing = not os.path.exists(aria_path)
while missing:
aria_path = get_path()
missing = not os.path.exists(aria_path)
if not missing:
os.environ[ARIA_ENV] = aria_path
del os
# while missing:
# aria_path = get_path()
# missing = not os.path.exists(aria_path)
# if not missing:
# os.environ[ARIA_ENV] = aria_path
# del os
return aria_path
......@@ -164,26 +171,26 @@ class AriaBaseClass:
has_root = 1 if 'install_path' in locals() and 'data_path' in locals() \
else 0
if not has_root:
import sys
import os
install_path = get_aria_root()
# misc. files (templates, etc) are stored here
data_path = os.path.join(install_path, 'src/py/data')
# CNS specific files
toppar_path = os.path.join(install_path, 'cns/toppar')
protocols_path = os.path.join(install_path, 'cns/protocols')
analysis_path = os.path.join(protocols_path, 'analysis')
cns_directories = {'toppar': toppar_path,
'protocols': protocols_path,
'analysis': analysis_path}
del os
del sys
# if not has_root:
#
# import sys
# import os
#
# install_path = get_aria_root()
#
# # misc. files (templates, etc) are stored here
# data_path = os.path.join(install_path, 'src/py/data')
#
# # CNS specific files
# toppar_path = os.path.join(install_path, 'cns/toppar')
# protocols_path = os.path.join(install_path, 'cns/protocols')
# analysis_path = os.path.join(protocols_path, 'analysis')
#
# cns_directories = {'toppar': toppar_path,
# 'protocols': protocols_path,
# 'analysis': analysis_path}
# del os
# del sys
def __init__(self, settings=None, name=None):
"""
......
......@@ -97,7 +97,7 @@ upgrade it via:
$ pip install --upgrade pip
"""), file=sys.stderr)
sys.exit(1)
sys.exit(0)
if not is_installed('setuptools>=18.0'):
print(textwrap.dedent("""
......@@ -106,7 +106,7 @@ upgrade it via:
$ pip install --upgrade setuptools
"""), file=sys.stderr)
sys.exit(1)
sys.exit(0)
if not is_installed('numpy>=1.11.0'):
print(textwrap.dedent("""
......@@ -114,7 +114,7 @@ Error: numpy needs to be installed first. You can install it via:
$ pip install numpy
"""), file=sys.stderr)
sys.exit(1)
sys.exit(0)
if not is_installed('matplotlib'):
print(textwrap.dedent("""
......@@ -122,7 +122,7 @@ Error: matplotlib needs to be installed first. You can install it via:
$ pip install matplotlib
"""), file=sys.stderr)
sys.exit(1)
sys.exit(0)
def setup_package():
......@@ -207,12 +207,13 @@ def setup_package():
# 'aria.src.xml': 'src/xml',
# 'aria.src.csh': 'src/csh'},
packages=find_packages(exclude=("examples*", "examples-dev*")),
packages=find_packages(exclude=("examples*",)),
# Install any data files found in the package
include_package_data=True,
exclude_package_data={'': ['.gitignore', 'examples-dev/*']},
exclude_package_data={'': ['.gitignore'],
'examples': ['*']},
# Using MANIFEST file, we do not need package_data which doesn't work
# for all kind of building process ...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment