mirror of
https://github.com/anchore/syft.git
synced 2025-11-21 02:13:17 +01:00
20 lines
675 B
Go
20 lines
675 B
Go
/*
|
|
Package python provides a concrete Cataloger implementation for Python ecosystem files (egg, wheel, requirements.txt).
|
|
*/
|
|
package python
|
|
|
|
import (
|
|
"github.com/anchore/syft/syft/pkg/cataloger/common"
|
|
)
|
|
|
|
// NewPythonIndexCataloger returns a new cataloger for python packages referenced from poetry lock files, requirements.txt files, and setup.py files.
|
|
func NewPythonIndexCataloger() *common.GenericCataloger {
|
|
globParsers := map[string]common.ParserFn{
|
|
"**/*requirements*.txt": parseRequirementsTxt,
|
|
"**/poetry.lock": parsePoetryLock,
|
|
"**/setup.py": parseSetup,
|
|
}
|
|
|
|
return common.NewGenericCataloger(nil, globParsers, "python-index-cataloger")
|
|
}
|