Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): update cyclonedx-python-lib requirement from <1.0.0,>=0.11.1 to >=0.11.1,<2.0.0 #216

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ All versions prior to 0.0.9 are untracked.

### Changed

* Output formats: The SBOM output formats (`--format=cyclonedx-xml` and
`--format=cyclonedx-json`) now use CycloneDX
[Schema 1.4](https://cyclonedx.org/docs/1.4/xml/)
([#216](https://github.com/trailofbits/pip-audit/pull/216))

### Fixed

### Removed
Expand Down
9 changes: 6 additions & 3 deletions pip_audit/_format/cyclonedx.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def __init__(self, result: Dict[service.Dependency, List[service.VulnerabilityRe
Vulnerability(
id=vuln.id,
description=vuln.description,
advisories=[f"Upgrade: {v}" for v in vuln.fix_versions],
recommendations=["Upgrade"],
recommendation="Upgrade",
)
)

Expand Down Expand Up @@ -75,6 +74,10 @@ def format(self, result: Dict[service.Dependency, List[service.VulnerabilityResu
parser = _PipAuditResultParser(result)
bom = Bom.from_parser(parser)

formatter = output.get_instance(bom=bom, output_format=self._inner_format.value)
formatter = output.get_instance(
bom=bom,
output_format=self._inner_format.value,
schema_version=output.SchemaVersion.V1_4,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N.B.: This explicitly pins us to CycloneDX's 1.4 schema now that it's supported, which fixes #151.

)

return formatter.output_as_string()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"resolvelib>=0.8.0",
"html5lib>=1.1",
"CacheControl[filecache]>=0.12.10",
"cyclonedx-python-lib>=0.11.1,<1.0.0",
"cyclonedx-python-lib>=1.0.0,<2.0.0",
],
extras_require={
"dev": [
Expand Down