-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
110 lines (101 loc) · 4.3 KB
/
Copy pathpyproject.toml
File metadata and controls
110 lines (101 loc) · 4.3 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
[project]
name = "pdfrest"
version = "0.1.0"
description = "Python client library for interacting with the PDFRest API"
readme = "README.md"
authors = [
{name = "Datalogics"},
]
requires-python = ">=3.10"
dependencies = [
"exceptiongroup>=1.3.0",
"httpx>=0.28.1",
"langcodes>=3.4.0",
"pydantic>=2.12.0",
]
[build-system]
requires = ["uv_build>=0.8.22,<0.10.0"]
build-backend = "uv_build"
[dependency-groups]
dev = [
"pre-commit>=3.7.0",
"ruff>=0.6.9",
"pytest>=8.3.3",
"pytest-cov>=5.0.0",
"pip-audit>=2.7.3",
"pytest-md>=0.2.0",
"pytest-emoji>=0.2.0",
"pytest-dotenv>=0.5.2",
"pytest-asyncio>=1.2.0",
"pytest-rerunfailures>=16.0.1",
"pytest-xdist>=3.8.0",
"nox>=2025.5.1",
"basedpyright>=1.34.0",
"python-dotenv>=1.0.1",
]
[tool.pytest.ini_options]
minversion = "7.4"
testpaths = ["tests"]
addopts = "-ra"
[tool.ruff]
extend-include = ["*.ipynb"]
target-version = "py310"
[tool.ruff.lint]
# Enable the pycodestyle (`E`) and Pyflakes (`F`) rules by default.
# Rules cribbed from the PDM sources themselves.
extend-select = [
# If you're doing a project of any substantial size, or anything that runs on a server,
# use logging instead of printing. To check this, uncomment the next line.
# "T20", # print https://docs.astral.sh/ruff/rules/#flake8-print-t20 don't print, use logging
"I", # isort https://beta.ruff.rs/docs/rules/#isort-i
"B", # flake8-bugbear https://beta.ruff.rs/docs/rules/#flake8-bugbear-b
"C4", # flake8-comprehensions https://beta.ruff.rs/docs/rules/#flake8-comprehensions-c4
"PGH", # pygrep-hooks https://beta.ruff.rs/docs/rules/#pygrep-hooks-pgh
"RUF", # ruff https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf
"W", # pycodestyle https://beta.ruff.rs/docs/rules/#warning-w
"YTT", # flake8-2020 https://beta.ruff.rs/docs/rules/#flake8-2020-ytt
"UP", # pyupgrade https://beta.ruff.rs/docs/rules/#pyupgrade-up
"N", # naming https://beta.ruff.rs/docs/rules/#pep8-naming-n
"PT", # pytest https://beta.ruff.rs/docs/rules/#flake8-pytest-style-pt
# https://dev.to/aws-builders/deploy-to-aws-with-github-actions-and-aws-cdk-4m1e suggests
# complexity checks with radon/xenon, but McCabe complexity is available in ruff and
# the cost/benefit of using radon/xenon can be discussed later.
"C90", # mccabe https://beta.ruff.rs/docs/rules/#mccabe-c90
"FURB", # refurb https://beta.ruff.rs/docs/rules/#refurb-furb
"S", # bandit https://docs.astral.sh/ruff/rules/#flake8-bandit-s ...secure code
"BLE", # blind-except https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"EM", # errmsg https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"G", # logging-format https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"RET", # return https://docs.astral.sh/ruff/rules/#flake8-return-ret
"DTZ", # datetimez https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"SIM", # simplify https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"ARG", # unused arguments https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"PTH", # use pathlib https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"RSE", # raise https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"TRY", # tryceratops https://docs.astral.sh/ruff/rules/#tryceratops-try exception antipatterns
"COM818", # prohibit trailing bare commas making tuples, see https://docs.astral.sh/ruff/rules/trailing-comma-on-bare-tuple/
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
ignore = []
unfixable = []
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["pdfrest"]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
# From https://github.com/astral-sh/ruff/issues/4368#issue-1705468153
# at least this three should be fine in tests:
"S101", # asserts allowed in tests...
"ARG", # Unused function args -> fixtures nevertheless are functionally relevant...
"FBT", # Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
]
[tool.tomlsort]
sort_first = ["project", "build-system"]
spaces_before_inline_comment = 2
spaces_indent_inline_array = 4
trailing_comma_inline_array = true
[tool.uv]
keyring-provider = "subprocess"
no-build = true
no-binary-package = ["pdfrest"]