uv

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LockFileName            = "uv.lock"
	RequirementsTxtFileName = "requirements.txt"
	PyprojectTomlFileName   = "pyproject.toml"
	WorkspacePathProperty   = "uv:workspace:path"
	IsProjectRootProperty   = "uv:package:is_project_root"
)
View Source
const PluginName = "uv"

Variables

View Source
var ExcludedUVLockFileDirs = map[string]bool{
	"node_modules": true,
	".build":       true,
}

ExcludedUVLockFileDirs is a list of directories that are excluded from the uv.lock file search.

Functions

func HasUvLockFile added in v1.22.0

func HasUvLockFile(dir, targetFile string, searchDeep bool, logger *zerolog.Logger) bool

HasUvLockFile checks if the specified directory contains a uv.lock file or the target file if provided. If searchDeep is true, the function will check if the directory contains a uv.lock file recursively. Otherwise, it will only check if the directory contains a uv.lock file.

func HasUvLockFileInAnyDir added in v1.22.0

func HasUvLockFileInAnyDir(inputDirs []string, targetFile string, allProjects bool, logger *zerolog.Logger) bool

HasUvLockFileInAnyDir checks if any of the input directories contains a uv.lock file.

Types

type Client added in v0.32.3

type Client interface {
	ExportSBOM(inputDir string, opts *scaecosystems.SCAPluginOptions) (Sbom, error)
}

func NewClient added in v0.32.3

func NewClient() Client

func NewClientWithExecutor added in v0.32.3

func NewClientWithExecutor(uvBinary string, executor cmdExecutor) Client

NewClientWithExecutor creates a new uv client with a custom executor for testing.

func NewClientWithPath added in v0.32.3

func NewClientWithPath(uvBinary string) Client

type MockClient added in v0.32.3

type MockClient struct {
	CalledDirs []string
	ReturnErr  error
	ErrorDirs  map[string]error
}

func (*MockClient) ExportSBOM added in v0.32.3

func (m *MockClient) ExportSBOM(inputDir string, _ *ecosystems.SCAPluginOptions) (Sbom, error)

type Plugin

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

func NewPlugin added in v0.32.3

func NewPlugin(client Client, converter conversion.SBOMConverter, remoteRepoURL string) Plugin

func (Plugin) BuildDepGraphsFromDir

func (p Plugin) BuildDepGraphsFromDir(
	ctx context.Context,
	log logger.Logger,
	inputDir string,
	options *scaecosystems.SCAPluginOptions,
) (*scaecosystems.PluginResult, error)

func (Plugin) GetName added in v1.8.0

func (p Plugin) GetName() string

type Sbom added in v0.32.3

type Sbom []byte

type Version added in v0.32.3

type Version = [3]int

type WorkspacePackage added in v0.32.3

type WorkspacePackage struct {
	Name    string
	Version string
	Path    string // Relative path to the workspace package directory
}

Jump to

Keyboard shortcuts

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