Skip to content

bumpversion.visualize ​

Visualize the bumpversion process.

BOX_CHARS ​

python
BOX_CHARS = {'ascii': ['+', '+', '+', '+', '+', '+', '+', '+', '-', '|', '+'], 'light': ['╯', '╮', '╭', '╰', '┤', '┴', '┬', '├', '─', '│', '┼']}

Border ​

python
class Border(corner_bottom_right: str, corner_top_right: str, corner_top_left: str, corner_bottom_left: str, divider_left: str, divider_up: str, divider_down: str, divider_right: str, line: str, pipe: str, cross: str)

A border definition.

lead_string ​

python
def lead_string(version_str: str, border: Border, blank: bool = False) -> str

Return the first part of a string with the bump character or spaces of the correct amount.

Examples

python
>>> lead_string("1.0.0", Border(*BOX_CHARS["light"]))
'1.0.0 ── bump ─'
>>> lead_string("1.0.0", Border(*BOX_CHARS["light"]), blank=True)
'               '

Parameters

  • version_str: The string to render as the starting point
  • border: The border definition to draw the lines
  • blank: If True, return a blank string the same length as the version bump string

Returns

  • The version bump string or a blank string

connection_str ​

python
def connection_str(border: Border, has_next: bool = False, has_previous: bool = False) -> str

Return the correct connection string based on the next and previous.

Parameters

  • border: The border definition to draw the lines
  • has_next: If True, there is a next line
  • has_previous: If True, there is a previous line

Returns

  • A string that connects left-to-right and top-to-bottom based on the next and previous

labeled_line ​

python
def labeled_line(label: str, border: Border, fit_length: Optional[int] = None) -> str

Return the version part string with the correct padding.

Parameters

  • label: The label to render
  • border: The border definition to draw the lines
  • fit_length: The length to fit the label to

Returns

  • A labeled line with leading and trailing spaces

filter_version_parts ​

python
def filter_version_parts(config: Config) -> List[str]

Return the version parts that are in the configuration.

Parameters

  • config: The configuration to check against

Returns

  • The version parts that are in the configuration

visualize ​

python
def visualize(config: Config, version_str: str, box_style: str = 'light') -> None

Output a visualization of the bump-my-version bump process.