mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
/*
|
|
Package python provides a concrete Cataloger implementation for Python ecosystem files (egg, wheel, requirements.txt).
|
|
*/
|
|
package python
|
|
|
|
import (
|
|
"github.com/anchore/syft/syft/cataloger/packages/generic"
|
|
)
|
|
|
|
// NewPythonIndexCataloger returns a new cataloger for python packages referenced from poetry lock files, requirements.txt files, and setup.py files.
|
|
func NewPythonRequirementsCataloger() *generic.Cataloger {
|
|
globParsers := map[string]generic.Parser{
|
|
"**/*requirements*.txt": parseRequirementsTxt,
|
|
}
|
|
|
|
return generic.NewCataloger(nil, globParsers)
|
|
}
|
|
|
|
func NewPythonPoetryCataloger() *generic.Cataloger {
|
|
globParsers := map[string]generic.Parser{
|
|
"**/poetry.lock": parsePoetryLock,
|
|
}
|
|
|
|
return generic.NewCataloger(nil, globParsers)
|
|
}
|
|
|
|
func NewPythonPipfileCataloger() *generic.Cataloger {
|
|
globParsers := map[string]generic.Parser{
|
|
"**/Pipfile.lock": parsePipfileLock,
|
|
}
|
|
|
|
return generic.NewCataloger(nil, globParsers)
|
|
}
|
|
|
|
func NewPythonSetupCataloger() *generic.Cataloger {
|
|
globParsers := map[string]generic.Parser{
|
|
"**/setup.py": parseSetup,
|
|
}
|
|
|
|
return generic.NewCataloger(nil, globParsers)
|
|
}
|