forked from bmoscon/cryptofeed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
152 lines (136 loc) · 5.21 KB
/
setup.py
File metadata and controls
152 lines (136 loc) · 5.21 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
'''
Copyright (C) 2017-2025 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
'''
import os
import sys
from setuptools import Extension, setup
from setuptools import find_packages
from setuptools.command.test import test as TestCommand
from Cython.Build import cythonize
_BASE_REQUIREMENTS = [
"aiodns>=1.1",
"aiofile>=2.0.0",
"aiohttp>=3.9.5",
"charset-normalizer>=3.3.0",
"cython",
"order_book>=0.6.1",
"pyyaml",
"requests>=2.18.4",
"websockets>=14.1",
"orjson>=3.10.0",
]
def get_long_description():
"""Read the contents of README.md, INSTALL.md and CHANGES.md files."""
from os import path
repo_dir = path.abspath(path.dirname(__file__))
markdown = []
for filename in ["README.md", "INSTALL.md", "CHANGES.md"]:
with open(path.join(repo_dir, filename), encoding="utf-8") as markdown_file:
markdown.append(markdown_file.read())
return "\n\n----\n\n".join(markdown)
def load_requirements(filename: str = "requirements.txt") -> list[str]:
repo_dir = os.path.abspath(os.path.dirname(__file__))
path = os.path.join(repo_dir, filename)
requirements: list[str] = []
try:
with open(path, encoding="utf-8") as req_file:
for raw_line in req_file:
line = raw_line.strip()
if not line or line.startswith("#"):
continue
if "#" in line:
line = line.split("#", 1)[0].strip()
if line:
requirements.append(line)
except FileNotFoundError:
return list(_BASE_REQUIREMENTS)
return requirements or list(_BASE_REQUIREMENTS)
class Test(TestCommand):
def run_tests(self):
import pytest
errno = pytest.main(['tests/'])
sys.exit(errno)
extra_compile_args = ["/O2" if os.name == "nt" else "-O3"]
define_macros = []
# comment out line to compile with type check assertions
# verify value at runtime with cryptofeed.types.COMPILED_WITH_ASSERTIONS
define_macros.append(('CYTHON_WITHOUT_ASSERTIONS', None))
extension = Extension("cryptofeed.types", ["cryptofeed/types.pyx"],
extra_compile_args=extra_compile_args,
define_macros=define_macros)
setup(
name="cryptofeed",
ext_modules=cythonize([extension], language_level=3, force=True),
version="2.4.1",
author="Bryant Moscon",
author_email="bmoscon@gmail.com",
description="Cryptocurrency Exchange Websocket Data Feed Handler",
long_description=get_long_description(),
long_description_content_type="text/markdown",
license="XFree86",
keywords=["cryptocurrency", "bitcoin", "btc", "feed handler", "market feed", "market data", "crypto assets",
"Trades", "Tickers", "BBO", "Funding", "Open Interest", "Liquidation", "Order book", "Bid", "Ask",
"fmfw.io", "Bitfinex", "bitFlyer", "AscendEX", "Bitstamp", "Blockchain.com", "Bybit",
"Binance", "Binance Delivery", "Binance Futures", "Binance US", "BitMEX", "Coinbase", "Deribit", "EXX",
"Gate.io", "Gemini", "HitBTC", "Huobi", "Huobi DM", "Huobi Swap", "Kraken",
"Kraken Futures", "OKCoin", "OKX", "Poloniex", "ProBit", "Upbit"],
url="https://github.com/bmoscon/cryptofeed",
packages=find_packages(exclude=['tests*']),
cmdclass={'test': Test},
python_requires='>=3.9',
classifiers=[
"Intended Audience :: Developers",
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: AsyncIO",
],
tests_require=["pytest"],
install_requires=list(_BASE_REQUIREMENTS),
extras_require={
"arctic": ["arctic", "pandas"],
"backpack": ["PyNaCl>=1.5"],
"ccxt": ["ccxt>=4.5.9", "pydantic>=2.0.0", "pydantic-settings>=2.0.0"],
"gcp_pubsub": ["google_cloud_pubsub>=2.4.1", "gcloud_aio_pubsub"],
"kafka": ["aiokafka>=0.7.0"],
"mongo": ["motor"],
"postgres": ["asyncpg"],
"proxy": ["aiohttp-socks>=0.9.2", "python-socks>=2.4.3"],
"quality": ["pyscn>=0.6.0"],
"quasardb": ["quasardb", "numpy"],
"rabbit": ["aio_pika", "pika"],
"redis": ["hiredis", "redis>=4.5.1"],
"uvloop": ['uvloop; platform_system!="Windows"'],
"zmq": ["pyzmq"],
"socks": ["python-socks>=2.4.3"],
"all": [
"arctic",
"pandas",
"google_cloud_pubsub>=2.4.1",
"gcloud_aio_pubsub",
"aiokafka>=0.7.0",
"motor",
"asyncpg",
"aio_pika",
"pika",
"hiredis",
"redis>=4.5.1",
"pyzmq",
"aiohttp-socks>=0.9.2",
"python-socks>=2.4.3",
"pyscn>=0.6.0",
"quasardb",
"numpy",
"PyNaCl>=1.5",
"ccxt>=4.5.9",
"pydantic>=2.0.0",
"pydantic-settings>=2.0.0",
'uvloop; platform_system!="Windows"',
],
},
)