forked from robcarver17/pysystemtrade
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·134 lines (113 loc) · 4.53 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
from __future__ import print_function
import os
import sys
import platform
from setuptools import setup, find_packages
from distutils.version import StrictVersion
if StrictVersion(platform.python_version()) <= StrictVersion("3.10.0"):
print("pysystemtrade requires Python 3.10.0 or later. Exiting.", file=sys.stderr)
sys.exit(1)
def read(fname):
"""Utility function to read the README file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def package_files(directory, extension="yaml"):
paths = []
for path, directories, filenames in os.walk(directory):
for filename in filenames:
if filename.split(".")[-1] == extension:
paths.append(os.path.join("..", path, filename))
return paths
def dir_this_file():
return os.path.dirname(os.path.realpath(__file__))
private_dir = os.path.join(dir_this_file(), "private")
private_yaml_files = package_files(private_dir, "yaml")
provided_dir = os.path.join(dir_this_file(), "systems", "provided")
provided_yaml_files = package_files(provided_dir, "yaml")
control_dir = os.path.join(dir_this_file(), "syscontrol")
control_yaml_files = package_files(control_dir, "yaml")
data_csv_path = os.path.join(dir_this_file(), "data")
data_csv_files = package_files(data_csv_path, "csv")
init_csv_path = os.path.join(dir_this_file(), "sysinit")
init_csv_files = package_files(init_csv_path, "csv")
test_data_csv_path = os.path.join(dir_this_file(), "sysdata")
test_data_csv_files = package_files(test_data_csv_path, "csv")
default_config_path = os.path.join(dir_this_file(), "sysdata", "config")
default_config_yaml_files = package_files(default_config_path, "yaml")
brokers_csv_path = os.path.join(dir_this_file(), "sysbrokers")
brokers_csv_files = package_files(brokers_csv_path, "csv")
brokers_yaml_path = os.path.join(dir_this_file(), "sysbrokers")
brokers_yaml_files = package_files(brokers_yaml_path, "yaml")
package_data = {
"": private_yaml_files
+ provided_yaml_files
+ data_csv_files
+ test_data_csv_files
+ brokers_csv_files
+ brokers_yaml_files
+ control_yaml_files
+ default_config_yaml_files
}
print(package_data)
setup(
name="pysystemtrade",
version="1.8.2",
author="Robert Carver",
description=(
"Python framework for running systems as in Robert Carver's book Systematic Trading"
" (https://www.systematicmoney.org/systematic-trading)"
),
license="GNU GPL v3",
keywords="systematic trading interactive brokers",
url="https://qoppac.blogspot.com/p/pysystemtrade.html",
packages=find_packages(),
package_data=package_data,
long_description=read("README.md"),
install_requires=[
"pandas>=1.5.3,<=2.1.3",
"matplotlib>=3.0.0",
"PyYAML>=5.3",
"numpy>=1.24.0",
"scipy>=1.0.0",
"pymongo==3.11.3",
"psutil==5.6.7",
"pymongo==3.11.0",
"arctic==1.82.0",
"psutil==5.6.6",
"pytest>6.2",
"Flask>=2.0.1",
"Werkzeug>=2.0.1",
"statsmodels==0.14.0",
"PyPDF2>=2.5.0",
"pyarrow>=14.0.1",
"scikit-learn>1.3.0",
"requests>=2.25",
"trading-ig",
"beautifulsoup4>4.9",
"ratelimit>=2.2",
"tenacity>=8.0",
"munch>=2.5",
"pytz==2023.3",
],
tests_require=["nose", "flake8"],
extras_require=dict(),
test_suite="nose.collector",
include_package_data=True,
entry_points={
"console_scripts": [
"pst = sysproduction.pst:pst",
"pst-slippage = sysproduction.update_slippage:update_slippage",
# "pst-startup = sysproduction.startup:startup",
"pst-stack = sysproduction.run_stack_handler:run_stack_handler",
"pst-capital = sysproduction.run_capital_update:run_capital_update",
"pst-fx = sysproduction.run_daily_fx_and_contract_updates:run_daily_fx_and_contract_updates",
"pst-prices = sysproduction.run_daily_price_updates:run_daily_price_updates",
"pst-multadj = sysproduction.run_daily_update_multiple_adjusted_prices:run_daily_update_multiple_adjusted_prices",
"pst-systems = sysproduction.run_systems:run_systems",
"pst-orders = sysproduction.run_strategy_order_generator:run_strategy_order_generator",
"pst-clean = sysproduction.run_cleaners:run_cleaners",
"pst-backup = sysproduction.run_backups:run_backups",
"pst-reports = sysproduction.run_reports:run_reports",
# "pst-monitor = syscontrol.monitor:monitor",
],
},
)