-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
setup.py
129 lines (122 loc) · 5.98 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: setup.py
#
# Part of ‘UNICORN Binance REST API’
# Project website: https://www.lucit.tech/unicorn-binance-rest-api.html
# Github: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-rest-api
# Documentation: https://unicorn-binance-rest-api.docs.lucit.tech
# PyPI: https://pypi.org/project/unicorn-binance-rest-api
# LUCIT Online Shop: https://shop.lucit.services/software
#
# License: LSOSL - LUCIT Synergetic Open Source License
# https://github.com/LUCIT-Systems-and-Development/unicorn-binance-rest-api/blob/master/LICENSE
#
# Author: LUCIT Systems and Development
#
# Copyright (c) 2017-2021, MIT License, Sam McHardy (https://github.com/sammchardy)
# Copyright (c) 2021-2023, LSOSL License, LUCIT Systems and Development (https://www.lucit.tech)
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# tribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the fol-
# lowing conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from Cython.Build import cythonize
from setuptools import setup, find_packages, Extension
import os
import shutil
import subprocess
name = "unicorn-binance-rest-api"
source_dir = "unicorn_binance_rest_api"
stubs_dir = "stubs"
extensions = [
Extension("*", [f"{source_dir}/*.py"]),
]
# Setup
print("Generating stub files ...")
os.makedirs(stubs_dir, exist_ok=True)
for filename in os.listdir(source_dir):
if filename.endswith('.py'):
source_path = os.path.join(source_dir, filename)
subprocess.run(['stubgen', '-o', stubs_dir, source_path], check=True)
for stub_file in os.listdir(os.path.join(stubs_dir, source_dir)):
if stub_file.endswith('.pyi'):
source_stub_path = os.path.join(stubs_dir, source_dir, stub_file)
if os.path.exists(os.path.join(source_dir, stub_file)):
print(f"Skipped moving {source_stub_path} because {os.path.join(source_dir, stub_file)} already exists!")
else:
shutil.move(source_stub_path, source_dir)
print(f"Moved {source_stub_path} to {source_dir}!")
shutil.rmtree(os.path.join(stubs_dir))
print("Stub files generated and moved successfully.")
with open("README.md", "r") as fh:
print("Using README.md content as `long_description` ...")
long_description = fh.read()
setup(
name=name,
version="2.6.1",
author="LUCIT Systems and Development",
author_email='[email protected]',
url="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-rest-api",
description="A Python SDK by LUCIT to use the Binance REST API`s (com+testnet, com-margin+testnet, "
"com-isolated_margin+testnet, com-futures+testnet, us, tr) in a simple, fast, flexible, robust and "
"fully-featured way.",
long_description=long_description,
long_description_content_type="text/markdown",
license='LSOSL - LUCIT Synergetic Open Source License',
install_requires=['certifi>=2023.7.22', 'colorama', 'cryptography>=42.0.4', 'dateparser', 'pyOpenSSL',
'requests>=2.31.0', 'service-identity', 'ujson', 'regex', 'PySocks', 'Cython',
'lucit-licensing-python>=1.8.2'],
keywords='',
project_urls={
'Howto': 'https://www.lucit.tech/unicorn-binance-rest-api.html#howto',
'Documentation': 'https://unicorn-binance-rest-api.docs.lucit.tech',
'Changes': 'https://unicorn-binance-rest-api.docs.lucit.tech/changelog.html',
'License': 'https://unicorn-binance-rest-api.docs.lucit.tech/license.html',
'Issue Tracker': 'https://github.com/LUCIT-Systems-and-Development/unicorn-binance-rest-api/issues',
'Wiki': 'https://github.com/LUCIT-Systems-and-Development/unicorn-binance-rest-api/wiki',
'Author': 'https://www.lucit.tech',
'Chat': 'https://gitter.im/unicorn-binance-suite/unicorn-binance-rest-api',
'Telegram': 'https://t.me/unicorndevs',
'Get Support': 'https://www.lucit.tech/get-support.html',
'LUCIT Online Shop': 'https://shop.lucit.services/software',
},
packages=find_packages(exclude=[f"dev/{source_dir}"], include=[source_dir]),
ext_modules=cythonize(extensions, compiler_directives={'language_level': "3"}),
python_requires='>=3.7.0',
package_data={'': ['*.so', '*.dll', '*.py', '*.pyd', '*.pyi']},
include_package_data=True,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: Other/Proprietary License",
'Intended Audience :: Developers',
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Topic :: Office/Business :: Financial :: Investment",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)