This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
generated from volpatto/blank-python-project
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py
114 lines (99 loc) · 3.03 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import platform
import io
import os
import sys
from setuptools import find_packages, setup, Extension
# Detecting target platform
PLATFORMS = {"windows", "linux", "darwin", "cygwin", "android"}
target = platform.system().lower()
if "pydroid3" in sys.executable.lower():
target = "android"
for known in PLATFORMS:
if target.startswith(known):
target = known
if target not in PLATFORMS:
target = "linux"
if platform.processor() == "arm" and target == "darwin":
target = 'darwin-arm64'
elif platform.processor() in ["arm", "aarch64"]:
target = "aarch64"
# C/C++ Extensions
LIBRARIES = []
STATIC_LIBRARIES = ["blst"]
STATIC_LIB_DIR = f"blst-lib/{target}"
LIBRARY_DIRS = ["blst-lib/"]
INCLUDE_DIRS = ["blst-lib/"]
SOURCES = [
"blst-lib/blst_wrap.cpp",
]
DEPENDS = [
"blst-lib/blst.h",
"blst-lib/blst.hpp",
"blst-lib/blst_aux.h",
"blst-lib/libblst.a",
"blst-lib/blstlib.dll",
]
LIBRARIES.extend(STATIC_LIBRARIES)
LIBRARY_DIRS.append(STATIC_LIB_DIR)
if target == "windows":
EXTRA_OBJECTS = [
"{}/{}.lib".format(STATIC_LIB_DIR, lib_name) for lib_name in STATIC_LIBRARIES
]
else: # POSIX
EXTRA_OBJECTS = [
"{}/lib{}.a".format(STATIC_LIB_DIR, lib_name) for lib_name in STATIC_LIBRARIES
]
ext_modules = [
Extension(
"lido_sdk.blstverify._blst",
sources=SOURCES,
depends=DEPENDS,
include_dirs=INCLUDE_DIRS,
libraries=LIBRARIES,
library_dirs=LIBRARY_DIRS,
extra_objects=EXTRA_OBJECTS,
py_limited_api=True,
extra_compile_args=["-std=c++11"],
),
]
# ---------------- setup --------------------
here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = "\n" + f.read()
# Where the magic happens:
setup(
name="lido-sdk",
version="4.1.0",
description="This library consolidates various functions to efficiently load network data for Lido,"
" validate node operator keys and find key duplicates.",
long_description=long_description,
long_description_content_type="text/markdown",
author="Lido",
author_email="[email protected]",
python_requires=">=3.7,<4",
url="https://github.com/lidofinance/lido-python-sdk",
package_dir={"": "."},
packages=find_packages(exclude=("tests",)),
package_data={"lido_sdk.contract": ["abi/*.json"]},
install_requires=[
"multicall==0.1.3",
"web3>=5.23.1,<6",
"ssz>=0.2.4,<1",
],
tests_require=["pytest==6.2.4"],
include_package_data=True,
license="MIT",
classifiers=[
"License :: OSI Approved :: MIT License",
"Development Status :: 5 - Production/Stable",
# Supported Python versions
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
ext_modules=ext_modules,
dependency_links=[],
)