python

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ParsePdmLock

func ParsePdmLock(pathToLockfile string) ([]lockfile.PackageDetails, error)

func ParsePipenvLock

func ParsePipenvLock(pathToLockfile string) ([]lockfile.PackageDetails, error)

func ParsePoetryLock

func ParsePoetryLock(pathToLockfile string) ([]lockfile.PackageDetails, error)

func ParseRequirementsTxt

func ParseRequirementsTxt(pathToLockfile string) ([]lockfile.PackageDetails, error)

func ParseUvLock

func ParseUvLock(pathToLockfile string) ([]lockfile.PackageDetails, error)

Types

type Comment

type Comment struct {
	Content string
	Type    CommentType
}

Comment represents a parsed requirements.txt comment

type CommentParser

type CommentParser struct {
	// contains filtered or unexported fields
}

CommentParser handles parsing of requirements.txt comments

func (*CommentParser) IsDirect

func (p *CommentParser) IsDirect() bool

func (*CommentParser) ParseComment

func (p *CommentParser) ParseComment(line string) *Comment

ParseComment parses a single comment line and returns the parsed comment

type CommentType

type CommentType int

CommentType represents the type of dependency comment

const (
	// CommentTypeNone represents a comment that doesn't have any special meaning,
	// and signifies we're parsing a multiline comment.
	CommentTypeNone CommentType = iota

	// CommentTypeIndirect represents a comment that signifies a package is an
	// indirect dependency.
	CommentTypeIndirect

	// CommentTypeDirect represents a comment that signifies a package is a direct
	// dependency.
	CommentTypeDirect
)

type PdmLockExtractor

type PdmLockExtractor struct{}

func (PdmLockExtractor) Extract

func (PdmLockExtractor) IsOfficiallySupported

func (p PdmLockExtractor) IsOfficiallySupported() bool

func (PdmLockExtractor) PackageManager

func (p PdmLockExtractor) PackageManager() models.PackageManager

func (PdmLockExtractor) ShouldExtract

func (p PdmLockExtractor) ShouldExtract(path string) bool

type PdmLockFile

type PdmLockFile struct {
	Version  string           `toml:"lock-version"`
	Packages []PdmLockPackage `toml:"package"`
}

type PdmLockPackage

type PdmLockPackage struct {
	Name     string   `toml:"name"`
	Version  string   `toml:"version"`
	Groups   []string `toml:"groups"`
	Revision string   `toml:"revision"`
}

type PipenvLock

type PipenvLock struct {
	Packages    map[string]PipenvPackage `json:"default"`
	PackagesDev map[string]PipenvPackage `json:"develop"`
}

type PipenvLockExtractor

type PipenvLockExtractor struct {
	lockfile.WithMatcher
}

func (PipenvLockExtractor) Extract

func (PipenvLockExtractor) IsOfficiallySupported

func (e PipenvLockExtractor) IsOfficiallySupported() bool

func (PipenvLockExtractor) PackageManager

func (e PipenvLockExtractor) PackageManager() models.PackageManager

func (PipenvLockExtractor) ShouldExtract

func (e PipenvLockExtractor) ShouldExtract(path string) bool

type PipenvPackage

type PipenvPackage struct {
	Version string `json:"version"`
}

type PipfileMatcher

type PipfileMatcher struct{}

func (PipfileMatcher) GetSourceFile

func (m PipfileMatcher) GetSourceFile(lockfile lockfile.DepFile) (lockfile.DepFile, error)

func (PipfileMatcher) Match

func (m PipfileMatcher) Match(sourceFile lockfile.DepFile, packages []lockfile.PackageDetails, context lockfile.ScanContext) error

type PoetryLockExtractor

type PoetryLockExtractor struct {
	lockfile.WithMatcher
}

func (PoetryLockExtractor) Extract

func (PoetryLockExtractor) IsOfficiallySupported

func (e PoetryLockExtractor) IsOfficiallySupported() bool

func (PoetryLockExtractor) PackageManager

func (e PoetryLockExtractor) PackageManager() models.PackageManager

func (PoetryLockExtractor) ShouldExtract

func (e PoetryLockExtractor) ShouldExtract(path string) bool

type PoetryLockFile

type PoetryLockFile struct {
	Version  int                  `toml:"version"`
	Packages []*PoetryLockPackage `toml:"package"`
}

type PoetryLockPackage

type PoetryLockPackage struct {
	Name     string                  `toml:"name"`
	Version  string                  `toml:"version"`
	Optional bool                    `toml:"optional"`
	Source   PoetryLockPackageSource `toml:"source"`
}

type PoetryLockPackageSource

type PoetryLockPackageSource struct {
	Type   string `toml:"type"`
	Commit string `toml:"resolved_reference"`
}

type PyprojectTOMLMatcher

type PyprojectTOMLMatcher struct{}

func (PyprojectTOMLMatcher) GetSourceFile

func (m PyprojectTOMLMatcher) GetSourceFile(lockfile lockfile.DepFile) (lockfile.DepFile, error)

func (PyprojectTOMLMatcher) Match

func (m PyprojectTOMLMatcher) Match(sourceFile lockfile.DepFile, packages []lockfile.PackageDetails, context lockfile.ScanContext) error

type RequirementsTxtExtractor

type RequirementsTxtExtractor struct{}

func (RequirementsTxtExtractor) Extract

func (RequirementsTxtExtractor) IsOfficiallySupported

func (e RequirementsTxtExtractor) IsOfficiallySupported() bool

func (RequirementsTxtExtractor) PackageManager

func (e RequirementsTxtExtractor) PackageManager() models.PackageManager

func (RequirementsTxtExtractor) ShouldExtract

func (e RequirementsTxtExtractor) ShouldExtract(path string) bool

type UvLockExtractor

type UvLockExtractor struct {
	lockfile.WithMatcher
}

func (UvLockExtractor) Extract

func (UvLockExtractor) IsOfficiallySupported

func (e UvLockExtractor) IsOfficiallySupported() bool

func (UvLockExtractor) PackageManager

func (e UvLockExtractor) PackageManager() models.PackageManager

func (UvLockExtractor) ShouldExtract

func (e UvLockExtractor) ShouldExtract(path string) bool

type UvLockFile

type UvLockFile struct {
	Version  int               `toml:"version"`
	Packages []*UvLockPackage  `toml:"package"`
	Metadata uvPackageMetadata `toml:"package.metadata"`
}

type UvLockPackage

type UvLockPackage struct {
	Name            string                    `toml:"name"`
	Version         string                    `toml:"version"`
	Source          UvLockPackageSource       `toml:"source"`
	Dependencies    []uvDependency            `toml:"dependencies"`
	DevDependencies map[string][]uvDependency `toml:"dev-dependencies"`
}

type UvLockPackageSource

type UvLockPackageSource struct {
	Registry string `toml:"registry,omitempty"`
	Git      string `toml:"git,omitempty"`
	Virtual  string `toml:"virtual,omitempty"`
	Editable string `toml:"editable,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL