-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
78 lines (62 loc) · 2.05 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
import subprocess
import sys
import os
from os import path
from setuptools import setup
from setuptools.command.install import install
VERSION = "1.6.1"
here = path.abspath(path.dirname(__file__))
with open('README.rst') as f:
readme = f.read()
class MyInstall(install):
def run(self):
try:
subprocess.call(['python', 'prepare.py'], cwd=here)
except Exception as e:
print(e)
exit(1)
else:
install.run(self)
class VerifyVersionCommand(install):
"""Custom command to verify that the git tag matches our version"""
description = 'verify that the git tag matches our version'
def run(self):
tag = os.getenv('CIRCLE_TAG')
if tag != "v%s" % VERSION:
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, "v%s" % VERSION
)
sys.exit(info)
bbclib_requires = [
'pyOpenSSL>=16.2.0',
'cryptography>=2.1.4',
'msgpack-python>=0.4.8',
'bson'
]
bbclib_packages = ['bbclib', 'bbclib.libs', 'bbclib.compat']
bbclib_commands = [
'install_libbbcsig',
'copy_libbbcsig'
]
bbclib_classifiers = [
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Software Development']
setup(
name='py-bbclib',
version=VERSION,
description='The library of BBc-1 transaction data structure definition',
long_description=readme,
long_description_content_type='text/markdown',
url='https://github.com/beyond-blockchain/py-bbclib',
author='beyond-blockchain.org',
author_email='[email protected]',
license='Apache License 2.0',
classifiers=bbclib_classifiers,
cmdclass={'install': MyInstall, 'verify': VerifyVersionCommand},
packages=bbclib_packages,
scripts=bbclib_commands,
install_requires=bbclib_requires,
zip_safe=False)