Skip to content

show

Functions for displaying information about the version.

Classes

Functions:

do_show

do_show(*args, config: Config, format_: str = 'default', increment: Optional[str] = None, current_version: Optional[str] = None) -> None

Show current version or configuration information.

output_default

output_default(value: dict) -> None

Output the value with key=value or just value if there is only one item.

output_json

output_json(value: dict) -> None

Output the value as json.

output_yaml

output_yaml(value: dict) -> None

Output the value as yaml.

resolve_name

resolve_name(obj: Any, name: str, default: Any = None, err_on_missing: bool = False) -> Any

Get a key or attr name from obj or default value.

Copied and modified from Django Template variable resolutions

Resolution methods:

  • Mapping key lookup
  • Attribute lookup
  • Sequence index
PARAMETER DESCRIPTION
obj

The object to access

TYPE: Any

name

A dotted name to the value, such as mykey.0.name

TYPE: str

default

If the name cannot be resolved from the object, return this value

TYPE: Any DEFAULT: None

err_on_missing

Raise a BadInputError if the name cannot be resolved

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Any

The value at the resolved name or the default value.

RAISES DESCRIPTION
BadInputError

If we cannot resolve the name and err_on_missing is True

AttributeError

If a @property decorator raised it

TypeError

If a @property decorator raised it

noqa: DAR401