-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpyproject.toml
152 lines (135 loc) · 3.7 KB
/
pyproject.toml
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
[project]
name = "BabelDOC"
version = "0.1.29"
description = "Yet Another Document Translator"
license = "AGPL-3.0"
readme = "README.md"
requires-python = ">=3.10,<3.13"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
keywords = ["PDF"]
dependencies = [
"bitstring>=4.3.0",
"configargparse>=1.7",
"httpx[socks]>=0.27.0",
"huggingface-hub>=0.27.0",
"numpy>=2.0.2",
"onnx>=1.17.0",
"onnxruntime>=1.16.1",
"openai>=1.59.3",
"opencv-python>=4.10.0.84",
"orjson>=3.10.14",
"pdfminer-six>=20240706",
"peewee>=3.17.8",
"pymupdf>=1.25.1",
"rich>=13.9.4",
"toml>=0.10.2",
"tqdm>=4.67.1",
"xsdata[cli,lxml,soap]>=24.12",
"msgpack>=1.1.0",
"pydantic>=2.10.6",
"tenacity>=9.0.0",
"scikit-image>=0.25.2",
]
[project.urls]
Homepage = "https://github.com/funstory-ai/BabelDOC"
Issues = "https://github.com/funstory-ai/BabelDOC/issues"
[project.scripts]
babeldoc = "babeldoc.main:cli"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.flake8]
ignore = ["E203", "E261", "E501", "W503", "E741", "E501"]
max-line-length = 88
[tool.ruff]
src = ["babeldoc"]
target-version = "py310"
show-fixes = true
[tool.ruff.format]
# Enable reformatting of code snippets in docstrings.
docstring-code-format = true
[tool.ruff.lint]
ignore = [
"E203", # 冒号前的空格
"E261", # 注释前至少两个空格
"E501", # 行太长
"E741", # 变量名歧义
"F841", # 未使用的变量
"C901", # 太复杂的函数
"S101", # use assert
"SIM", # flake8-simplify
"ARG002", # unused argument
"S110", # `try`-`except`-`pass` detected, consider logging the exception
"B024", # abstract class without abstract methods
"S112", # `try`-`except`-`continue` detected, consider logging the exception
"COM812", # missing-trailing-comma
]
select = [
"E", # pycodestyle 错误
"F", # Pyflakes
"N", # PEP8 命名
"B", # flake8-bugbear
"I", # isort
"C", # mccabe
"UP", # pyupgrade
"S", # flake8-bandit
"A", # flake8-builtins
"COM", # flake8-commas
"ARG", # flake8-unused-arguments
"PTH", # 使用 pathlib
]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.flake8-annotations]
suppress-none-returning = true
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff.lint.pydocstyle]
convention = "google"
# 设置一些规则的特定配置
[tool.ruff.lint.mccabe]
max-complexity = 10 # 函数圈复杂度阈值
[tool.ruff.lint.per-file-ignores]
"babeldoc/pdfinterp.py" = ["N"] # 忽略命名规范
"tests/*" = ["S101"] # 在测试文件中允许 assert
"**/__init__.py" = ["F401"] # 允许未使用的导入
# 忽略 S311 警告,因为这是有意的
"babeldoc/document_il/midend/paragraph_finder.py" = ["S311"]
"docs/*" = ["A001"]
[dependency-groups]
dev = [
"bumpver>=2024.1130",
"markdown-callouts>=0.4.0",
"markdown-include>=0.8.1",
"mkdocs-git-authors-plugin>=0.9.2",
"mkdocs-git-committers-plugin-2>=2.5.0",
"mkdocs-git-revision-date-localized-plugin>=1.3.0",
"mkdocs-material[recommended]>=9.6.4",
"pre-commit>=4.1.0",
"pygments>=2.19.1",
"ruff>=0.9.2",
"pytest>=8.3.4"
]
[tool.pytest.ini_options]
pythonpath = [".", "src"]
testpaths = ["tests"]
[bumpver]
current_version = "0.1.29"
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
[bumpver.file_patterns]
"pyproject.toml" = [
'current_version = "{version}"',
'version = "{version}"'
]
"babeldoc/__init__.py" = [
'__version__ = "{version}"'
]
"babeldoc/main.py" = [
'__version__ = "{version}"'
]
"babeldoc/const.py" = [
'__version__ = "{version}"'
]