csspin-python 6.0.0__py3-none-any.whl → 6.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- csspin_python/python_sbom.py +29 -2
- csspin_python/python_sbom_schema.yaml +3 -0
- {csspin_python-6.0.0.dist-info → csspin_python-6.0.1.dist-info}/METADATA +1 -1
- {csspin_python-6.0.0.dist-info → csspin_python-6.0.1.dist-info}/RECORD +7 -7
- {csspin_python-6.0.0.dist-info → csspin_python-6.0.1.dist-info}/WHEEL +0 -0
- {csspin_python-6.0.0.dist-info → csspin_python-6.0.1.dist-info}/licenses/LICENSE +0 -0
- {csspin_python-6.0.0.dist-info → csspin_python-6.0.1.dist-info}/top_level.txt +0 -0
csspin_python/python_sbom.py
CHANGED
|
@@ -42,12 +42,14 @@ from csspin import (
|
|
|
42
42
|
from csspin.tree import ConfigTree
|
|
43
43
|
from packaging.requirements import Requirement
|
|
44
44
|
from packaging.utils import canonicalize_name
|
|
45
|
+
from packaging.version import Version
|
|
45
46
|
from path import Path
|
|
46
47
|
|
|
47
48
|
defaults = config(
|
|
48
|
-
cyclonedx_bom_version="7.
|
|
49
|
+
cyclonedx_bom_version="7.5.0",
|
|
49
50
|
project_paths=["{spin.project_root}"],
|
|
50
51
|
repository_url="{python.index_url}",
|
|
52
|
+
spec_version="1.7",
|
|
51
53
|
requires=config(spin=["csspin_python.python"], python=["setuptools"]),
|
|
52
54
|
)
|
|
53
55
|
|
|
@@ -90,6 +92,7 @@ def sbom(cfg: ConfigTree) -> None:
|
|
|
90
92
|
cfg.python_sbom.repository_url,
|
|
91
93
|
file_name,
|
|
92
94
|
)
|
|
95
|
+
_mark_components_external(sbom_json)
|
|
93
96
|
_write_sbom(cfg, sbom_json, project_name)
|
|
94
97
|
|
|
95
98
|
|
|
@@ -161,7 +164,19 @@ def _run_cyclonedx(cfg: ConfigTree, third_party_deps: set[str], stderr: int) ->
|
|
|
161
164
|
with TemporaryDirectory() as tmp_dir:
|
|
162
165
|
venv = Path(tmp_dir) / "venv"
|
|
163
166
|
interpreter = venv / binary_dir / "python" + cfg.platform.exe
|
|
164
|
-
|
|
167
|
+
# Run --upgrade-deps and set PIP_CONSTRAINT to force pip and setuptools
|
|
168
|
+
# to have the version from the constraint files, if they are present.
|
|
169
|
+
# Necessary as python3.11 still has setuptools in the env created by
|
|
170
|
+
# venv.
|
|
171
|
+
sh(
|
|
172
|
+
cfg.python.interpreter,
|
|
173
|
+
"-m",
|
|
174
|
+
"venv",
|
|
175
|
+
"--upgrade-deps",
|
|
176
|
+
venv,
|
|
177
|
+
use_subprocess_environment=False,
|
|
178
|
+
env={"PIP_CONSTRAINT": " ".join(cfg.python.constraints)},
|
|
179
|
+
)
|
|
165
180
|
if third_party_deps:
|
|
166
181
|
sh(
|
|
167
182
|
interpreter,
|
|
@@ -195,6 +210,8 @@ def _run_cyclonedx(cfg: ConfigTree, third_party_deps: set[str], stderr: int) ->
|
|
|
195
210
|
"-m",
|
|
196
211
|
"cyclonedx_py",
|
|
197
212
|
"environment",
|
|
213
|
+
"--spec-version",
|
|
214
|
+
cfg.python_sbom.spec_version,
|
|
198
215
|
venv,
|
|
199
216
|
use_subprocess_environment=False,
|
|
200
217
|
stderr=stderr,
|
|
@@ -364,6 +381,16 @@ def _enrich_sbom(
|
|
|
364
381
|
sbom_json["dependencies"] = dependencies
|
|
365
382
|
|
|
366
383
|
|
|
384
|
+
def _mark_components_external(sbom_json: dict) -> None:
|
|
385
|
+
"""
|
|
386
|
+
Flag the third-party components as external, for CycloneDX 1.7 and newer.
|
|
387
|
+
"""
|
|
388
|
+
if Version(sbom_json["specVersion"]) < Version("1.7"):
|
|
389
|
+
return
|
|
390
|
+
for component in sbom_json.get("components", []):
|
|
391
|
+
component["isExternal"] = True
|
|
392
|
+
|
|
393
|
+
|
|
367
394
|
def _collect_thirdparty_deps(requires_dist: list, python_version: str) -> set[str]:
|
|
368
395
|
"""Extract 'thirdparty' dependency specifiers from project metadata."""
|
|
369
396
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: csspin-python
|
|
3
|
-
Version: 6.0.
|
|
3
|
+
Version: 6.0.1
|
|
4
4
|
Summary: Plugin-package for csspin providing Python related plugins
|
|
5
5
|
Author-email: CONTACT Software GmbH <info@contact-software.com>
|
|
6
6
|
Maintainer-email: Waleri Enns <waleri.enns@contact-software.com>, Benjamin Thomas Schwertfeger <benjaminthomas.schwertfeger@contact-software.com>, Fabian Hafer <fabian.hafer@contact-software.com>
|
|
@@ -10,15 +10,15 @@ csspin_python/playwright_schema.yaml,sha256=TSeR16YHa7m7bfO59F2eMV-jXcglluTJdEpU
|
|
|
10
10
|
csspin_python/pytest.py,sha256=vSLtmS-kNO0NPo_tszfEm5zGwJb6Yb5IGS-hA7CNguo,4544
|
|
11
11
|
csspin_python/pytest_schema.yaml,sha256=tzXtdF6MvGC9v59EVRJFfLeMMHqPsXcFXy2zJtRECBI,1535
|
|
12
12
|
csspin_python/python.py,sha256=uoWCm_X2_yGaOdnxAb_h2Mr8RjLd5MjuVL4cPF15E2E,41973
|
|
13
|
-
csspin_python/python_sbom.py,sha256=
|
|
14
|
-
csspin_python/python_sbom_schema.yaml,sha256=
|
|
13
|
+
csspin_python/python_sbom.py,sha256=l80mNwrIe3uK0F_3nnob_tY9EVunsWhrOlQHhYAMt3U,14523
|
|
14
|
+
csspin_python/python_sbom_schema.yaml,sha256=kxz5TJdUmUkDwG6ZD9ORi7xj-yF_BjeMhjmsj6labgM,856
|
|
15
15
|
csspin_python/python_schema.yaml,sha256=RwJgbyIRenj18-s60HmqkwWCGtd6G1acpJ9TDI9QjBQ,6448
|
|
16
16
|
csspin_python/radon.py,sha256=uFqm6FEi5oWj-_XVaAm3s9cam0cUmr1_FwRf40K6xWs,1876
|
|
17
17
|
csspin_python/radon_schema.yaml,sha256=rlRzXw5z4XbjOVznRiUxWGP4E9hx1Jm-gGw1iQiYzE0,548
|
|
18
18
|
csspin_python/uv_provisioner.py,sha256=2M1I8PqWTCUxqaOeJI5rchmly6t-MnOPQfIx-kKzdQU,6757
|
|
19
19
|
csspin_python/uv_provisioner_schema.yaml,sha256=Y8ZNC2OMnhR8Us3WUXAXK9hMjqGWAKFJB2puX4X5XNQ,727
|
|
20
|
-
csspin_python-6.0.
|
|
21
|
-
csspin_python-6.0.
|
|
22
|
-
csspin_python-6.0.
|
|
23
|
-
csspin_python-6.0.
|
|
24
|
-
csspin_python-6.0.
|
|
20
|
+
csspin_python-6.0.1.dist-info/licenses/LICENSE,sha256=4MAecetnRTQw5DlHtiikDSzKWO1xVLwzM5_DsPMYlnE,10172
|
|
21
|
+
csspin_python-6.0.1.dist-info/METADATA,sha256=AHEvlyahGD-q_aY2O8HE7A35QGVDtM8LOKrdfKyz1mk,5254
|
|
22
|
+
csspin_python-6.0.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
23
|
+
csspin_python-6.0.1.dist-info/top_level.txt,sha256=QSeglMEGbFu1z4L6MCQYwo01NgL0KojWvC4rzgMQ8gU,14
|
|
24
|
+
csspin_python-6.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|