-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathsetup.py
More file actions
121 lines (115 loc) · 5.17 KB
/
Copy pathsetup.py
File metadata and controls
121 lines (115 loc) · 5.17 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# File: setup.py
#
# Part of ‘UnicornFy’
# Project website: https://github.com/oliver-zehentleitner/unicorn-fy
# Github: https://github.com/oliver-zehentleitner/unicorn-fy
# Documentation: https://oliver-zehentleitner.github.io/unicorn-fy
# PyPI: https://pypi.org/project/unicorn-fy
#
# License: MIT
# https://github.com/oliver-zehentleitner/unicorn-fy/blob/master/LICENSE
#
# Author: Oliver Zehentleitner
#
# Copyright (c) 2019-2026, Oliver Zehentleitner (https://about.me/oliver-zehentleitner)
# 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-fy"
source_dir = "unicorn_fy"
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="0.17.2",
author="Oliver Zehentleitner",
url="https://github.com/oliver-zehentleitner/unicorn-fy",
description="Normalizes raw responses from crypto exchange APIs (Binance & co.) into consistent, "
"cleanly-typed Python dictionaries. A transformation layer that makes exchange data "
"interchangeable instead of exchange-specific.",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
install_requires=["orjson", "requests", "Cython"],
keywords="binance, api, exchange, unicornfy, binance-dex, binance-chain, rest-api, websockets",
project_urls={
"Documentation": "https://oliver-zehentleitner.github.io/unicorn-fy#related-articles",
"Wiki": "https://github.com/oliver-zehentleitner/unicorn-fy/wiki",
"Author": "https://www.linkedin.com/in/oliver-zehentleitner",
"Changes": "https://oliver-zehentleitner.github.io/unicorn-fy/changelog.html",
"License": "https://oliver-zehentleitner.github.io/unicorn-fy/license.html",
"Issue Tracker": "https://github.com/oliver-zehentleitner/unicorn-fy/issues",
"Telegram": "https://t.me/unicorndevs",
"Umbrella Project": "https://github.com/oliver-zehentleitner/unicorn-binance-suite",
},
packages=find_packages(exclude=[f"dev/{source_dir}"], include=[source_dir]),
ext_modules=cythonize(extensions, compiler_directives={"language_level": "3"}),
python_requires=">=3.9.0",
package_data={"": ["*.so", "*.dll", "*.py", "*.pyd", "*.pyi"]},
include_package_data=True,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"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",
],
)