-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathpyproject.toml
More file actions
153 lines (134 loc) · 4.11 KB
/
pyproject.toml
File metadata and controls
153 lines (134 loc) · 4.11 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
[project]
name = "exstruct"
version = "0.8.0"
description = "Excel to structured JSON (tables, shapes, charts) for LLM/RAG pipelines"
readme = "README.md"
license = { file = "LICENSE" }
keywords = ["excel", "structure", "data", "exstruct"]
authors = [
{ name = "harumiWeb"}
]
requires-python = ">=3.11"
dependencies = [
"defusedxml>=0.7.1",
"numpy>=2.3.5",
"openpyxl>=3.1.5",
"pandas>=2.3.3",
"pydantic>=2.12.5",
"scipy>=1.16.3",
"xlwings>=0.33.16",
]
[build-system]
requires = ["uv_build>=0.8.4,<0.9.0"]
build-backend = "uv_build"
[dependency-groups]
dev = [
"codecov-cli>=11.2.6",
"mkdocs-material>=9.7.0",
"mkdocstrings-python>=2.0.1",
"mypy>=1.19.0",
"pre-commit>=4.5.0",
"pytest>=9.0.1",
"pytest-cov>=7.0.0",
"pytest-mock>=3.15.1",
"ruff>=0.14.8",
"taskipy>=1.14.1",
]
[project.optional-dependencies]
all = [
"pyyaml>=6.0.3",
"python-toon>=0.1.3",
"pypdfium2>=5.1.0",
"Pillow>=12.0.0",
"mcp>=1.25.0,<2.0.0",
"httpx>=0.27,<1.0",
]
yaml = ["pyyaml>=6.0.3"]
toon = ["python-toon>=0.1.3"]
render = ["pypdfium2>=5.1.0", "Pillow>=12.0.0"]
mcp = [
"mcp>=1.25.0,<2.0.0",
"httpx>=0.27,<1.0",
]
[project.scripts]
exstruct = "exstruct.cli.main:main"
exstruct-mcp = "exstruct.mcp.server:main"
[project.urls]
Homepage = "https://harumiweb.github.io/exstruct/"
Repository = "https://github.com/harumiWeb/exstruct"
Issues = "https://github.com/harumiWeb/exstruct/issues"
Documentation = "https://harumiweb.github.io/exstruct/"
[tool.coverage.run]
omit = [
"tests/*",
"*/test_*.py",
"*/gen_py/*",
"src/exstruct/mcp/patch/engine/base.py",
]
[tool.ruff]
target-version = "py311"
src = ["exstruct"]
fix = true
exclude = ["benchmark/**"]
# 静的解析ルール
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # import sorting
"UP", # pyupgrade
"B", # flake8-bugbear
"N", # naming
"C90", # complexity
"A", # flake8-builtins
"ANN", # type annotations
]
ignore = [
"E501", # 長い行は許容(Excel JSON は長くなりがち)
"B008", # Pydantic の default_factory を使用するため
"ANN101", # self の型注釈は省略可能
"ANN102", # cls の型注釈は省略可能
]
# import の並び順
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["exstruct"]
force-sort-within-sections = true
# 複雑度の最大値
[tool.ruff.lint.mccabe]
max-complexity = 12
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["N802", "N803", "N806"]
[tool.mypy]
packages = ["exstruct"]
python_version = "3.11"
exclude = "benchmark/.*"
# 外部ライブラリの型情報がない場合は無視
ignore_missing_imports = true
# 厳格モードを有効化
strict = true
# Pydantic v2 対応
plugins = ["pydantic.mypy"]
[tool.pytest.ini_options]
markers = [
"com: requires Excel COM (Windows + Excel)",
"render: requires Excel COM and pypdfium2; set RUN_RENDER_SMOKE=1 to enable",
"libreoffice: requires LibreOffice runtime; set RUN_LIBREOFFICE_SMOKE=1 to enable",
]
[tool.taskipy.tasks]
ruff = "ruff check ."
ruff-fix = "ruff check . --fix"
mypy = "mypy src/exstruct --strict"
precommit-run = "pre-commit run -a"
test = "pytest -vv --cov=exstruct --cov-report=term-missing --cov-report=xml --cov-fail-under=80" # uv sync --extra render --extra toon
test-unit = "pytest -vv -m \"not com and not render\" --cov=exstruct --cov-report=term-missing --cov-report=xml --cov-fail-under=80"
test-com = "pytest -vv -m \"com\" --cov=exstruct --cov-report=term-missing --cov-report=xml --cov-fail-under=80"
codecov-unit = "codecov-cli upload-process -f coverage.xml -F unit -C %CODECOV_SHA% -t %CODECOV_TOKEN%"
codecov-com = "codecov-cli upload-process -f coverage.xml -F com -C %CODECOV_SHA% -t %CODECOV_TOKEN%"
docs = "mkdocs serve"
build-docs = "mkdocs build && python scripts/gen_json_schema.py && python scripts/gen_model_docs.py"
[tool.uv.workspace]
members = [
"benchmark",
]