Solvers

The conda solvers can be extended with additional backends with the conda_solvers plugin hook. Registered solvers will be available for configuration with the solver configuration and --solver command line option.

class CondaSolver(name: str, backend: type[Solver])

A conda solver.

Parameters
  • name -- Solver name (e.g., custom-solver).

  • backend -- Type that will be instantiated as the solver backend.

property backend

Alias for field number 1

property name

Alias for field number 0

conda_solvers(self) Iterable[CondaSolver]

Register solvers in conda.

Returns

An iterable of solvers entries.

Example:

from conda import plugins
from conda.core import solve


class VerboseSolver(solve.Solver):
    def solve_final_state(self, *args, **kwargs):
        log.info("My verbose solver!")
        return super().solve_final_state(*args, **kwargs)


@plugins.hookimpl
def conda_solvers():
    yield plugins.CondaSolver(
        name="verbose-classic",
        backend=VerboseSolver,
    )