-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
195 lines (167 loc) · 5.27 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
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
# SPDX-License-Identifier: Apache-2.0
[build-system]
requires = ["setuptools>=67.0.0", "wheel", "setuptools-git-versioning>=2.0,<3"]
build-backend = "setuptools.build_meta"
[project]
name = "leaf-focus"
description = "Extract structured text from pdf files."
readme = "README.md"
requires-python = ">=3.10"
keywords = ["pdf", "extract", "structured", "text"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Environment :: Console",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Information Analysis",
"Intended Audience :: End Users/Desktop",
"Topic :: Utilities",
]
dynamic = [
"version",
"dependencies",
"optional-dependencies",
]
[project.urls]
"Homepage" = "https://github.com/anotherbyte-net/leaf-focus"
"Changelog" = "https://github.com/anotherbyte-net/leaf-focus/blob/main/CHANGELOG.md"
"Source" = "https://github.com/anotherbyte-net/leaf-focus"
"Tracker" = "https://github.com/anotherbyte-net/leaf-focus/issues"
[project.scripts]
leaf-focus = 'leaf_focus.cli:main'
[tool.setuptools.packages.find]
where = ["src"]
# include and exclude accept strings representing glob patterns.
include = ["leaf_focus*"]
[tool.setuptools.dynamic]
dependencies = { file = ["requirements.in"] }
[tool.setuptools-git-versioning]
enabled = true
version_file = "VERSION"
count_commits_from_version_file = true
dev_template = "{tag}.dev{ccount}"
dirty_template = "{tag}.dev{ccount}"
[tool.pytest.ini_options]
minversion = "7.0"
addopts = ["-ra", "--strict-markers", "--strict-config"]
pythonpath = ["src"]
testpaths = "tests"
xfail_strict = true
[tool.coverage.run]
parallel = true
branch = true
source = ['leaf_focus']
[tool.coverage.paths]
source = ["src", ".tox/py*/**/site-packages"]
[tool.coverage.report]
show_missing = true
skip_covered = true
[tool.coverage.html]
skip_covered = true
skip_empty = true
[tool.ruff.lint.isort]
lines-between-types = 1
lines-after-imports = 2
[tool.tox]
requires = ["tox>=4.19"]
env_list = [
"py310-tests",
"coverage-report",
"py310-lint-style",
"lint-docs",
"docs",
"pip-compile",
]
[tool.tox.env_run_base]
package = "wheel"
wheel_build_env = ".pkg"
[tool.tox.env_run_base.setenv]
#TEST_INCLUDE_SLOW = 'true'
#TEST_XPDF_EXE_DIR = '.xpdf/install/xpdf-tools-win-4.05/bin64'
[tool.tox.env.py310-tests]
deps = ["pytest", "pytest-mock", "pytest-cov", "hypothesis"]
commands = [
# ["pip", "list"],
["python", "-X", "dev", "-m", "coverage", "run", "-m", "pytest", "{posargs}"],
]
[tool.tox.env.coverage-report]
deps = ["coverage[toml]"]
parallel_show_output = true
commands = [
["coverage", "combine"],
["coverage", "report", "--fail-under=70"]
]
[tool.tox.env.py310-lint-style]
deps = ["ruff", "mypy", "types-dateparser", "types-PyYAML", "types-requests", "types-backports", "types-urllib3"]
commands = [
["ruff", "check", "--fix", "--exit-non-zero-on-fix", "src", "tests"],
["ruff", "format", "--check", "--diff", "src", "tests"],
["mypy", "src"],
]
[tool.tox.env.lint-docs]
deps = ["interrogate", "codespell"]
commands = [
["interrogate", "-vv", "--fail-under", "90", "src"],
["codespell", "--quiet-level", "0", "--summary", "--check-filenames", "--write-changes", "--skip", "*.pyc,*.png,*.pdf,*.txt,*.csv,*.json", "src", "tests"]
]
[tool.tox.env.docs]
deps = ["pdoc"]
commands = [
["pdoc",
"--docformat", "google",
"--edit-url", "leaf_focus=https://github.com/anotherbyte-net/leaf-focus/blob/main/src/leaf_focus/",
"--search", "--show-source",
"--output-directory", "docs",
"./src/leaf_focus"
]
]
[tool.tox.env.pip-compile]
deps = ["pip-tools"]
commands = [
["pip-compile", "--generate-hashes", "-o", "requirements.txt", "pyproject.toml"],
]
[tool.mypy]
strict = true
pretty = true
ignore_missing_imports = true
check_untyped_defs = true
no_implicit_optional = true
show_error_codes = true
[tool.ruff]
line-length = 88
show-fixes = true
src = ["src", "tests"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"TRY300", # don't want to move returns to else block
"RET504", # assignments before return can be useful
"ERA001", # ignore commented code
"TD", # don't worry about todos format
"FIX002", # todos are ok
"TCH003", # imports for types are needed when using beartype(?)
"TCH002", # imports for types are needed when using beartype(?)
"COM812",
"ISC001",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"S", # lots of things not usually allowed can be used in test code
"ANN", # don't worry about typing in tests
"D", # ignore docstrings in tests
"ARG001", # ignore unused args in tests
"PLR2004", # ignore magic values in tests
"E501", # ignore line too long in tests
"N802", # ignore function name case in tests
"TRY003", # ignore exception style in tests
"EM102", # ignore exception style in tests
"PLR0913", # don't worry about the number of arguments in a function in tests
]