mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 00:43:20 +01:00
* Added parser for Pipfile.lock to cataloger Signed-off-by: Nikita <33390074+Zilborg@users.noreply.github.com> * make lint-fix Signed-off-by: Nikita <33390074+Zilborg@users.noreply.github.com> * Update syft/pkg/cataloger/python/parse_pipfile_lock.go Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com> Signed-off-by: Nikita <33390074+Zilborg@users.noreply.github.com> * fix _version Signed-off-by: Nikita <33390074+Zilborg@users.noreply.github.com> * swap method for trimming "==" prefix from pipfile pkg versions Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com> Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
21 lines
720 B
Go
21 lines
720 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,
|
|
"**/Pipfile.lock": parsePipfileLock,
|
|
"**/setup.py": parseSetup,
|
|
}
|
|
|
|
return common.NewGenericCataloger(nil, globParsers, "python-index-cataloger")
|
|
}
|