-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
104 lines (96 loc) · 2.96 KB
/
pyproject.toml
File metadata and controls
104 lines (96 loc) · 2.96 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
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[project]
dynamic = ["version"] # determined from source control
name = "confidence"
description = "Simple module to load and use configuration in a clean, 'pythonic' way."
keywords = ["configuration"]
readme = "README.md"
authors = [
{name = "Netherlands Forensic Institute", email = "netherlandsforensicinstitute@users.noreply.github.com"},
]
dependencies = [
"tomlkit>=0.13.3",
"pyyaml>=6.0",
]
requires-python = ">=3.10"
license = "Apache-2.0"
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
]
[project.urls]
homepage = "https://github.com/NetherlandsForensicInstitute/confidence/"
[dependency-groups]
check = [
"mypy",
"ruff",
# dependency-specific typing information
"types-pyyaml",
]
test = [
"coverage",
"pytest",
"pytest-benchmark",
"tabulate",
]
[tool.pdm]
version = {source = "scm"}
[tool.pdm.scripts]
all = {composite = ["check", "test"]}
benchmark = "pdm run test --benchmark-only --benchmark-autosave tests/"
benchmark-against = {keep_going = true, composite = [
"git rev-parse {args}",
"pdm run benchmark",
"git switch --detach {args}",
"pdm run benchmark",
"git switch -",
"pdm run python .github/compare-benchmarks.py --old {args}"
]}
check = {composite = [
"pdm lock --check",
"ruff format --diff confidence/ tests/",
"ruff check confidence/ tests/",
"mypy confidence/",
]}
fix = {composite = [
"ruff format confidence/ tests/",
"ruff check --fix confidence/ tests/",
]}
test = "coverage run --branch --source confidence --module pytest --strict-markers --benchmark-skip tests/"
update-lock = "pdm lock --group :all"
[tool.ruff]
format.quote-style = "single"
line-length = 120
lint.flake8-builtins.ignorelist = ["format"]
lint.flake8-quotes.inline-quotes = "single"
lint.ignore = [
# enforced by the formatter, not ignoring this causes warnings
"COM812",
# 'r' is the default mode for builtin open(), but explicit is better than implicit
"UP015",
]
lint.isort.lines-after-imports = 2
# ruff disagrees with the way __all__ is manipulated in the root module, ignore F401 (unused import) for that file
lint.per-file-ignores = {"confidence/__init__.py" = ["F401"]}
lint.select = ["A", "B", "COM", "C4", "DTZ", "E", "F", "I", "N", "PTH", "Q", "SIM", "UP"]
[tool.mypy]
# allow redefinition of inferred / assigned types
allow_redefinition = true
# require all defined functions to be fully typed
allow_incomplete_defs = false
allow_untyped_defs = false
# be strict about optional types
strict_optional = true
# warn about lines in this file that make no sense to mypy
warn_unused_configs = true
[tool.coverage.report]
exclude_also = [
"raise NotImplementedError",
]