aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2018-08-03 13:51:20 -0400
committerGitHub <noreply@github.com>2018-08-03 13:51:20 -0400
commit4f4a60cba3d46ba656a31a93710b1e069c2e04fb (patch)
tree178226d3effa9b7f517202be07693c477c5e512d /setup.py
parent803ce780675d76b23ca142da201720eeb26863a2 (diff)
downloadverhawk-4f4a60cba3d46ba656a31a93710b1e069c2e04fb.tar.gz
Reimplement RELIC with latest standard method (#7)HEAD0.0.3master
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 9ce4444..96c14b2 100644
--- a/setup.py
+++ b/setup.py
@@ -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