Skip to content

bumpversion.show ​

Functions for displaying information about the version.

output_default ​

python
def output_default(value: dict) -> None

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

output_yaml ​

python
def output_yaml(value: dict) -> None

Output the value as yaml.

output_json ​

python
def output_json(value: dict) -> None

Output the value as json.

OUTPUTTERS ​

python
OUTPUTTERS = {'yaml': output_yaml, 'json': output_json, 'default': output_default}

resolve_name ​

python
def 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

Parameters

  • obj: The object to access
  • name: A dotted name to the value, such as mykey.0.name
  • default: If the name cannot be resolved from the object, return this value
  • err_on_missing: Raise a BadInputError if the name cannot be resolved

Returns

  • The value at the resolved name or the default value.

Raises

  • 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 ​

do_show ​

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

Show current version or configuration information.