This repository has been archived by the owner on Nov 30, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
setup.py
84 lines (69 loc) · 2.5 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env python
import sys
import os
import subprocess
from setuptools import setup, find_packages, __version__
from setuptools.command.develop import develop
from setuptools.command.install import install
v = sys.version_info
if sys.version_info < (3, 5):
msg = "FAIL: Requires Python 3.5 or later, " \
"but setup.py was run using {}.{}.{}"
v = sys.version_info
print(msg.format(v.major, v.minor, v.micro))
# noinspection PyPackageRequirements
print("NOTE: Installation failed. Run setup.py using python3")
sys.exit(1)
try:
SETUP_DIRNAME = os.path.dirname(__file__)
except NameError:
# We're probably being frozen, and __file__ triggered this NameError
# Work around this
SETUP_DIRNAME = os.path.dirname(sys.argv[0])
if SETUP_DIRNAME != '':
os.chdir(SETUP_DIRNAME)
SETUP_DIRNAME = os.path.abspath(SETUP_DIRNAME)
METADATA = os.path.join(SETUP_DIRNAME, 'sovrin_client', '__metadata__.py')
# Load the metadata using exec() so we don't trigger an import of ioflo.__init__
exec(compile(open(METADATA).read(), METADATA, 'exec'))
# create base dir if not already exists
BASE_DIR = os.path.join(os.path.expanduser("~"), ".sovrin")
SAMPLE_DIR = os.path.join(BASE_DIR, ".sovrin")
for path in [BASE_DIR, SAMPLE_DIR]:
if not os.path.exists(path):
os.makedirs(path)
def post_install():
subprocess.run(['python post-setup.py'], shell=True)
class EnhancedInstall(install):
def run(self):
install.run(self)
post_install()
class EnhancedInstallDev(develop):
def run(self):
develop.run(self)
post_install()
setup(
name='sovrin-client-dev',
version=__version__,
description='Sovrin client',
url='https://github.com/sovrin-foundation/sovrin-client.git',
author=__author__,
author_email='[email protected]',
license=__license__,
keywords='Sovrin Client',
packages=find_packages(exclude=['docs', 'docs*']) + [
'sample', 'data'],
package_data={
'': ['*.txt', '*.md', '*.rst', '*.json', '*.conf', '*.html',
'*.css', '*.ico', '*.png', 'LICENSE', 'LEGAL', '*.sovrin']},
include_package_data=True,
install_requires=['sovrin-common-dev==0.3.24', 'anoncreds-dev==0.4.7'],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'sovrin-node-dev==0.4.14'],
scripts=['scripts/sovrin', 'scripts/change_node_ha',
'scripts/add_new_node', 'scripts/reset_client'],
cmdclass={
'install': EnhancedInstall,
'develop': EnhancedInstallDev
}
)