Update grype db as part of installation

This commit is contained in:
Kovid Goyal 2025-10-17 10:29:45 +05:30
parent ced66a2815
commit cb56da890c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -160,7 +160,9 @@ def install_grype() -> str:
data = download_with_retry(url)
with tarfile.open(fileobj=io.BytesIO(data), mode='r') as tf:
tf.extract('grype', path=dest, filter='fully_trusted')
return os.path.join(dest, 'grype')
exe = os.path.join(dest, 'grype')
subprocess.run([exe, 'db', 'update'])
return exe
IGNORED_DEPENDENCY_CVES = [
@ -222,7 +224,7 @@ def check_dependencies() -> None:
print('Testing against the SBOM', flush=True)
import runpy
orig = sys.argv, sys.stdout
sys.argv = ['bypy', 'sbom', 'myproject', '1.0.0']
sys.argv = ['bypy', 'sbom', 'calibre', '1.0.0']
buf = io.StringIO()
sys.stdout = buf
runpy.run_path('bypy-src')