-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
298 lines (268 loc) · 6.04 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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#
# Project Configuration
#
[build-system]
build-backend = "hatchling.build"
requires = [ "hatchling" ]
[project]
name = "gotenberg-client"
description = "A Python client for interfacing with the Gotenberg API"
readme = "README.md"
keywords = [ "api", "client", "html", "pdf" ]
license = "MPL-2.0"
authors = [
{ name = "Trenton H", email = "[email protected]" },
]
requires-python = ">=3.9"
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.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[http2]>=0.27",
"typing-extensions; python_version<'3.11'",
]
optional-dependencies.magic = [ "python-magic" ]
#
# Hatch Configuration
#
urls.Changelog = "https://github.com/stumpylog/gotenberg-client/blob/main/CHANGELOG.md"
urls.Documentation = "https://stumpylog.github.io/gotenberg-client/"
urls.Issues = "https://github.com/stumpylog/gotenberg-client/issues"
urls.Source = "https://github.com/stumpylog/gotenberg-client/"
[tool.hatch.version]
path = "src/gotenberg_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.8" ]
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.3; python_version >= '3.9'",
"pytest-mock ~= 3.14",
"pytest-randomly ~= 3.15",
"pytest-rerunfailures ~= 15.0",
"pytest-xdist[psutil] ~= 3.6",
]
extra-dependencies = [
"pytest-sugar",
"pytest-httpx ~= 0.35",
"pikepdf",
"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.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10" ]
#
# Custom Environments
#
[tool.hatch.envs.typing]
detached = true
dependencies = [
"mypy ~= 1.13",
"httpx",
"pytest",
"pikepdf",
"pytest-httpx ~= 0.35",
]
[tool.hatch.envs.typing.scripts]
run = [
"mypy --version",
"mypy --install-types --non-interactive .",
]
[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.hatch.envs.docs]
template = "docs"
detached = true
dependencies = [
"mkdocs-material[imaging] ~= 9.5",
"mike ~= 2.1",
"mkdocs-minify-plugin ~= 0.8",
]
[tool.hatch.envs.docs.scripts]
new = [ "mkdocs new ." ]
build = [ "mkdocs build" ]
serve = [
"mkdocs serve",
]
mike-help = [ "mike deploy --help" ]
deploy = [
"mike deploy --push --branch gh-pages --remote origin --update-aliases {args} latest",
"mike set-default --branch gh-pages --remote origin --push latest",
]
#
# Tool Configuration
#
[tool.ruff]
target-version = "py39"
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",
"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/**/*" = [ "PLR2004", "S101", "TID252" ]
lint.per-file-ignores."tests/utils.py" = [ "S603" ]
# 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 = [ "gotenberg_client" ]
[tool.pyproject-fmt]
max_supported_python = "3.13"
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = [ "tests" ]
[tool.pytest_env]
#SAVE_TEST_OUTPUT = 1
[tool.coverage.run]
source_pkgs = [ "gotenberg_client", "tests" ]
branch = true
parallel = true
omit = [
"src/gotenberg_client/__about__.py",
"tests/conftest.py",
"tests/utils.py",
]
[tool.coverage.paths]
gotenberg_client = [ "src/gotenberg_client" ]
tests = [ "tests" ]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == '__main__':",
"if TYPE_CHECKING:",
"if SAVE_OUTPUTS:",
]
[tool.mypy]
exclude = [
"tests/*",
]
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