Skip to content

bumpversion.config.utils ​

Helper functions for the config module.

REPO_ROOT_TOKEN ​

python
REPO_ROOT_TOKEN = '{' + 'repo_root}'

logger ​

python
logger = get_indented_logger(__name__)

get_all_file_configs ​

python
def get_all_file_configs(config_dict: dict) -> List[FileChange]

Make sure all version components are included.

resolve_file_paths ​

python
def resolve_file_paths(files: List[FileChange], config_file: Optional[Pathlike]) -> None

Resolve filename and glob of each file configuration in place.

{repo_root} expands to the repository root. Other relative paths are resolved from the configuration file's directory; absolute paths are used as-is.

Parameters

  • files: The file configurations to update in place.
  • config_file: The configuration file the files were read from, if any.

Raises

  • ConfigurationError: If {repo_root} is used outside a git or mercurial repository.

get_all_part_configs ​

python
def get_all_part_configs(config_dict: dict) -> Dict[str, VersionComponentSpec]

Make sure all version components are included.

resolve_glob_files ​

python
def resolve_glob_files(file_cfg: FileChange, ignore_missing: bool = False) -> List[FileChange]

Return a list of file configurations that match the glob pattern.

Parameters

  • file_cfg: The file configuration containing the glob pattern
  • ignore_missing: Don't raise if the pattern matches no files, regardless of ignore_missing_file

Returns

  • A list of resolved file configurations according to the pattern.

Raises

  • FileNotFoundError: If no files match the pattern and neither ignore_missing_file nor ignore_missing is set.