repo_helper.release

Functions for making tagged releases.

New in version 2020.12.29.

Classes:

Bumper(repo_path[, force])

Class to bump the repository version.

BumpversionFileConfig

Represents the subset of bumpversion per-file configuration values used by repo-helper.

class Bumper(repo_path, force=False)[source]

Bases: object

Class to bump the repository version.

Parameters
  • repo_path (PathPlus)

  • force (bool) – Whether to force bumping the version when the repository is unclean. Default False.

Methods:

bump(new_version, commit, message)

Bump to the given version.

bump_version_for_file(filename, config)

Bumps the version for the given file.

get_bumpversion_config(current_version, …)

Returns the bumpversion config.

get_current_version()

Returns the current version from the repo_helper.yml configuration file.

major(commit, message)

Bump to the next major version.

minor(commit, message)

Bump to the next minor version.

patch(commit, message)

Bump to the next patch version.

today(commit, message)

Bump to the calver version for today’s date.

Attributes:

bumpversion_file

The path to the bumpversion configuration file.

current_version

repo

bump(new_version, commit, message)[source]

Bump to the given version.

Parameters

Changed in version 2021.8.11: Now takes a packaging.version.Version rather than a domdf_python_tools.versions.Version.

bump_version_for_file(filename, config)[source]

Bumps the version for the given file.

Parameters
bumpversion_file

The path to the bumpversion configuration file.

current_version
get_bumpversion_config(current_version, new_version)[source]

Returns the bumpversion config.

Parameters
  • current_version (str)

  • new_version (str)

Return type

Dict[str, BumpversionFileConfig]

get_current_version()[source]

Returns the current version from the repo_helper.yml configuration file.

Return type

Version

major(commit, message)[source]

Bump to the next major version.

Parameters
  • commit (Optional[bool]) – Whether to commit automatically (True) or ask first (None).

  • message (str) – The commit message.

minor(commit, message)[source]

Bump to the next minor version.

Parameters
  • commit (Optional[bool]) – Whether to commit automatically (True) or ask first (None).

  • message (str) – The commit message.

patch(commit, message)[source]

Bump to the next patch version.

Parameters
  • commit (Optional[bool]) – Whether to commit automatically (True) or ask first (None).

  • message (str) – The commit message.

repo
today(commit, message)[source]

Bump to the calver version for today’s date.

E.g. 2020.12.25 for 25th December 2020

Parameters
  • commit (Optional[bool]) – Whether to commit automatically (True) or ask first (None).

  • message (str) – The commit message.

typeddict BumpversionFileConfig[source]

Bases: TypedDict

Represents the subset of bumpversion per-file configuration values used by repo-helper.

Required Keys