rez.resolver#

class rez.resolver.ResolverStatus#

Bases: Enum

Enum to represent the current state of a resolver instance. The enum also includes a human readable description of what the state represents.

pending = ('The resolve has not yet started.',)#
solved = ('The resolve has completed successfully.',)#
failed = ('The resolve is not possible.',)#
aborted = ('The resolve was stopped by the user (via callback).',)#
class rez.resolver.Resolver#

Bases: object

The package resolver.

The Resolver uses a combination of Solver(s) and cache(s) to resolve a package request as quickly as possible.

__init__(context, package_requests, package_paths, package_filter=None, package_orderers=None, timestamp=0, callback=None, building=False, verbosity=False, buf=None, package_load_callback=None, caching=True, suppress_passive=False, print_stats=False)#

Create a Resolver.

Parameters:
  • package_requests – List of Requirement objects representing the request.

  • package_paths – List of paths to search for pkgs.

  • package_filter (PackageFilterList) – Package filter.

  • package_orderers (list of PackageOrder) – Custom package ordering.

  • callback – See Solver.

  • package_load_callback – If not None, this callable will be called prior to each package being loaded. It is passed a single Package object.

  • building – True if we’re resolving for a build.

  • caching – If True, cache(s) may be used to speed the resolve. If False, caches will not be used.

  • print_stats (bool) – If true, print advanced solver stats at the end.

solve()#

Perform the solve.

property status#

Return the current status of the resolve.

Returns:

ResolverStatus.

property resolved_packages#

Get the list of resolved packages.

Returns:

List of PackageVariant objects, or None if the resolve has not completed.

property resolved_ephemerals#

Get the list of resolved ewphemerals.

Returns:

List of Requirement objects, or None if the resolve has not completed.

property graph#

Return the resolve graph.

The resolve graph shows unsuccessful as well as successful resolves.

Returns:

A pygraph.digraph object, or None if the solve has not completed.