Run grype against SBOM as well

This commit is contained in:
Kovid Goyal 2025-09-17 22:18:30 +05:30
parent cf9b0da489
commit 87856efa49
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -224,6 +224,17 @@ def check_dependencies() -> None:
install_bundle(dest, os.path.basename(dest))
if (cp := subprocess.run([grype, '--config', gc, '--fail-on', 'medium', SW])).returncode != 0:
raise SystemExit(cp.returncode)
# Now test against the SBOM
import runpy
orig = sys.argv, sys.stdout
sys.argv = ['bypy', 'sbom', 'myproject', '1.0.0']
buf = io.StringIO()
sys.stdout = buf
runpy.run_path('bypy-src')
sys.argv, sys.stdout = orig
print(buf.getvalue())
if (cp := subprocess.run([grype, '--config', gc, '--fail-on', 'medium'], input=buf.getvalue().encode())).returncode != 0:
raise SystemExit(cp.returncode)
def main() -> None: