bumpversion.show
Functions for displaying information about the version.
output_default
python
def output_default(value: dict) -> NoneOutput the value with key=value or just value if there is only one item.
output_yaml
python
def output_yaml(value: dict) -> NoneOutput the value as yaml.
output_json
python
def output_json(value: dict) -> NoneOutput 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) -> AnyGet 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 accessname: A dotted name to the value, such asmykey.0.namedefault: If the name cannot be resolved from the object, return this valueerr_on_missing: Raise aBadInputErrorif the name cannot be resolved
Returns
- The value at the resolved name or the default value.
Raises
BadInputError: If we cannot resolve the name anderr_on_missingisTrueAttributeError: If a @property decorator raised itTypeError: 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) -> NoneShow current version or configuration information.