Skip to content

bumpversion.bump ​

Version changing methods.

logger ​

python
logger = get_indented_logger(__name__)

get_next_version ​

python
def get_next_version(current_version: Version, config: Config, version_part: Optional[str], new_version: Optional[str], to_value: Optional[str] = None) -> Version

Bump the version_part to the next value.

Parameters

  • current_version: The current version
  • config: The current configuration
  • version_part: Optional part of the version to bump
  • new_version: Optional specific version to bump to
  • to_value: Optional specific value to set version_part to

Returns

  • The new version

Raises

  • ConfigurationError: If it can't generate the next version.

do_bump ​

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

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

Parameters

  • version_part: The name of the version component to bump
  • new_version: The explicit version to set
  • config: The configuration to use
  • config_file: The configuration file to update
  • dry_run: True if the operation should be a dry run
  • to_value: The explicit value to set version_part to instead of incrementing it

commit_and_tag ​

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

Parameters

  • config: The configuration
  • config_file: The configuration file to include in the commit if it exists
  • configured_files: A list of files to commit
  • ctx: The context used to render the tag and tag message
  • dry_run: True if the operation should be a dry run