funcresolve_dependencies#

resolve_dependencies(
platform: Platform,
releases: Iterable[Release],
*,
game_version: str,
loader: str,
include_optional: bool = False,
release_only: bool = True,
installed: Iterable[Release | FileRef] = (),
cancel: CancelToken | None = None,
) → Resolution#

Work out which releases to install so that dependencies are met.

A dependency on an exact release uses that release, and any other uses the project’s newest compatible release. With release_only, a project that has only alpha and beta releases still gets its newest one, because the release that needs it cannot work without it. Each project gets one release, and the first choice stands: a later request for another version is a conflict, not a new search. For the Quilt loader, Fabric releases are used when a project has no Quilt release.

Problems are returned rather than raised, so a tool can show them all at once.

Parameters:
  • platform (Platform) – The platform that the releases are from.

  • releases (Iterable[Release]) – The releases to install. They take priority over installed. If two belong to one project, the first is used.

  • game_version (str) – The Minecraft version.

  • loader (str) – The mod loader.

  • include_optional (bool) – Also install optional dependencies.

  • release_only (bool) – Leave out alpha and beta releases when choosing a version, unless a dependency has nothing else.

  • installed (Iterable[Release | FileRef]) – What is already in place, such as the results of Platform.identify or the FileRef of a pack’s entries. These meet dependencies without being installed. References to other platforms are ignored.

  • cancel (CancelToken | None) – Stops the search.

Returns:

What to install and what could not be met.

Raises:
Return type:

Resolution