diff options
author | Seth Michael Larson <seth@python.org> | 2024-02-06 10:25:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 10:25:58 (GMT) |
commit | 4bf41879d03b1da3c6d38c39a04331e3ae2e7545 (patch) | |
tree | c407ab1c9d2b64f13e3f0418c01411d83c8ec9a3 /Tools/build | |
parent | 13eb5215c9de9dd302f116ef0bca4ae23b02842b (diff) | |
download | cpython-4bf41879d03b1da3c6d38c39a04331e3ae2e7545.zip cpython-4bf41879d03b1da3c6d38c39a04331e3ae2e7545.tar.gz cpython-4bf41879d03b1da3c6d38c39a04331e3ae2e7545.tar.bz2 |
gh-112302: Change 'licenseConcluded' field to 'NOASSERTION' (#115038)
Diffstat (limited to 'Tools/build')
-rw-r--r-- | Tools/build/generate_sbom.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Tools/build/generate_sbom.py b/Tools/build/generate_sbom.py index aceb13f..442487f 100644 --- a/Tools/build/generate_sbom.py +++ b/Tools/build/generate_sbom.py @@ -338,7 +338,7 @@ def discover_pip_sbom_package(sbom_data: dict[str, typing.Any]) -> None: "name": "pip", "versionInfo": pip_version, "originator": "Organization: Python Packaging Authority", - "licenseConcluded": "MIT", + "licenseConcluded": "NOASSERTION", "downloadLocation": pip_download_url, "checksums": [ {"algorithm": "SHA256", "checksumValue": pip_checksum_sha256} @@ -383,9 +383,11 @@ def main() -> None: discover_pip_sbom_package(sbom_data) # Ensure all packages in this tool are represented also in the SBOM file. + actual_names = {package["name"] for package in sbom_data["packages"]} + expected_names = set(PACKAGE_TO_FILES) error_if( - {package["name"] for package in sbom_data["packages"]} != set(PACKAGE_TO_FILES), - "Packages defined in SBOM tool don't match those defined in SBOM file.", + actual_names != expected_names, + f"Packages defined in SBOM tool don't match those defined in SBOM file: {actual_names}, {expected_names}", ) # Make a bunch of assertions about the SBOM data to ensure it's consistent. @@ -422,8 +424,8 @@ def main() -> None: # License must be on the approved list for SPDX. license_concluded = package["licenseConcluded"] error_if( - license_concluded not in ALLOWED_LICENSE_EXPRESSIONS, - f"License identifier '{license_concluded}' not in SBOM tool allowlist" + license_concluded != "NOASSERTION", + f"License identifier must be 'NOASSERTION'" ) # We call 'sorted()' here a lot to avoid filesystem scan order issues. |