Skip to content

bump

Version changing methods.

Classes

Functions:

commit_and_tag

commit_and_tag(config: Config, config_file: Optional[Path], configured_files: List[ConfiguredFile], ctx: MutableMapping, dry_run: bool = False) -> None

Commit and tag the changes if a tool is configured.

PARAMETER DESCRIPTION
config

The configuration

TYPE: Config

config_file

The configuration file to include in the commit if it exists

TYPE: Optional[Path]

configured_files

A list of files to commit

TYPE: List[ConfiguredFile]

ctx

The context used to render the tag and tag message

TYPE: MutableMapping

dry_run

True if the operation should be a dry run

TYPE: bool DEFAULT: False

do_bump

do_bump(version_part: Optional[str], new_version: Optional[str], config: Config, config_file: Optional[Path] = None, dry_run: bool = False) -> None

Bump the version_part to the next value or set the version to new_version.

PARAMETER DESCRIPTION
version_part

The name of the version component to bump

TYPE: Optional[str]

new_version

The explicit version to set

TYPE: Optional[str]

config

The configuration to use

TYPE: Config

config_file

The configuration file to update

TYPE: Optional[Path] DEFAULT: None

dry_run

True if the operation should be a dry run

TYPE: bool DEFAULT: False

get_next_version

get_next_version(current_version: Version, config: Config, version_part: Optional[str], new_version: Optional[str]) -> Version

Bump the version_part to the next value.

PARAMETER DESCRIPTION
current_version

The current version

TYPE: Version

config

The current configuration

TYPE: Config

version_part

Optional part of the version to bump

TYPE: Optional[str]

new_version

Optional specific version to bump to

TYPE: Optional[str]

RETURNS DESCRIPTION
Version

The new version

RAISES DESCRIPTION
ConfigurationError

If it can’t generate the next version.