-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pip: Properly report packages declared in requirements_build_files
Considering that the user configured his repository correctly, the only dependencies that should be present in files declared via the 'requirements_build_files' input JSON option are build dependencies. Having this info in the SBOM will help future security analysis perfomed on the built artifact. Signed-off-by: Bruno Pimentel <[email protected]>
- Loading branch information
1 parent
205ba17
commit 7433bbf
Showing
3 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,10 @@ | |
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
}, | ||
{ | ||
"name": "cachi2:pip:package:build-dependency", | ||
"value": "true" | ||
} | ||
], | ||
"purl": "pkg:pypi/[email protected]", | ||
|
@@ -78,6 +82,10 @@ | |
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
}, | ||
{ | ||
"name": "cachi2:pip:package:build-dependency", | ||
"value": "true" | ||
} | ||
], | ||
"purl": "pkg:pypi/[email protected]", | ||
|
@@ -114,6 +122,10 @@ | |
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
}, | ||
{ | ||
"name": "cachi2:pip:package:build-dependency", | ||
"value": "true" | ||
} | ||
], | ||
"purl": "pkg:pypi/[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3888,7 +3888,7 @@ def test_resolve_pip( | |
"name": "bar", | ||
"version": "2.1", | ||
"type": "pip", | ||
"dev": False, | ||
"build_dependency": False, | ||
"kind": "pypi", | ||
"requirement_file": "req.txt" if custom_requirements else "requirements.txt", | ||
"missing_req_file_checksum": False, | ||
|
@@ -3899,7 +3899,7 @@ def test_resolve_pip( | |
"name": "baz", | ||
"version": "0.0.5", | ||
"type": "pip", | ||
"dev": True, | ||
"build_dependency": True, | ||
"kind": "pypi", | ||
"requirement_file": "breq.txt" if custom_requirements else "requirements-build.txt", | ||
"missing_req_file_checksum": False, | ||
|
@@ -4097,7 +4097,7 @@ def test_fetch_pip_source( | |
"name": "bar", | ||
"version": "https://x.org/bar.zip#cachito_hash=sha256:aaaaaaaaaa", | ||
"type": "pip", | ||
"dev": False, | ||
"build_dependency": False, | ||
"kind": "url", | ||
"requirement_file": "requirements.txt", | ||
"missing_req_file_checksum": False, | ||
|
@@ -4108,7 +4108,7 @@ def test_fetch_pip_source( | |
"version": "0.0.5", | ||
"index_url": pypi_simple.PYPI_SIMPLE_ENDPOINT, | ||
"type": "pip", | ||
"dev": True, | ||
"build_dependency": True, | ||
"kind": "pypi", | ||
"requirement_file": "requirements.txt", | ||
"missing_req_file_checksum": False, | ||
|
@@ -4125,7 +4125,7 @@ def test_fetch_pip_source( | |
"version": "3.2", | ||
"index_url": CUSTOM_PYPI_ENDPOINT, | ||
"type": "pip", | ||
"dev": False, | ||
"build_dependency": False, | ||
"kind": "pypi", | ||
"requirement_file": "requirements.txt", | ||
"missing_req_file_checksum": True, | ||
|
@@ -4135,7 +4135,7 @@ def test_fetch_pip_source( | |
"name": "eggs", | ||
"version": "https://x.org/eggs.zip#cachito_hash=sha256:aaaaaaaaaa", | ||
"type": "pip", | ||
"dev": False, | ||
"build_dependency": False, | ||
"kind": "url", | ||
"requirement_file": "requirements.txt", | ||
"missing_req_file_checksum": True, | ||
|
@@ -4178,7 +4178,10 @@ def test_fetch_pip_source( | |
name="baz", | ||
version="0.0.5", | ||
purl="pkg:pypi/[email protected]", | ||
properties=[Property(name="cachi2:pip:package:binary", value="true")], | ||
properties=[ | ||
Property(name="cachi2:pip:package:binary", value="true"), | ||
Property(name="cachi2:pip:package:build-dependency", value="true"), | ||
], | ||
), | ||
] | ||
|
||
|