-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
185 lines (172 loc) · 5 KB
/
Copy pathpyproject.toml
File metadata and controls
185 lines (172 loc) · 5 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "stocklens"
version = "0.1.0"
description = "AI-driven stock analysis system: 10 data sources → 18 quant models → LLM reports → 10 push channels."
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.9"
authors = [
{ name = "W-M-R" },
]
# Runtime dependencies. Optional + heavy ones (akshare/yfinance/etc.) are
# pulled in by the bundled sub-packages or installed on demand; see
# requirements.txt for the deployed-server superset.
dependencies = [
"python-dotenv>=1.0.0",
"requests>=2.31.0", # transitive: akshare/yfinance/newspaper3k still depend on requests
"httpx>=0.27.0", # primary HTTP client for new code; pulsefan/querybus/cboe migrated
"pandas>=2.0.0",
"numpy>=1.24.0",
"sqlalchemy>=2.0.0",
"fastapi>=0.100.0",
"uvicorn>=0.23.0",
"starlette>=0.27.0",
"pydantic>=2.0.0",
"litellm>=1.30.0",
"Jinja2>=3.1.0",
"tenacity>=8.2.0",
"fake-useragent>=1.4.0",
"json-repair>=0.25.0",
"python-dateutil>=2.8.0",
"PyYAML>=6.0.0",
# Caching infrastructure (kvcache backends)
"cachetools>=5.3.0",
"diskcache>=5.6.0",
# Performance: orjson (7-8x JSON), uvloop (2-4x asyncio loop on POSIX),
# msgspec (~50x dataclass serialisation), polars (5-30x DataFrame ops),
# zstandard (kvcache pickle compression, ~50% size reduction),
# rapidfuzz (~2x faster fuzzy matching on Chinese name pools)
"orjson>=3.9.0",
'uvloop>=0.19.0; sys_platform != "win32"',
"msgspec>=0.18.0",
"polars>=1.0.0",
"zstandard>=0.21.0",
"rapidfuzz>=3.0.0",
# Reliability / security helpers
"pybreaker>=1.0.0",
"passlib>=1.7.4",
"itsdangerous>=2.1.0",
"markdown2>=2.4.0",
# SSE + env validation + rate-limit helpers
"sse-starlette>=1.6.0",
"pydantic-settings>=2.0.0",
"slowapi>=0.1.9",
]
[project.optional-dependencies]
data-sources = [
"akshare>=1.10.0",
"efinance>=0.5.0",
"yfinance>=0.2.28",
"baostock>=0.8.8",
"pytdx>=1.72",
"finvizfinance>=0.14.0",
]
search = [
"tavily-python>=0.3.0",
"google-search-results>=2.4.2",
"newspaper3k>=0.2.8",
]
bot = [
"lark-oapi>=1.0.0",
"dingtalk-stream>=0.9.0",
]
extras = [
"pypinyin>=0.49.0",
"exchange-calendars>=4.2.0",
"imgkit>=1.2.2",
"openpyxl>=3.1.0",
]
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
"ruff>=0.1.0",
"pre-commit>=3.5.0",
]
all = [
"stocklens[data-sources,search,bot,extras,dev]",
]
[project.urls]
Repository = "https://github.com/W-M-R/StockLens"
[project.scripts]
# Optional: enable ``python -m stocklens.auth.authenticator reset_password``
# to be invoked as ``stocklens-reset-password`` once installed.
stocklens-reset-password = "stocklens.auth.authenticator:reset_password_cli"
# ---------------------------------------------------------------------------
# Packaging
# ---------------------------------------------------------------------------
[tool.setuptools.packages.find]
where = ["."]
include = [
"stocklens*",
"api*",
"bot*",
]
exclude = [
"tests*",
"scripts*",
"docs*",
"logs*",
"data*",
"web*",
"templates*",
"strategies*",
"assets*",
"reports*",
# Sub-package working trees — each is its own Git repository (see ADR-0007).
# They are installed via `<pkg> @ file://./<pkg>` in requirements.txt and
# MUST NOT be packaged into the stocklens wheel.
"kvcache*",
"querybus*",
"pulsefan*",
"quantcore*",
"tickbridge*",
]
# ---------------------------------------------------------------------------
# Tooling
# ---------------------------------------------------------------------------
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q --strict-markers"
filterwarnings = [
# urllib3 v2 emits a noisy LibreSSL warning on macOS system Python; harmless.
"ignore::urllib3.exceptions.NotOpenSSLWarning",
]
# ---------------------------------------------------------------------------
# Coverage configuration (used when pytest-cov is installed).
# Run with:
# pytest tests/ --cov --cov-report=term-missing
# pytest tests/ --cov --cov-report=html (then open htmlcov/index.html)
# ---------------------------------------------------------------------------
[tool.coverage.run]
source = [
"stocklens",
"api",
"bot",
]
branch = true
omit = [
# Generated / data tables — coverage isn't meaningful here.
"stocklens/data/stock_mapping.py",
# Test scaffolding & integration tests with external deps.
"*/tests/*",
"scripts/*",
# CLI helpers exercised manually.
"*/cli.py",
]
[tool.coverage.report]
# Suppress lines that are explicitly never-executed (TYPE_CHECKING blocks etc.).
exclude_also = [
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@(abc\\.)?abstractmethod",
"class .*\\bProtocol\\):",
]
precision = 1
show_missing = true
skip_covered = false
[tool.coverage.html]
directory = "htmlcov"