mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
Add relationships for python poetry packages (#2906)
* [wip] add initial poetry.lock relationship support Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * provide generic set for basic types Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * dependency resolver should allow for conditional deps Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * add tests for poetry lock relationship additions Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * update schema with python poetry dependency refs Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * dep specification data structure should not be recursive in nature Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -34,8 +34,10 @@ func dbEntryDependencySpecifier(p pkg.Package) dependency.Specification {
|
||||
}
|
||||
|
||||
return dependency.Specification{
|
||||
Provides: provides,
|
||||
Requires: requires,
|
||||
ProvidesRequires: dependency.ProvidesRequires{
|
||||
Provides: provides,
|
||||
Requires: requires,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,10 @@ func Test_dbEntryDependencySpecifier(t *testing.T) {
|
||||
},
|
||||
},
|
||||
want: dependency.Specification{
|
||||
Provides: []string{"package-c", "a-thing", "a-thing"}, // note: gets deduplicated downstream
|
||||
Requires: []string{"b-thing"},
|
||||
ProvidesRequires: dependency.ProvidesRequires{
|
||||
Provides: []string{"package-c", "a-thing", "a-thing"}, // note: gets deduplicated downstream
|
||||
Requires: []string{"b-thing"},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -39,8 +41,10 @@ func Test_dbEntryDependencySpecifier(t *testing.T) {
|
||||
},
|
||||
},
|
||||
want: dependency.Specification{
|
||||
Provides: []string{"package-a", "libtree-sitter.so.me=1-64", "libtree-sitter.so.me"},
|
||||
Requires: []string{"libtree-sitter.so.thing=2-64"},
|
||||
ProvidesRequires: dependency.ProvidesRequires{
|
||||
Provides: []string{"package-a", "libtree-sitter.so.me=1-64", "libtree-sitter.so.me"},
|
||||
Requires: []string{"libtree-sitter.so.thing=2-64"},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -53,8 +57,10 @@ func Test_dbEntryDependencySpecifier(t *testing.T) {
|
||||
},
|
||||
},
|
||||
want: dependency.Specification{
|
||||
Provides: []string{"package-a"},
|
||||
Requires: nil,
|
||||
ProvidesRequires: dependency.ProvidesRequires{
|
||||
Provides: []string{"package-a"},
|
||||
Requires: nil,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user