20 lines
732 B
Python
20 lines
732 B
Python
from pathlib import Path
|
|
import subprocess
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
if __name__ == "__main__":
|
|
command = (
|
|
"pip install --quiet --target /tmp/audit pip-audit==2.9.0 >/dev/null && "
|
|
"PYTHONPATH=/tmp/audit python -m pip_audit "
|
|
"--path /usr/local/lib/python3.13/site-packages --cache-dir /tmp/cache "
|
|
"--format json --progress-spinner off"
|
|
)
|
|
with (ROOT / "evidence/dependency-audit.json").open("wb") as output:
|
|
result = subprocess.run([
|
|
"docker", "run", "--rm", "-e", "XDG_CACHE_HOME=/tmp/cache",
|
|
"--entrypoint", "sh", "mtusi-messenger:lab7", "-c", command,
|
|
], stdout=output, check=False)
|
|
raise SystemExit(result.returncode)
|