Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
140 lines (127 loc) · 3.32 KB
/
Copy pathpyproject.toml
File metadata and controls
140 lines (127 loc) · 3.32 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
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
[project]
name = "python-toolbox"
version = "0.1.0"
requires-python = ">=3.15"
dependencies = [
"pydantic[email]>=2.14.3",
]
[dependency-groups]
dev = [
"rust-just>=1.59.0",
]
lint = [
"mypy>=2.4.1,<3",
"pre-commit>=4.7.0",
"ruff>=0.17.4",
"types-jsonschema>=4.26.0.20261006",
]
test = [
"jsonschema>=4.26.0",
"pytest>=9.2.0,<10",
"pytest-asyncio>=1.4.1",
"pytest-cov>=7.1.0",
"pytest-mock>=3.17.0",
"pytest-randomly>=5.1.0",
]
[tool.uv]
required-version = ">=0.13.6"
default-groups = "all"
preview-features = ["audit-command"]
# TODO: Drop once PyYAML ships cp315 wheels (yaml/pyyaml#981). On Windows without
# MSVC its sdist fails instead of falling back to pure Python (setup.py misses
# setuptools' PlatformError); skipping the extension needs no compiler.
[tool.uv.extra-build-variables]
pyyaml = { PYYAML_FORCE_LIBYAML = "0" }
[tool.ruff]
cache-dir = ".cache/ruff"
[tool.ruff.lint]
select = [
"F", # Pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"D", # pydocstyle
"PGH", # pygrep-hooks
"UP", # pyupgrade
"ASYNC", # flake8-async
"S", # flake8-bandit
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DJ", # flake8-django
"DTZ", # flake8-datetimez
"G", # flake8-logging-format
"PT", # flake8-pytest-style
"T", # flake8-debugger, flake8-print
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"FURB", # refurb
"RUF", # Ruff-specific rules
]
ignore = [
# Docstrings are optional; omit them when the name says it all.
"D1", # undocumented-*
# Conflict with the formatter.
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
]
[tool.ruff.lint.pydocstyle]
convention = "google"
ignore-var-parameters = true
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # assert
"S105", # hardcoded-password-string
]
[tool.mypy]
strict = true
enable_error_code = ["deprecated"]
cache_dir = ".cache/mypy"
mypy_path = "utilities"
num_workers = 8
[tool.pytest]
strict = true
cache_dir = ".cache/pytest"
pythonpath = ["utilities"]
testpaths = ["tests", "utilities"]
addopts = [
"--doctest-modules",
"--import-mode", "importlib",
"--cov-config", "pyproject.toml",
"--cov-report", "term:skip-covered",
"--cov-report", "html",
"--cov-fail-under", "100",
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
# Quoted because pytest declares this option as a string.
max_warnings = "0"
filterwarnings = [
# Python hides ResourceWarning by default; show it so unclosed files fail the run.
"default::ResourceWarning",
]
markers = [
"only: shorthand mark used to select a small subset of test cases for debugging",
]
[tool.coverage.run]
branch = true
data_file = ".cache/coverage/data.db"
disable_warnings = ["no-data-collected"]
omit = [
"utilities/graceful.py",
]
[tool.coverage.report]
exclude_also = [
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@overload",
"case _ as unreachable:",
]
[tool.coverage.html]
directory = "var/cov-report"
[tool.markdownlint]
default = true
MD007 = { indent = 4 }
MD013 = { line_length = 88, strict = true, tables = false, code_blocks = false }