Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
322 lines (308 loc) · 11.3 KB
/
Copy pathpyproject.toml
File metadata and controls
322 lines (308 loc) · 11.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
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
[build-system]
build-backend = "hatchling.build"
requires = [
"hatch-fancy-pypi-readme>=25.1",
"hatch-vcs>=0.5",
"hatchling>=1.32.4",
"installer>=1.1",
"packageurl-python>=0.11.1",
"zipremove>=0.10",
]
[project]
name = "python-sbom"
import-names = [ "python_sbom" ]
description = "SBOMs for Python distributions: write PEP 770 CycloneDX SBOMs into wheels."
keywords = [
"cyclonedx",
"hatch",
"maturin",
"meson-python",
"pdm-backend",
"pep517",
"pep770",
"sbom",
"setuptools",
"spdx",
]
license = "MIT AND Apache-2.0"
license-files = [ "LICENSE", "src/python_sbom/_validate/schemas/LICENSE" ]
maintainers = [
{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" },
]
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Hatch",
"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",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Security",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dynamic = [
"readme",
"version",
]
dependencies = [
"installer>=1.1",
"packageurl-python>=0.11.1",
"packaging>=26.3",
"zipremove>=0.10",
]
optional-dependencies.hatch = [
"hatchling>=1.28",
]
optional-dependencies.pdm = [
"pdm-backend>=2.4",
]
optional-dependencies.setuptools = [
"setuptools>=77",
]
optional-dependencies.validate = [
"jsonschema-rs>=0.60.3",
"license-expression>=30",
"spdx-tools>=0.8.5",
]
urls.Changelog = "https://python-sbom.readthedocs.io/en/latest/changelog.html"
urls.Documentation = "https://python-sbom.readthedocs.io"
urls.Homepage = "https://github.com/tox-dev/python-sbom"
urls.Source = "https://github.com/tox-dev/python-sbom"
urls.Tracker = "https://github.com/tox-dev/python-sbom/issues"
scripts.python-sbom = "python_sbom._cli._main:main"
entry-points."pdm.build.hook".python-sbom = "python_sbom.pdm:SbomBuildHook"
entry-points."setuptools.finalize_distribution_options".python-sbom = """\
python_sbom.setuptools:finalize_distribution_options\
"""
entry-points.hatch.python-sbom = "python_sbom.hatch.hooks"
[dependency-groups]
dev = [
{ include-group = "lint" },
{ include-group = "pkg-meta" },
{ include-group = "test" },
{ include-group = "type" },
]
test = [
"covdefaults>=2.3",
"flit-core>=3.12",
"hatchling>=1.28",
"installer>=1.1",
"jsonschema-rs>=0.60.3",
"pdm-backend>=2.4",
"pytest>=9.1.1",
"pytest-cov>=7.1",
"pytest-mock>=3.16",
"setuptools>=77",
"spdx-tools>=0.8.5",
]
type = [
"ty>=0.0.100",
{ include-group = "bench" },
{ include-group = "docs" },
{ include-group = "test" },
]
docs = [
"furo>=2025.12.19",
"hatchling>=1.28",
"pdm-backend>=2.4",
"setuptools>=77",
"sphinx>=9.0.4",
"sphinx-argparse-cli>=1.23",
"sphinx-autodoc-typehints>=3.17",
"sphinx-copybutton>=0.5.2",
"sphinx-design>=0.7",
"sphinx-inline-tabs>=2025.12.21.14",
"sphinxcontrib-mermaid>=2.1.1",
]
bench = [
"pyperf>=2.10",
{ include-group = "build" },
{ include-group = "test" },
]
# the release build installs [build-system] requires with the hashes this group locks, so it lists all of them,
# including what python-sbom's own hook needs to describe its wheel
build = [
"hatch-fancy-pypi-readme>=25.1",
"hatch-vcs>=0.5",
"hatchling>=1.32.4",
"installer>=1.1",
"packageurl-python>=0.11.1",
"zipremove>=0.10",
]
cibuildwheel = [ { include-group = "example" }, "cibuildwheel>=4.3.5" ]
delocate = [
{ include-group = "example" },
"delocate>=0.13",
"meson>=1.12.1",
"meson-python>=0.22.1",
"ninja>=1.13.2",
]
example = [
"build>=1.6.1",
"covdefaults>=2.3",
"pytest>=9.1.1",
"pytest-cov>=7.1",
]
flit-core = [ { include-group = "example" }, "flit-core>=3.12" ]
hatchling = [ { include-group = "example" }, "hatchling>=1.28" ]
lint = [ "pre-commit-uv>=4.3" ]
maturin = [ { include-group = "example" }, "maturin>=1.15,<2" ]
meson-python = [ { include-group = "example" }, "meson>=1.12.1", "meson-python>=0.22.1", "ninja>=1.13.2" ]
pdm-backend = [ { include-group = "example" }, "pdm-backend>=2.4" ]
pkg-meta = [ "check-wheel-contents>=0.6.3", "twine>=7", "uv>=0.12.22" ]
poetry-core = [ { include-group = "example" }, "poetry-core>=2.5" ]
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",
]
scikit-build-core = [ { include-group = "example" }, "cmake>=4.4.4", "ninja>=1.13.2", "scikit-build-core>=1.1" ]
setuptools = [ { include-group = "example" }, "setuptools>=77" ]
uv-build = [ { include-group = "example" }, "uv-build>=0.13.6" ]
zipapp = [ { include-group = "example" }, "hatchling>=1.28" ]
[tool.hatch]
version.source = "vcs"
metadata.hooks.fancy-pypi-readme.content-type = "text/markdown"
metadata.hooks.fancy-pypi-readme.fragments = [ { path = "README.md" } ]
# PyPI cannot resolve the README's relative image paths, so the logo comes from the default branch there
metadata.hooks.fancy-pypi-readme.substitutions = [
{ pattern = '"docs/_static/', replacement = '"https://raw.githubusercontent.com/tox-dev/python-sbom/main/docs/_static/' },
]
build.hooks.vcs.version-file = "src/python_sbom/version.py"
# writes python-sbom's own SBOM with the hook it ships, after the vcs hook writes the version
build.hooks.custom.path = "hatch_build.py"
[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", # The project does not add copyright headers to individual files
"DOC", # Public API documentation is generated from signatures
"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
"undocumented-magic-method", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-class", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-function", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-init", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-method", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-nested-class", # undocumented-public-api (simplint SMP903) covers the public API instead
]
lint.per-file-ignores."bench/**/*.py" = [
"import-private-name", # Benchmarks time the private entry points the public API wraps
"start-process-with-partial-path", # Fixtures run git from PATH, as a project build does
"subprocess-without-shell-equals-true", # Commands are fixed argument lists the harness builds
"suspicious-subprocess-import", # Fixtures and cold cases run git, uv and Python processes
]
lint.per-file-ignores."docs/examples/**/*.py" = [
"implicit-namespace-package", # Each example is a project of its own, with a src layout
"print", # The examples are command-line programs that print their greeting
]
lint.per-file-ignores."tests/**/*.py" = [
"assert", # Tests use assertions
"D", # Test names document behavior
"FBT", # Boolean parameters keep parameterized cases compact
"implicit-namespace-package", # The tests directory is not a package
"import-private-name", # Unit tests cover the private modules behind the small public API
"magic-value-comparison", # Literal expected values keep assertions local
"subprocess-without-shell-equals-true", # Entry-point arguments are fixed by the tests
"suspicious-subprocess-import", # Entry-point tests invoke a local Python executable
]
# the fixture mirrors virtualenv's seed/wheels/embed/__init__.py, which holds the bundle table
lint.per-file-ignores."tests/_seeder/src/**/__init__.py" = [ "non-empty-init-module" ]
lint.isort = { known-first-party = [
"python_sbom",
], required-imports = [
"from __future__ import annotations",
] }
lint.preview = true
[tool.codespell]
builtin = "clear,usage,en-GB_to_en-US"
ignore-words-list = "acknowledgement"
count = true
[tool.pyproject-fmt]
max_supported_python = "3.15"
[tool.ty]
environment.python-version = "3.15"
[tool.pytest]
ini_options.testpaths = [ "tests" ]
# test modules mirror the source modules, so their names repeat across directories
ini_options.addopts = [ "--import-mode=importlib" ]
ini_options.filterwarnings = [
"error",
]
ini_options.verbosity_assertions = 2
[tool.coverage]
run.parallel = true
run.plugins = [
"covdefaults",
]
run.core = "ctrace" # sysmon (3.14+ default) cannot record the per-test contexts we collect
paths.source = [
"src",
".tox*/*/lib/python*/site-packages",
".tox*/pypy*/site-packages",
".tox*\\*\\Lib\\site-packages",
"*/src",
"*\\src",
]
report.fail_under = 100
html.show_contexts = true
html.skip_covered = false
[tool.towncrier]
name = "python-sbom"
directory = "docs/changelog.d"
filename = "docs/changelog.rst"
template = "release_creator.fragments:template.rst.jinja2"
title_format = false
underlines = [ "-", "~", "^" ]
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.python-sbom]
supplier = { name = "tox-dev", url = [ "https://github.com/tox-dev" ] }
[tool.simplint]
docstring-style = "rst"
# the fixture mirrors virtualenv's seed/wheels/embed/__init__.py, which holds the bundle table
per-file-ignores."tests/_seeder/src/**/__init__.py" = [ "missing-final", "module-variable-prefix" ]
[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" ]