test_data_rule_runtime_sbom.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from __future__ import annotations
  2. import json
  3. from pathlib import Path
  4. ROOT = Path(__file__).resolve().parents[1]
  5. SBOM = ROOT / "docs" / "security" / "data-rule-runtime-sbom.json"
  6. def test_data_rule_runtime_sbom_pins_official_oss_dependencies():
  7. document = json.loads(SBOM.read_text(encoding="utf-8"))
  8. components = {
  9. component["name"]: component
  10. for component in document["components"]
  11. }
  12. assert document["bomFormat"] == "CycloneDX"
  13. assert document["specVersion"] == "1.5"
  14. assert components["polars"] == {
  15. "type": "library",
  16. "name": "polars",
  17. "version": "1.42.1",
  18. "purl": "pkg:pypi/polars@1.42.1",
  19. "license": "MIT",
  20. "officialSource": "https://github.com/pola-rs/polars",
  21. "purpose": "Bounded lazy/dataframe execution for governed batch rules",
  22. }
  23. assert components["minio"] == {
  24. "type": "library",
  25. "name": "minio",
  26. "version": "7.2.10",
  27. "purl": "pkg:pypi/minio@7.2.10",
  28. "license": "Apache-2.0",
  29. "officialSource": "https://github.com/minio/minio-py",
  30. "purpose": "Digest-bound Parquet artifact transport and metadata",
  31. }
  32. requirements = (ROOT / "requirements.txt").read_text(encoding="utf-8")
  33. assert "polars==1.42.1" in requirements
  34. assert "minio==7.2.10" in requirements