Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
150 lines (138 loc) · 4.67 KB
/
Copy pathpyproject.toml
File metadata and controls
150 lines (138 loc) · 4.67 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
[project]
# Renamed from the stale "myfxbookcopying". The name is now load-bearing:
# tradingbot-ui-backend depends on this project by name as a git dependency.
name = "tradingbot-framework"
version = "0.1.0"
description = "Kubernetes-native algorithmic trading framework: bots, backtesting and live brokers."
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"cachetools>=5.3.0",
"langchain>=0.3.0",
"langchain-openai>=0.2.0",
"fastapi>=0.115.0",
"fear-and-greed>=0.4",
"ipython>=9.4.0",
"jinja2>=3.1.6",
"numpy",
"pandas>=2.3.1",
"plotly>=5.24.0",
"psycopg2-binary>=2.9.10",
"pyportfolioopt>=1.5.6",
"quantstats>=0.0.62",
"scikit-learn>=1.7.1",
# Used directly by utils/svi.py (SVI fit) and utils/vol_estimators.py (GARCH).
# Already in the image through scikit-learn; listed so it cannot vanish.
"scipy>=1.11",
"sqlalchemy>=2.0.42",
"ta>=0.11.0",
"telethon>=1.36.0",
"tqdm>=4.67.1",
"uvicorn>=0.32.0",
"yfinance>=0.2.65",
# yfinance does not declare lxml, but Ticker.get_earnings_dates() imports it
# and raises ImportError without it. stock_fundamentals_loader catches that as
# a per-symbol warning, so the only symptom was stock_earnings silently never
# growing past its 213 seed rows. Explicit dependency, not an extra.
"lxml>=5.0.0",
"boto3>=1.35.0",
"huggingface_hub>=0.20.0",
"httpx>=0.25.0",
"python-dotenv>=1.0.0",
"ibind[oauth]>=0.1.23",
# Hyperliquid perps DEX SDK (Info/Exchange). Pure-Python + eth-account.
"hyperliquid-python-sdk>=0.24.0",
"exchange-calendars>=4.5",
]
[project.optional-dependencies]
dev = [
"catboost>=1.2.8",
"imbalanced-learn>=0.12.4",
"ipykernel>=6.30.0",
"matplotlib>=3.10.5",
"pandas>=2.3.1",
"pytest>=8.0.0",
"pytest-mock>=3.12.0",
"scikit-learn>=1.7.1",
"tqdm>=4.67.1",
"xgboost>=3.0.3",
"yfinance>=0.2.65",
]
docs = [
"mkdocs>=1.5.0",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.24.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
# Ship only the package. Without this, hatchling cannot infer what to include
# (the project name no longer matches a top-level directory) and the build fails.
#
# Adding a build-system makes this a *packaged* project rather than a virtual
# one, so `uv sync` now wants to build and install the root. The Dockerfile syncs
# dependencies before COPYing the source, so it passes --no-install-project; the
# package reaches the image via COPY + PYTHONPATH=/app as it always has.
packages = ["tradingbot"]
[tool.uv.sources]
imbalanced-learn = { git = "https://github.com/scikit-learn-contrib/imbalanced-learn", rev = "master" }
[dependency-groups]
dev = [
"debugpy>=1.8.20",
"mypy>=2.3.0",
"openpyxl>=3.1.5",
"ruff>=0.16.2",
]
[tool.pytest.ini_options]
# Single root: both tests and the modules under test import via the
# `tradingbot.` package root (e.g. `tradingbot.utils.X`). This is the only
# root on sys.path, so a module is never loaded twice under two different
# names (which used to yield two distinct classes / two SQLAlchemy Base
# registries for the same module).
pythonpath = ["."]
testpaths = ["tests"]
[tool.ruff]
line-length = 120
target-version = "py312"
extend-exclude = [
".claude",
"exploration",
"scripts/nilsson_submission",
]
[tool.ruff.lint]
select = ["E", "W", "F", "I", "UP", "B", "SIM", "C4", "RUF"]
ignore = [
"E501", # line length is handled by `ruff format`; remaining long lines
# are intentional (LLM prompt strings, error-message f-strings)
"RUF001", "RUF002", "RUF003", # ambiguous-unicode: internal codebase uses
# em-dashes/curly quotes intentionally
]
[tool.ruff.lint.isort]
known-first-party = ["tradingbot"]
[tool.ruff.format]
quote-style = "double"
line-ending = "auto"
[tool.mypy]
python_version = "3.12"
check_untyped_defs = true
warn_unused_ignores = true
warn_redundant_casts = true
disallow_untyped_defs = false
exclude = [
"^exploration/",
"^kronos_space/",
"^scripts/nilsson_submission/",
]
[[tool.mypy.overrides]]
module = [
"ta.*", "yfinance.*", "hyperliquid.*", "ibind.*", "telethon.*", "pypfopt.*",
"sklearn.*", "boto3.*", "botocore.*", "psycopg2.*", "pandas.*",
"fear_and_greed", "cachetools.*", "scipy.*", "tqdm.*",
]
ignore_missing_imports = true
[tool.ske]
namespace = "tradingbots-2025"
configmap = "tradingbot-env" # non-secret env (from .env.cloud)
secret = "tradingbot-secrets" # must match .Values.secretName in the Helm chart
config_files = [".env.cloud"] # .env holds local-dev values; pods take settings from values.yaml