Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
258 lines (237 loc) · 8.65 KB
/
Copy pathpyproject.toml
File metadata and controls
258 lines (237 loc) · 8.65 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
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
[build-system]
requires = ['uv_build>=0.11.0,<1']
build-backend = 'uv_build'
[project]
name = 'mt-940'
version = "5.1.3"
description = 'A library to parse MT940 files and returns smart Python collections for statistics and manipulation.'
readme = 'README.md'
license = 'BSD-3-Clause'
license-files = ['LICENSE']
requires-python = '>=3.10'
authors = [{ name = 'Rick van Hattem', email = 'wolph@wol.ph' }]
keywords = ['MT940']
classifiers = [
'Development Status :: 6 - Mature',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Natural Language :: English',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'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',
'Programming Language :: Python :: 3.15',
'Topic :: Software Development :: Libraries :: Python Modules',
'Typing :: Typed',
]
dependencies = []
[project.urls]
Homepage = 'https://github.com/WoLpH/mt940'
Documentation = 'https://mt940.readthedocs.io/'
Repository = 'https://github.com/WoLpH/mt940'
Issues = 'https://github.com/WoLpH/mt940/issues'
Changelog = 'https://github.com/WoLpH/mt940/releases'
Funding = 'https://github.com/sponsors/wolph'
[project.optional-dependencies]
docs = ['sphinx>=8.0', 'furo>=2024.8', 'types-docutils']
tests = [
'pytest>=8.0',
'pytest-cov>=5.0',
'pytest-randomly>=3.15',
'coverage>=7.0',
'pyyaml',
'types-pyyaml',
]
tox = ['tox>=4.0', 'tox-uv>=1.0', 'tox-gh-actions>=3.0']
[dependency-groups]
dev = [
'mt-940[docs,tests,tox]',
'ruff>=0.16',
'mypy>=1.18',
'basedpyright>=1.31',
'pyright>=1.1.400',
'pyrefly>=1.1',
'ty>=0.0.70',
'codespell>=2.4',
'taplo>=0.9',
'zizmor>=1.0',
'pip-audit>=2.7',
'sp-repo-review[cli]>=2025.1',
'validate-pyproject>=0.24',
'lefthook>=2.0',
]
[tool.uv]
exclude-newer = '14 days'
# certifi and filelock get a shorter soak of one week: their October 2026
# advisories (PYSEC-2026-4320 for certifi, CVE-2026-112906 and five siblings for
# filelock) were fixed inside the fourteen-day quarantine, and the audit job
# resolves fresh on every run, so the release workflow stayed red on tools that
# never reach the wheel. Drop the entries once the fixes are two weeks old.
exclude-newer-package = { certifi = '7 days', filelock = '7 days' }
[tool.uv.build-backend]
# The distribution name (mt-940) normalizes to `mt_940`, but the import
# package is `mt940`, so the module name has to be set explicitly.
module-root = ''
module-name = 'mt940'
# The source archive contains the materials needed to run and document the
# project. Wheels still contain only the runtime package and its metadata.
source-include = [
'CONTRIBUTING.rst',
'docs/**',
'examples/**',
'mt940_tests/**',
'tox.ini',
'ruff.toml',
'pyrightconfig.strict.json',
'taplo.toml',
'lefthook.yml',
]
source-exclude = [
'docs/html/**',
'docs/_build/**',
'docs/doctrees/**',
'docs/superpowers/**',
'docs/modules.rst',
'docs/mt940*.rst',
]
# ── Tests ────────────────────────────────────────────────────
[tool.pytest.ini_options]
minversion = '8.0'
required_plugins = ['pytest-cov', 'pytest-randomly']
testpaths = ['mt940', 'mt940_tests']
python_files = ['mt940/*.py', 'mt940_tests/*.py']
log_level = 'INFO'
xfail_strict = true
empty_parameter_set_mark = 'fail_at_collect'
addopts = [
'--strict-config',
'--strict-markers',
'-ra',
'--cov=mt940',
'--cov=mt940_tests',
'--cov-report=term-missing',
'--cov-report=html',
'--no-cov-on-fail',
'--doctest-modules',
]
doctest_optionflags = 'NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS'
filterwarnings = ['error']
norecursedirs = ['_build', 'docs', 'build', 'dist', '.tox', '.eggs']
[tool.coverage.run]
branch = true
source = ['mt940', 'mt940_tests']
[tool.coverage.paths]
# Map the package as installed into each tox env back to the source tree so
# per-env `.coverage.*` files combine into a single report.
source = [
'mt940',
'*/site-packages/mt940',
'*/.tox/*/lib/*/site-packages/mt940',
]
tests = ['mt940_tests', '*/mt940_tests']
[tool.coverage.report]
fail_under = 100
show_missing = true
# Only code that cannot run is excluded: type-checking-only blocks, overload
# stubs and Protocol method bodies. Everything else needs a test.
exclude_also = [
'if (typing\.|)TYPE_CHECKING',
'@(typing\.|)overload',
'class .*\bProtocol\):',
'^\s*\.\.\.$',
]
# ── Type checking ────────────────────────────────────────────
[tool.mypy]
python_version = '3.10'
# docs/conf.py imports sphinx, which uses `type` statements that mypy cannot
# parse at a 3.10 target. tox and the hooks check it separately with
# `mypy --python-version 3.12 docs/conf.py`, the version the docs build on.
files = ['mt940', 'mt940_tests', 'examples', 'docs/_tools']
exclude = ['^dist/', '^build/', '^docs/_build/', '^\.tox/', '^\.?venv/']
strict = true
strict_bytes = true
extra_checks = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
disallow_any_unimported = true
disallow_any_decorated = true
# disallow_any_explicit stays off: parsed tag dictionaries are `dict[str, Any]`
# on purpose (see mt940._types.TagDict), the keys are bank-specific.
enable_error_code = [
'exhaustive-match',
'ignore-without-code',
'possibly-undefined',
'redundant-expr',
'truthy-bool',
'truthy-iterable',
'unused-awaitable',
]
# Plain pyright (the release gate) reads pyrightconfig.strict.json instead.
# basedpyright refuses a pyproject with both a pyright and a basedpyright
# section, and a discoverable pyrightconfig.json would override this one.
[tool.basedpyright]
typeCheckingMode = 'all'
pythonVersion = '3.10'
include = ['mt940', 'mt940_tests', 'examples', 'docs/_tools', 'docs/conf.py']
exclude = ['**/__pycache__', '.tox', '.venv', 'build', 'dist', 'docs/_build']
# Parsed tag dictionaries are `dict[str, Any]` by design (mt940._types.TagDict).
reportAny = false
reportExplicitAny = false
# `@override` needs typing_extensions at runtime on Python < 3.12 and the
# package has zero runtime dependencies.
reportImplicitOverride = false
# mt940/parser.py imports the package root (`import mt940`) by design.
reportImportCycles = false
# Every processor shares one positional signature, so most of them leave at
# least one argument untouched. Ruff's ARG rules cover the rest of the code.
# A file-level `# pyright:` comment cannot carry this rule, plain pyright
# rejects the basedpyright-only name as unknown.
reportUnusedParameter = false
[tool.pyrefly]
# Explicit includes also work inside a repository-locally ignored worktree.
use-ignore-files = false
# Use the exclusions below, without adding environment-derived paths.
disable-project-excludes-heuristics = true
project-includes = [
'mt940',
'mt940_tests',
'examples',
'docs/_tools',
'docs/conf.py',
]
project-excludes = ['**/__pycache__', '.tox', '.venv', 'build', 'dist']
python-version = '3.10'
untyped-def-behavior = 'check-and-infer-return-any'
[tool.ty.environment]
python-version = '3.10'
[tool.ty.src]
include = ['mt940', 'mt940_tests', 'examples', 'docs/_tools', 'docs/conf.py']
[tool.ty.terminal]
error-on-warning = true
# ── Repository checks ────────────────────────────────────────
[tool.codespell]
# Hidden files are checked so .github/ is covered, which means every local
# hidden directory (git objects, tool caches, editor state) must be skipped
# explicitly. The fixture formats carry bank data, not prose.
skip = '''
./.git,./.venv,./.tox,./.mypy_cache,./.ruff_cache,./.pytest_cache,
./.idea,./.worktrees,./.superpowers,./.remember,./.zshhistory,./.coverage,
./build,./dist,*/htmlcov,./docs/_build,./docs/html,./docs/superpowers,
*.asc,*.yml,*.sta,*.txt,*.html,*.lock'''
check-hidden = true
[tool.repo-review]
ignore = [
'SEC001', # zizmor runs as a tox env (pedantic persona) in CI, not via pre-commit
'PY005', # tests live in mt940_tests/ (established convention)
'PY006', # pre-commit replaced by lefthook
'PC110', # no pre-commit (we use lefthook)
'PC111', # executable examples and the README snippet are checked by pytest
'PC140', # manual typecheck hooks
'PC170', # strict Sphinx and local link checks cover the documentation
'RTD', # no RTD repo-review checks
]