-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
274 lines (247 loc) · 5.63 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
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
#
# Project Configuration
#
[build-system]
build-backend = "hatchling.build"
requires = [ "hatchling" ]
[project]
name = "tika-client"
description = "A modern REST client for Apache Tika server"
readme = "README.md"
keywords = [ "api", "client", "html", "office", "pdf", "tika" ]
license = "MPL-2.0"
authors = [
{ name = "Trenton H", email = "[email protected]" },
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dynamic = [ "version" ]
dependencies = [
"httpx~=0.24; python_version<'3.9'",
"httpx~=0.27; python_version>='3.9'",
"typing-extensions; python_version<'3.11'",
]
urls.Changelog = "https://github.com/stumpylog/tika-rest-client/blob/main/CHANGELOG.md"
#
# Hatch Configuration
#
urls.Documentation = "https://github.com/stumpylog/tika-rest-client#readme"
urls.Issues = "https://github.com/stumpylog/tika-rest-client/issues"
urls.Source = "https://github.com/stumpylog/tika-rest-client"
[tool.hatch.version]
path = "src/tika_client/__about__.py"
[tool.hatch.build.targets.sdist]
exclude = [
".github",
".docker",
]
[tool.hatch.envs.default]
installer = "uv"
[tool.hatch.envs.hatch-static-analysis]
# https://hatch.pypa.io/latest/config/internal/static-analysis/
dependencies = [ "ruff ~= 0.6" ]
config-path = "none"
[tool.hatch.envs.hatch-test]
# https://hatch.pypa.io/latest/config/internal/testing/
parallel = true
randomize = true
dependencies = [
"coverage-enable-subprocess == 1.0",
"coverage[toml] ~= 7.6",
"pytest < 8.0; python_version < '3.9'",
"pytest ~= 8.3; python_version >= '3.9'",
"pytest-mock ~= 3.14",
"pytest-randomly ~= 3.15",
"pytest-rerunfailures ~= 14.0",
"pytest-xdist[psutil] ~= 3.6",
]
extra-dependencies = [
"pytest-sugar",
"pytest-httpx == 0.30.0; python_version >= '3.9'",
"pytest-httpx ~= 0.22; python_version < '3.9'",
"python-magic",
"pytest-docker ~= 3.1",
]
extra-args = [ "--maxprocesses=8", "--pythonwarnings=all" ]
[tool.hatch.envs.hatch-test.scripts]
run = [
"python3 --version",
"pytest{env:HATCH_TEST_ARGS:} {args}",
]
run-cov = [
"python3 --version",
"coverage erase",
"coverage run -m pytest{env:HATCH_TEST_ARGS:} {args}",
]
cov-combine = [ "coverage combine" ]
cov-report = [
"coverage report",
"coverage json",
"coverage html",
]
[[tool.hatch.envs.hatch-test.matrix]]
python = [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.8", "pypy3.9", "pypy3.10" ]
#
# Custom Environments
#
[tool.hatch.envs.typing]
detached = true
dependencies = [
"mypy ~= 1.11",
"httpx",
]
[tool.hatch.envs.typing.scripts]
run = [
"mypy --version",
"mypy --install-types --non-interactive {args:src/tika_client}",
]
[tool.hatch.envs.pre-commit]
template = "pre-commit"
detached = true
dependencies = [
"pre-commit ~= 4.0",
"pre-commit-uv",
]
[tool.hatch.envs.pre-commit.scripts]
check = [ "pre-commit run --all-files" ]
update = [ "pre-commit autoupdate" ]
#
# Tool Configuration
#
[tool.ruff]
target-version = "py38"
line-length = 120
# https://docs.astral.sh/ruff/settings/
fix = true
output-format = "grouped"
# https://docs.astral.sh/ruff/rules/
lint.extend-select = [
"A",
"ARG",
"B",
"C",
"C4",
"COM",
"DTZ",
"E",
"EM",
"ERA",
"EXE",
"F",
"FA",
"FBT",
"FLY",
"I",
"ICN",
"INP",
"INT",
"ISC",
"N",
"PERF",
"PGH",
"PIE",
"PL",
"PLC",
"PLE",
"PLR",
"PLW",
"PT",
"PTH",
"Q",
"RSE",
"RUF",
"S",
"SIM",
"SLF",
"T",
"T10",
"T20",
"TCH",
"TD",
"TID",
"TRY",
"UP",
"W",
"YTT",
]
lint.ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Ignore complexity
"C901",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
# Ignore checks for possible passwords
"S105",
"S106",
"S107",
# Ignore no author and missing issue link in TODO tags
"TD002",
"TD003",
]
# Tests can use magic values, assertions, and relative imports
lint.per-file-ignores."tests/**/*" = [
"DTZ001",
"PLR2004",
# Allow more complex pytest.raises
"PT012",
"S101",
"TID252",
]
# No relative imports
lint.flake8-tidy-imports.ban-relative-imports = "all"
# One import per line
lint.isort.force-single-line = true
# Recognize us please
lint.isort.known-first-party = [ "tika_client" ]
[tool.pyproject-fmt]
max_supported_python = "3.13"
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = [ "tests" ]
[tool.coverage.run]
source_pkgs = [ "tika_client", "tests" ]
branch = true
parallel = true
omit = [
"src/tika_client/__about__.py",
]
[tool.coverage.paths]
tika_client = [ "src/tika_client", "*/tika-client/src/tika_client" ]
tests = [ "tests", "*/tika-client/tests" ]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == '__main__':",
"if TYPE_CHECKING:",
]
[tool.mypy]
#disallow_any_expr = true
#disallow_untyped_defs = true
#disallow_incomplete_defs = true
check_untyped_defs = true
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
warn_unused_configs = true