Skip to content

Commit

Permalink
Merge pull request #85 from jhunkeler/relic-init-submodule
Browse files Browse the repository at this point in the history
Consolidate relic initialization
  • Loading branch information
pllim committed Mar 27, 2018
2 parents 91976c9 + 8f3e573 commit c7c9eb5
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
#!/usr/bin/env python
import os
import pkgutil
import sys
from glob import glob
from numpy import get_include as np_include
from setuptools import setup, Extension
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/jhunkeler/relic.git'])

sys.path.insert(1, 'relic')
except CalledProcessError as e:
print(e)
exit(1)

# Use submodule
sys.path.insert(1, 'relic')
import relic.release # noqa

version = relic.release.get_info()
Expand Down

0 comments on commit c7c9eb5

Please sign in to comment.