add poetry command (#67)

* add poetry command

* add poetry.lock extractor & define cmd parser for poetry

* feat: support Poetry caret/tilde version syntax

* add wildcard constraint support & test cases

* readme update

* chore: small fixes
This commit is contained in:
Sahil Bansal
2025-08-29 00:21:09 +05:30
committed by GitHub
parent 78bc6afa67
commit 12aaba8a05
11 changed files with 810 additions and 40 deletions
+19
View File
@@ -41,3 +41,22 @@ func (u *UvExtractor) GetPackageManager() PackageManagerName {
func (u *UvExtractor) Extract(lockfilePath, scanDir string) ([]*packagev1.PackageVersion, error) {
return parseLockfile(lockfilePath, scanDir, u.GetEcosystem())
}
// PoetryExtractor handles poetry.lock files
type PoetryExtractor struct{}
func (p *PoetryExtractor) GetSupportedFiles() []string {
return []string{"poetry.lock"}
}
func (p *PoetryExtractor) GetEcosystem() packagev1.Ecosystem {
return packagev1.Ecosystem_ECOSYSTEM_PYPI
}
func (p *PoetryExtractor) GetPackageManager() PackageManagerName {
return Poetry
}
func (p *PoetryExtractor) Extract(lockfilePath, scanDir string) ([]*packagev1.PackageVersion, error) {
return parseLockfile(lockfilePath, scanDir, p.GetEcosystem())
}