Skip to content

models

Bump My Version configuration models.

Classes

Config

Bases: BaseSettings

Bump Version configuration.

Attributes

files_to_modify property
files_to_modify: List[FileChange]

Return a list of files to modify.

resolved_filemap property
resolved_filemap: Dict[str, List[FileChange]]

Return the cached resolved filemap.

version_config property
version_config: 'VersionConfig'

Return the version configuration.

Functions

add_files
add_files(filename: Union[str, List[str]]) -> None

Add a filename to the list of files.

version_spec
version_spec(
    version: Optional[str] = None,
) -> "VersionSpec"

Return the version specification.

FileChange

Bases: BaseModel

A change to make to a file.

Functions

__hash__
__hash__()

Return a hash of the model.

get_search_pattern
get_search_pattern(
    context: MutableMapping,
) -> Tuple[re.Pattern, str]

Render the search pattern and return the compiled regex pattern and the raw pattern.

Parameters:

context

The context to use for rendering the search pattern

TYPE: MutableMapping

Returns:

Tuple[Pattern, str]

A tuple of the compiled regex pattern and the raw pattern as a string.

Functions