diff options
Diffstat (limited to 'setup.py')
| -rw-r--r-- | setup.py | 23 | 
1 files changed, 21 insertions, 2 deletions
@@ -1,6 +1,25 @@ -from setuptools import setup, find_packages +import os +import pkgutil  import sys -sys.path.insert(1, 'relic') +from setuptools import setup, find_packages +from subprocess import check_call, CalledProcessError + + +if not pkgutil.find_loader('relic'): +    relic_local = os.path.exists('relic') +    relic_submodule = (relic_local and +                       os.path.exists('.gitmodules') and +                       not os.listdir('relic')) +    try: +        if relic_submodule: +            check_call(['git', 'submodule', 'update', '--init', '--recursive']) +        elif not relic_local: +            check_call(['git', 'clone', 'https://github.com/spacetelescope/relic.git']) + +        sys.path.insert(1, 'relic') +    except CalledProcessError as e: +        print(e) +        exit(1)  import relic.release  | 
