-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
144 lines (127 loc) · 3.74 KB
/
pyproject.toml
File metadata and controls
144 lines (127 loc) · 3.74 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
[project]
name = "hwp-parser"
version = "0.1.0"
description = "HWP file parser using pyhwp CLI tools with optional LlamaIndex adapter"
authors = [
{ name = "devcomfort" }
]
readme = "README.md"
requires-python = ">= 3.11"
license = { text = "AGPL-3.0" }
keywords = ["hwp", "parser", "document", "korean", "pyhwp"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Text Processing :: Markup",
]
dependencies = [
"pyhwp>=0.1b15",
"python-magic>=0.4.27",
"html2text>=2025.4.15",
"html-to-markdown>=2.23.1",
"llama-index-core>=0.14.12",
"click>=8.3.1",
"gradio>=6.4.0",
"loguru>=0.7.3",
]
[project.scripts]
# CLI 변환 도구 (hwp-parser convert *.hwp)
hwp-parser = "hwp_parser.cli.app:main"
[project.optional-dependencies]
llama-index = [
"llama-index-core>=0.10.0",
]
all = [
"hwp-parser[llama-index]",
]
dev = [
"pytest>=8.0.0",
"ruff>=0.1.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.0.0",
"ruff>=0.1.0",
"coverage>=7.13.1",
"pytest-benchmark>=5.2.3",
"pytest-cov>=7.0.0",
"pytest-xdist>=3.8.0",
"zensical>=0.0.15",
]
[tool.rye.scripts]
# ===== 서버 실행 =====
# Web UI 서버 (Gradio, http://localhost:7860)
web = "hwp-parser web"
# ===== 테스트 =====
# 기본 테스트 (병렬)
test = "pytest tests/ -v -n auto --dist=loadscope"
# 커버리지 측정 (병렬, 터미널 리포트)
test-cov = "pytest tests/ -v -n auto --dist=loadscope --cov=hwp_parser --cov-report=term-missing"
# 커버리지 측정 (병렬, 터미널+HTML 리포트)
test-cov-html = "pytest tests/ -v -n auto --dist=loadscope --cov=hwp_parser --cov-report=term-missing --cov-report=html"
# 벤치마크 실행 (성능 측정)
benchmark = "pytest tests/benchmarks.py -v --benchmark-verbose"
# ===== 커버리지 =====
# 커버리지 실행 + 리포트 + HTML 생성
cov = "coverage run -m pytest tests/ -v -n auto --dist=loadscope && coverage report -m && coverage html"
# 커버리지 터미널 리포트만 생성
cov-report = "coverage report -m"
# 커버리지 HTML 리포트만 생성
cov-html = "coverage html"
# ===== 문서 =====
# 문서 로컬 서버
docs = "zensical serve"
# 문서 빌드
docs-build = "zensical build"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-ra -q"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"benchmark: marks tests as benchmark tests",
]
filterwarnings = [
# pytest-benchmark + xdist 병렬 실행 시 벤치마크 비활성화 안내 (정보성 경고)
"ignore::pytest_benchmark.logger.PytestBenchmarkWarning",
# pyhwp 내부 pkg_resources 사용 경고 (외부 라이브러리, 제어 불가)
"ignore:pkg_resources is deprecated:UserWarning",
]
[tool.coverage.run]
source = ["src/hwp_parser"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
exclude_also = [
"while True:", # 무한 루프는 false 분기가 없음
]
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["src/hwp_parser"]
[tool.ruff]
line-length = 88
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "W"]
ignore = ["E501"]
[tool.pyright]
# pyhwp 타입 스텁 경로 (hwp5 모듈)
stubPath = "src/stubs"
# 기본 타입 체크 모드
typeCheckingMode = "basic"