forked from zebra-lucky/python-bls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
59 lines (43 loc) · 1.34 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
#!/usr/bin/python3
import sys
from setuptools import setup
from setuptools.extension import Extension
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
description='BLS12-381 and Signatures in python'
long_description=('Implements the BLS12 curve and optimal ate pairing, '
'as well as BLS signatures and aggregation. Use for '
'reference / educational purposes only. '
'Based on reference implementation from Chia BLS Signatures')
if sys.platform in ('windows', 'win32'):
MP_LIB = 'mpir'
else:
MP_LIB = 'gmp'
ext = '.pyx' if USE_CYTHON else '.c'
if sys.platform == 'darwin':
extensions = [
Extension('bls_py.fields_t_c', [f'extmod/bls_py/fields_t_c{ext}'],
extra_objects=['gmp/libgmp.a']),
]
else:
extensions = [
Extension('bls_py.fields_t_c', [f'extmod/bls_py/fields_t_c{ext}'],
libraries=[MP_LIB]),
]
if USE_CYTHON:
extensions = cythonize(extensions)
setup(
name='python-bls',
version='0.1.10',
url='https://github.com/zebra-lucky/python-bls',
license='Apache License 2.0',
python_requires='>=3.6',
packages=['bls_py'],
ext_modules=extensions,
platforms='any',
description=description,
long_description=long_description,
)