mirror of
https://github.com/anchore/syft
synced 2024-09-20 06:01:53 +00:00
Expand matching of requirements.txt file to include any prefixes or suffixes (#168)
* Expand matching of requirements.txt file to include any prefixes or suffixes Signed-off-by: Samuel Dacanay <sam.dacanay@anchore.com> * Add some test cases to integration test (ensure syft can pick up multiple requirements files) Signed-off-by: Samuel Dacanay <sam.dacanay@anchore.com> * Run lint-fix Signed-off-by: Samuel Dacanay <sam.dacanay@anchore.com>
This commit is contained in:
parent
df7c83c9b0
commit
11334b632e
4 changed files with 14 additions and 2 deletions
|
@ -20,7 +20,7 @@ func New() *Cataloger {
|
|||
globParsers := map[string]common.ParserFn{
|
||||
"**/*egg-info/PKG-INFO": parseEggMetadata,
|
||||
"**/*dist-info/METADATA": parseWheelMetadata,
|
||||
"**/requirements.txt": parseRequirementsTxt,
|
||||
"**/*requirements*.txt": parseRequirementsTxt,
|
||||
"**/poetry.lock": parsePoetryLock,
|
||||
"**/setup.py": parseSetup,
|
||||
}
|
||||
|
|
|
@ -81,7 +81,13 @@ var cases = []struct {
|
|||
pkgType: pkg.PythonRequirementsPkg,
|
||||
pkgLanguage: pkg.Python,
|
||||
pkgInfo: map[string]string{
|
||||
"flask": "4.0.0",
|
||||
"flask": "4.0.0",
|
||||
"python-dateutil": "2.8.1",
|
||||
"python-swiftclient": "3.8.1",
|
||||
"pytz": "2019.3",
|
||||
"jsonschema": "2.6.0",
|
||||
"passlib": "1.7.2",
|
||||
"pathlib": "1.0.1",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
jsonschema==2.6.0
|
||||
passlib==1.7.2
|
||||
pathlib==1.0.1
|
|
@ -0,0 +1,3 @@
|
|||
python-dateutil==2.8.1
|
||||
python-swiftclient==3.8.1
|
||||
pytz==2019.3
|
Loading…
Reference in a new issue