Documentation
¶
Overview ¶
Package python implements a SystemDecomposer that reads the Python distributions installed on a filesystem: the *.dist-info directories in its site-packages, wherever they live — system interpreters, virtualenvs, pip --target trees. This is how a container image says what Python software it holds, and it works with no lockfile, no network and no Python interpreter.
Unlike the OS package decomposers, which emit a flat inventory, the result is a graph: installed metadata declares dependencies, and a declaration whose target is installed is an edge.
Index ¶
- type Decomposer
- func (d *Decomposer) DefaultOptions() any
- func (d *Decomposer) Extract(opts *api.DecomposerOptions) (*sbom.NodeList, error)
- func (d *Decomposer) ExtractFromFS(source fs.FS, opts *api.DecomposerOptions) (*sbom.NodeList, error)
- func (d *Decomposer) Requirements(_ *api.DecomposerOptions) []api.Requirement
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decomposer ¶
type Decomposer struct{}
Decomposer reads installed Python distributions from a system filesystem.
func (*Decomposer) DefaultOptions ¶
func (d *Decomposer) DefaultOptions() any
DefaultOptions returns the driver-level options used when none are set.
func (*Decomposer) Extract ¶
func (d *Decomposer) Extract(opts *api.DecomposerOptions) (*sbom.NodeList, error)
Extract opens opts.WorkDir as the system root and runs the FS-aware extractor against it, mirroring the other system decomposers.
func (*Decomposer) ExtractFromFS ¶
func (d *Decomposer) ExtractFromFS(source fs.FS, opts *api.DecomposerOptions) (*sbom.NodeList, error)
ExtractFromFS reads every installed distribution on the filesystem and returns their graph. Returns (nil, nil) when the filesystem holds no Python at all, which is not an error.
func (*Decomposer) Requirements ¶
func (d *Decomposer) Requirements(_ *api.DecomposerOptions) []api.Requirement
Requirements returns nothing: reading dist-info is pure Go.