-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathsetup.py
162 lines (148 loc) · 4.16 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/usr/bin/env python
"""
pip3 installations
tulip and talib installations
"""
import os
from subprocess import call
from setuptools import setup, find_packages
class ChangeDirectory:
"""
Context manager for changing the current working directory
h/t @ brianmhunt
"""
def __init__(self, new_path):
self.new_path = os.path.expanduser(new_path)
self.saved_path = os.getcwd()
def __enter__(self):
os.chdir(self.new_path)
def __exit__(self, etype, value, traceback):
os.chdir(self.saved_path)
def it(style, text):
"""
Colored text in terminal
"""
emphasis = {
"red": 91,
"green": 92,
"yellow": 93,
"blue": 94,
"purple": 95,
"cyan": 96,
}
return ("\033[%sm" % emphasis[style]) + str(text) + "\033[0m"
def talib_tulip():
"""
Intall Tulip and Talib quantiative indicators packages
"""
# talib and tulip tarballs are included in extinction-event
# if you prefer original copies use:
# https://github.com/TulipCharts/
# tulipindicators/archive/v0.8.0.tar.gz
# https://downloads.sourceforge.net/project/ta-lib/
# ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz
print("\n\n")
print("Installing TALIB and TULIP")
print("\n\n")
# un tarball, create two folders
call(["tar", "-xzf", "ta-lib-0.4.0-src.tar.gz"])
call(["tar", "-xzf", "tulipindicators-0.8.0.tar.gz"])
# enter the folders individually, make, and ChangeDirectory ..
folder = str(os.path.dirname(os.path.abspath(__file__))) + "/"
with ChangeDirectory(folder + "ta-lib"):
call(["./configure", "--prefix=/usr"])
call(["make"])
call(["sudo", "make", "install"])
with ChangeDirectory(folder + "tulipindicators-0.8.0"):
call("make")
print("\n\n")
print("TALIB and TULIP indicator package installs complete\n\n")
def upgrade_pylint():
"""
Upgrade pylint to pylint3
"""
call(["sudo", "-H", "pip3", "install", "pylint", "--upgrade"])
__VERSION__ = "0.13"
talib_tulip()
print("\n\nInstalling requirements.txt...\n\n")
setup(
name="extinction-event",
version=__VERSION__,
description=(
"Extinction Event" "Bitshares Distributed Exchange Algo Trading Tools"
),
long_description=open("README.md").read(),
download_url="https://github.com/litepresence/extinction-event/tarball/"
+ __VERSION__,
author="litepresence",
author_email="[email protected]",
url="http://www.litepresence.com",
keywords=[
"bts",
"bitshares",
"bitsharesquant",
"quant",
"quantitative",
"palmpay",
"beet",
"dexbot",
"crypto-bridge",
"rudex",
"easydex",
"cryptobridge",
"btc",
"bitcoin",
"openledger",
"open-ledger",
"crypto",
"altcoin",
"cryptocurrency",
"smart",
"contract",
"distributed",
"exchange",
"dex",
"honey badger",
"microdex",
"micro dex",
"micro",
"honeybadger",
"metanode",
"meta node",
"meta",
"litepresence",
"latencytest",
"latency test",
"latency",
"back test",
"backtest",
"backtesting",
"algo",
"algorithmic",
"test",
"quant",
"trading",
"bot",
"botscript",
"bot script",
"extinction event",
"extinction-event",
"extinctionevent",
],
packages=find_packages(),
classifiers=[
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Information Analysis",
],
install_requires=open("requirements.txt").read().split(),
setup_requires=["pytest-runner"],
tests_require=["pytest"],
include_package_data=True,
)
upgrade_pylint()
print(it("green", "bitsharesQUANT installation complete\n\n"))
print("For your future convenience, ENTER this alias command:\n")
print(it("yellow", " alias pylint=pylint3\n"))