consolekit.versions

Tool to get software versions.

New in version 1.6.0.

Functions:

get_formatted_versions([dependencies, …])

Return the versions of software dependencies, one per line.

get_version_callback(tool_version, tool_name)

Creates a callback for version_option.

get_formatted_versions(dependencies=(), show_python=True, show_platform=True)[source]

Return the versions of software dependencies, one per line.

Parameters
  • dependencies (Union[Iterable[str], Mapping[str, str]]) – Either a list of dependency names, or a mapping of dependency name to a more human-readable form. Default ().

  • show_python (bool) – Default True.

  • show_platform (bool) – Default True.

Return type

StringList

get_version_callback(tool_version, tool_name, dependencies=())[source]

Creates a callback for version_option.

With each --version argument the callback displays the package version, then adds the python version, and finally adds dependency versions.

Parameters
  • tool_version (str) – The version of the tool to show the version of.

  • tool_name (str) – The name of the tool to show the version of.

  • dependencies (Union[Iterable[str], Mapping[str, str]]) – Either a list of dependency names, or a mapping of dependency name to a more human-readable form. Default ().

Return type

Callable[[Context, Option, int], Any]