Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
225 lines (213 loc) · 6.65 KB
/
Copy pathpyproject.toml
File metadata and controls
225 lines (213 loc) · 6.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
[build-system]
build-backend = "hatchling.build"
requires = [
"hatch-fancy-pypi-readme>=25.1",
"hatch-vcs>=0.5",
"hatchling>=1.27",
]
[project]
name = "xml-fmt"
import-names = [ "xml_fmt" ]
description = "Format XML files consistently"
keywords = [
"formatter",
"xml",
]
license = "MIT"
license-files = [ "LICENSE.txt" ]
authors = [
{ name = "Bernat Gabor", email = "gaborjbernat@gmail.com" },
]
requires-python = ">=3.11"
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"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 :: Text Processing :: Markup :: XML",
]
dynamic = [
"readme",
"version",
]
urls."Bug Tracker" = "https://github.com/tox-dev/xml-fmt/issues"
urls."Source Code" = "https://github.com/tox-dev/xml-fmt"
urls.Changelog = "https://github.com/tox-dev/xml-fmt/blob/main/CHANGELOG.md"
urls.Documentation = "https://github.com/tox-dev/xml-fmt/"
scripts.xml-fmt = "xml_fmt.__main__:run"
[dependency-groups]
dev = [
{ include-group = "test" },
{ include-group = "type" },
]
test = [
"covdefaults>=2.3",
"pytest>=8.4.2",
"pytest-cov>=7.1",
"pytest-mock>=3.15.1",
]
type = [
"ty>=0.0.84",
{ include-group = "test" },
]
build = [
"cython>=3",
"hatch-fancy-pypi-readme>=25.1",
"hatch-vcs>=0.5",
"hatchling>=1.27",
"setuptools>=80",
]
fix = [
"pre-commit-uv>=4.1.5",
]
pkg-meta = [
"check-wheel-contents>=0.6.1",
"twine>=6.2",
"uv>=0.12.22",
]
release-news = [
"release-creator>=4.4",
"towncrier>=26.9",
]
release-notes = [
"release-creator>=4.4",
]
release-prepare = [
"prek>=0.5",
"release-creator>=4.4",
"towncrier>=26.9",
]
[tool.hatch]
version.source = "vcs"
metadata.hooks.fancy-pypi-readme.content-type = "text/markdown"
metadata.hooks.fancy-pypi-readme.fragments = [ { path = "README.md" } ]
metadata.hooks.fancy-pypi-readme.substitutions = [
{ pattern = '''(?x)
(?<!!)\[(?P<label>[^\]]+)\]\( # Link text, excluding images
(?P<path>CHANGELOG\.md|CONTRIBUTING\.md) # Repository files linked from the README
\)
''', replacement = '[\g<label>](https://github.com/tox-dev/xml-fmt/blob/main/\g<path>)' },
]
build.dev-mode-dirs = [
"src",
]
build.targets.sdist.include = [
"/CHANGELOG.md",
"/CONTRIBUTING.md",
"/LICENSE.txt",
"/README.md",
"/pyproject.toml",
"/src",
"/tests",
"/tox.toml",
]
build.targets.wheel.only-include = [ "src" ]
build.targets.wheel.sources = [ "src" ]
[tool.uv]
dependency-groups.release-news = { requires-python = ">=3.15" }
dependency-groups.release-notes = { requires-python = ">=3.15" }
dependency-groups.release-prepare = { requires-python = ">=3.15" }
[tool.ruff]
target-version = "py311"
line-length = 120
format.preview = true
format.docstring-code-line-length = 100
format.docstring-code-format = true
lint.select = [
"ALL",
]
lint.ignore = [
"CPY", # No copyright statements
"docstring-missing-exception", # not working with Sphinx
"hardcoded-bind-all-interfaces", # Possible binding to all interfaces
"incorrect-blank-line-before-class", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible.
"missing-trailing-comma", # Conflict with formatter
"multi-line-summary-first-line", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible.
"single-line-implicit-string-concatenation", # Conflict with formatter
]
lint.per-file-ignores."tests/**/*.py" = [
"assert", # asserts allowed in tests.
"D", # don't care about documentation in tests
"FBT", # don't care about booleans as positional arguments in tests
"implicit-namespace-package", # no implicit namespace
"import-private-name", # private import
"magic-value-comparison", # Magic value used in comparison, consider replacing with a constant variable.
"S", # `subprocess` call: check for execution of untrusted input
"too-many-arguments", # any number of arguments in tests
"too-many-positional-arguments", # any number of arguments in tests
]
lint.isort = { known-first-party = [
"xml_fmt",
], required-imports = [
"from __future__ import annotations",
] }
lint.preview = true
[tool.codespell]
builtin = "clear,usage,en-GB_to_en-US"
count = true
[tool.pyproject-fmt]
max_supported_python = "3.15"
[tool.ty]
environment.python-version = "3.15"
[tool.pytest]
ini_options.testpaths = [
"tests",
]
ini_options.filterwarnings = [
"error",
"ignore:unclosed database:ResourceWarning",
]
ini_options.verbosity_assertions = 2
[tool.coverage]
run.parallel = true
run.plugins = [
"covdefaults",
]
# coverage defaults to the sysmon core on 3.14+, which cannot record the per-test dynamic
# contexts pytest-cov sets via --cov-context (7.15.2 dropped them silently, 7.15.3 warns,
# and filterwarnings=error turns that into a failure); ctrace supports them
run.core = "ctrace"
paths.source = [
"src",
".tox/*/.venv/lib/*/site-packages",
".tox\\*\\.venv\\Lib\\site-packages",
".tox/*/lib/*/site-packages",
".tox\\*\\Lib\\site-packages",
"**/src",
"**\\src",
]
report.fail_under = 63
html.show_contexts = true
html.skip_covered = false
[tool.towncrier]
name = "xml-fmt"
directory = "changelog.d"
filename = "CHANGELOG.md"
template = "release_creator.fragments:template.jinja2"
title_format = false
type = [
{ directory = "feature", name = "Added", showcontent = true },
{ directory = "change", name = "Changes", showcontent = true },
{ directory = "bugfix", name = "Fixed", showcontent = true },
{ directory = "doc", name = "Documentation", showcontent = true },
{ directory = "breaking", name = "Breaking changes", showcontent = true },
{ directory = "security", name = "Security", showcontent = true },
{ directory = "performance", name = "Performance", showcontent = true },
{ directory = "deprecation", name = "Deprecated", showcontent = true },
{ directory = "removal", name = "Removed", showcontent = true },
{ directory = "packaging", name = "Packaging", showcontent = true },
]
[tool.nab]
mode = "universal"
base-group = "project-runtime"
uploaded-prior-to = "P7D"
decision-order = "stable"
matrix.python = ">=3.15,<3.16"
matrix.platforms = [ "linux_x86_64" ]
# release-creator 4.4.0 needs a seven-day cutoff exception through 2026-11-09.
packages.release-creator.uploaded-prior-to = 2026-11-02T21:45:00Z