Documentation
¶
Overview ¶
Package resolve chooses a consistent set of package versions for a set of requirements. It is a version-solving resolver in the PubGrub style: it reasons over incompatibilities (sets of package terms that cannot all hold), propagates their consequences as units, and on a conflict derives a new incompatibility and backjumps. Because the universe of versions for a package is finite, constraints are represented as finite version sets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Verify ¶
func Verify(ctx context.Context, source pypi.Source, env requirement.Environment, roots []*requirement.Requirement, sol *Solution) error
Verify checks that a solution actually satisfies the requirements: every applicable root and every applicable dependency of every resolved package is present at a version that meets its constraint. It returns an error describing the first violation, or nil when the solution is valid.
Types ¶
type Option ¶
type Option func(*Resolver)
Option configures a Resolver.
func WithEnvironment ¶
func WithEnvironment(env requirement.Environment) Option
WithEnvironment sets the marker environment used to evaluate dependency markers. The target Python version should be present for requires-python checks.
func WithPythonVersion ¶
WithPythonVersion sets the target Python version for requires-python filtering.
type ResolutionError ¶
type ResolutionError struct {
Cause *incompatibility
}
ResolutionError reports that no set of versions satisfies the requirements.
func (*ResolutionError) Error ¶
func (e *ResolutionError) Error() string
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver holds resolution state for one run.
func (*Resolver) Resolve ¶
func (r *Resolver) Resolve(ctx context.Context, roots []*requirement.Requirement) (*Solution, error)
Resolve finds versions for the given root requirements.
type Solution ¶
type Solution struct {
Packages map[string]*version.Version
Roots []string
Edges map[string][]string
}
Solution is the result of resolution: the chosen version of each package, the canonical names required directly by the project, and the dependency edges between resolved packages. Edges and Roots drive the lockfile and the explain tree.