-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathpyproject.toml
More file actions
314 lines (290 loc) · 10.5 KB
/
pyproject.toml
File metadata and controls
314 lines (290 loc) · 10.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
[project]
name = "dartlab"
version = "0.9.19"
description = "One stock code → full company story. Korean DART & US SEC EDGAR filings as structured Python data."
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.12"
authors = [
{name = "eddmpython"}
]
keywords = [
"dart",
"edgar",
"sec",
"financial-statements",
"korea",
"disclosure",
"accounting",
"polars",
"sections",
"mcp",
"ai-analysis",
"annual-report",
"10-k",
"xbrl",
"전자공시",
"재무제표",
"사업보고서",
"공시분석",
"다트",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Office/Business :: Financial",
"Topic :: Office/Business :: Financial :: Accounting",
"Topic :: Office/Business :: Financial :: Investment",
"Topic :: Scientific/Engineering :: Information Analysis",
"Natural Language :: Korean",
"Natural Language :: English",
"Typing :: Typed",
]
dependencies = [
# core (pyodide 호환 — polars, numpy, bs4, lxml은 pyodide 빌트인)
# core
"beautifulsoup4>=4.14.3,<5",
"diff-match-patch>=20230430",
"openpyxl>=3.1.5,<4",
# C 확장 — 일반: PyPI, pyodide: 빌트인 (버전 무관)
"lxml>=6.0.2,<7; sys_platform != 'emscripten'",
"lxml; sys_platform == 'emscripten'",
"polars>=1.0.0,<2; sys_platform != 'emscripten'",
"polars; sys_platform == 'emscripten'",
"numpy>=1.26.0,<3; sys_platform != 'emscripten'",
"numpy; sys_platform == 'emscripten'",
"pyarrow; sys_platform == 'emscripten'",
# network
"httpx>=0.28.1,<1; sys_platform != 'emscripten'",
"httpx; sys_platform == 'emscripten'",
"huggingface-hub>=0.20.0,<1; sys_platform != 'emscripten'",
"rich>=14.3.3,<15; sys_platform != 'emscripten'",
"rich; sys_platform == 'emscripten'",
# ai providers (pyodide 불필요)
"openai>=1.0.0,<3; sys_platform != 'emscripten'",
"google-genai>=1.0.0,<2; sys_platform != 'emscripten'",
"anthropic>=0.30.0,<2; sys_platform != 'emscripten'",
# server (pyodide 불필요)
"marimo>=0.23.1; sys_platform != 'emscripten'",
"fastapi>=0.135.1,<1; sys_platform != 'emscripten'",
"uvicorn[standard]>=0.30.0,<1; sys_platform != 'emscripten'",
"sse-starlette>=2.0.0,<3; sys_platform != 'emscripten'",
"mcp[cli]>=1.0; sys_platform != 'emscripten'",
"qrcode>=7.0,<9; sys_platform != 'emscripten'",
# viz
"plotly>=5.0.0,<6; sys_platform != 'emscripten'",
"plotext>=5.2.8,<6; sys_platform != 'emscripten'", # 터미널 ASCII 차트 (toAscii)
]
[project.scripts]
dartlab = "dartlab.cli.main:main"
[project.entry-points."dartlab.plugins"]
[project.urls]
Homepage = "https://eddmpython.github.io/dartlab/"
Repository = "https://github.com/eddmpython/dartlab"
Documentation = "https://eddmpython.github.io/dartlab/docs/"
Issues = "https://github.com/eddmpython/dartlab/issues"
Changelog = "https://eddmpython.github.io/dartlab/docs/changelog"
Desktop = "https://github.com/eddmpython/dartlab-desktop/releases/latest/download/DartLab.exe"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/dartlab"]
# include 는 .gitignore 규칙을 override — CI 에서 python -m build 가 .gitignore 의
# 'data/' 루트-미지정 패턴에 걸려 src/dartlab/core/data/ 를 wheel 에서 빠뜨리는
# packaging 사고 방어. artifacts 만으로는 불충분함이 실증됨 (2026-04-19).
include = [
"src/dartlab/**/*.py",
"src/dartlab/**/*.json",
"src/dartlab/**/*.parquet",
"src/dartlab/**/py.typed",
]
artifacts = [
"src/dartlab/ui/build/**",
"src/dartlab/**/*.json",
"src/dartlab/**/*.parquet",
"src/dartlab/py.typed",
]
exclude = [
"**/_reference/**",
"**/_backup/**",
"src/dartlab/engines/edinet/**",
"src/dartlab/engines/esg/**",
"src/dartlab/engines/event/**",
"src/dartlab/engines/supply/**",
"src/dartlab/engines/watch/**",
]
[tool.hatch.build.targets.sdist]
# wheel include 와 동일 패턴으로 맞춰 산출물 drift 방지
include = [
"src/dartlab/**/*.py",
"src/dartlab/**/*.json",
"src/dartlab/**/*.parquet",
"src/dartlab/**/py.typed",
"src/dartlab/ui/build/**",
"README.md",
"LICENSE",
]
exclude = [
"**/_reference/**",
"**/_backup/**",
"src/dartlab/engines/edinet/**",
"src/dartlab/engines/esg/**",
"src/dartlab/engines/event/**",
"src/dartlab/engines/supply/**",
"src/dartlab/engines/watch/**",
]
[tool.ruff]
target-version = "py312"
line-length = 120
exclude = ["experiments", "*/_reference"]
[tool.ruff.lint]
select = ["E", "F", "I"]
ignore = ["E402", "E501", "E741", "F841"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "bench_*.py"]
addopts = "-v --tb=short"
asyncio_mode = "auto"
markers = [
"requires_data: 로컬 parquet 데이터 필요 (CI에서 skip)",
"unit: 순수 로직/mock만 — 데이터 로드 없음, 병렬 안전",
"integration: Company 1개 로딩 필요 — 중간 무게",
"heavy: 대량 데이터 로드 — 단독 실행 필수",
"realData: 엔진별 실제 데이터 스모크 — HF parquet + 실제 파이프라인 실행 (schema drift/silent None 방어)",
"freshInstall: 빈 캐시 → 자동 다운로드 경로 검증 (외부 사용자 첫 호출 시나리오)",
"network: 외부 HTTP API 호출 (HF/DART/EDGAR/FRED) — transient 실패 재시도 대상",
"slow: 실행 30초 이상 — PR fast path 에서 제외",
# flaky 는 pytest-rerunfailures 가 설치된 환경에서 작동. 미설치 환경에선 무시.
# 미등록 시 PytestUnknownMarkWarning — 본 항목으로 warning 차단.
"flaky: transient 실패 자동 재시도 (pytest-rerunfailures)",
]
[tool.coverage.run]
source = ["dartlab"]
# omit — coverage 90% 의 "90%" 는 "business logic 기준" 이 되도록 thin boundary /
# rendering / external-adapter / experimental 코드를 제외. 이 코드들은 realData
# smoke + wheel-smoke + integration 테스트로 간접 검증되거나 테스트 ROI 가 낮음.
omit = [
# 기존 omit
"src/dartlab/engines/ai/providers/*",
"src/dartlab/review/*",
# CLI — 얕은 argparse 래퍼. cli_e2e.py 가 핵심 경로 커버.
"src/dartlab/cli/commands/*",
"src/dartlab/cli/main.py",
"src/dartlab/cli/parser.py",
"src/dartlab/cli/rendering.py",
"src/dartlab/cli/stdio.py",
"src/dartlab/cli/services/*",
# 서버 API — HTTP 핸들러, realData end-to-end 로 간접 검증.
"src/dartlab/server/api/*",
"src/dartlab/server/web.py",
# 외부 API 클라이언트 — 네트워크 의존, 모킹 ROI 낮음.
"src/dartlab/providers/dart/openapi/*",
"src/dartlab/providers/edgar/openapi/*",
"src/dartlab/providers/edinet/openapi/*",
# DART docs viewer/rendering — HTML/마크다운 생성, 시각 검증 영역.
"src/dartlab/providers/dart/docs/viewer.py",
"src/dartlab/providers/dart/docs/viewerExport.py",
# 메신저 어댑터 — Slack/Telegram/Discord SDK 모킹 ROI 낮음.
"src/dartlab/channel/adapters/*",
"src/dartlab/channel/devtunnel.py",
# 시각화 — Plotly/차트 렌더링, snapshot 테스트 영역.
"src/dartlab/viz/charts/*",
"src/dartlab/viz/generators.py",
"src/dartlab/viz/plotly.py",
# 개발자 전용 — 사용자 미접근.
"src/dartlab/audit/*",
"src/dartlab/mcp/*",
# 얕은 display/table 래퍼 — great_tables/IPython 옵셔널.
"src/dartlab/display/*",
"src/dartlab/table/*",
"src/dartlab/tools/network.py",
# 실험/레거시 — 사용 여부 재평가 필요, 현재 0% 모듈.
"src/dartlab/analysis/financial/research/*",
"**/_reference/*",
"**/_backup/*",
]
[tool.coverage.report]
show_missing = true
skip_empty = true
exclude_lines = [
"pragma: no cover",
"if __name__",
"raise NotImplementedError",
]
# Coverage ratchet — omit 확대 후 추정 41.5% 기준 40 에서 시작.
# 경로 B (strategic omit + business logic 집중 테스트) 진행 중.
# 단계 계획: 40 → 50 → 60 → 70 → 80 → 90 (omitted-adjusted). PR 마다 하락 시 CI FAIL.
# CI 에서 `pytest --cov-fail-under` 플래그로 실제 강제.
fail_under = 40
[tool.pyright]
pythonVersion = "3.12"
typeCheckingMode = "basic"
include = ["src/dartlab"]
exclude = [
"src/dartlab/engines/ai/providers/**",
"ui/**",
"experiments/**",
]
reportMissingTypeStubs = false
reportUnknownParameterType = false
reportUnknownMemberType = false
reportUnknownVariableType = false
[tool.bandit]
exclude_dirs = ["experiments", "tests"]
skips = ["B101"]
[tool.deptry]
# 옵셔널 통합 의존성 — 사용자가 별도 설치할 때만 동작 (런타임 ImportError 가드 있음)
extend_exclude = [
"src/dartlab/.*/_reference/.*", # 학습/실험 코드, 런타임 미사용
]
[tool.deptry.per_rule_ignores]
DEP001 = [
# ── channel 어댑터 (외부 메신저 옵셔널) ──
"discord", "slack_bolt", "telegram",
# ── CLI 인터랙티브 옵셔널 ──
"prompt_toolkit",
# ── display 옵셔널 ──
"great_tables", "itables", "IPython",
# ── gather 옵셔널 ──
"FinanceDataReader", "tavily",
# ── _reference 학습/실험 ──
"agents", "owlready2", "rapidfuzz", "edgar",
# ── transitive deps (다른 패키지가 끌어옴) ──
"dotenv", # python-dotenv
"google", # google-genai
"yaml", # pyyaml
"bs4", # beautifulsoup4
"starlette", # fastapi가 끌어옴
"pydantic", # fastapi가 끌어옴
]
DEP002 = [
"beautifulsoup4", # bs4 직접 import
"google-genai", # google.genai 사용 (gemini provider)
"marimo", # 노트북 컴파일/배포 도구
]
[dependency-groups]
dev = [
"build>=1.4.0",
"dartlab[all]",
"hatchling>=1.29.0",
"hypothesis>=6.100.0",
"networkx[default]>=3.0", # scripts/build/buildIndustryMap.py — Kamada-Kawai+PageRank (default extra: scipy 포함)
"pillow>=12.1.1",
"pre-commit>=4.0.0",
"pyright>=1.1.0",
"pytest>=9.0.2",
"pytest-asyncio>=0.24.0",
"pytest-benchmark>=5.0.0",
"pytest-cov>=6.0.0",
"radon>=6.0.0",
"vulture>=2.0",
]