devops.git.tag
Module for Git tag-related constants and functions.
Functions
|
Get all Git tags in the repository. |
|
Get the latest Git tag in the repository. |
Classes
|
Class representing a Git tag. |
Exceptions
|
Exception raised for Git tag-related errors in devops checks. |
- exception devops.git.tag.GitTagError(message)[source]
Bases:
ExceptionException raised for Git tag-related errors in devops checks.
- Parameters:
message (str)
- Return type:
None
- class devops.git.tag.GitTag(major, minor, patch, prefix)[source]
Bases:
objectClass representing a Git tag.
- increase_major()[source]
Increase the major version by 1 and reset minor and patch to 0.
- Returns:
GitTag – A new GitTag instance with the increased major version.
- Return type:
- increase_minor()[source]
Increase the minor version by 1 and reset patch to 0.
- Returns:
GitTag – A new GitTag instance with the increased minor version.
- Return type:
- increase_patch()[source]
Increase the patch version by 1.
- Returns:
GitTag – A new GitTag instance with the increased patch version.
- Return type:
- static from_string(tag, config=GitConfig(tag_prefix='', empty_tag_list_allowed=True))[source]
Create a GitTag instance from a string.
- Parameters:
- Returns:
GitTag – The GitTag instance created from the string.
- Raises:
GitTagError – If the tag string does not start with the expected prefix. If the tag string is not in the correct format.
- Return type:
- devops.git.tag.get_all_tags(config=GitConfig(tag_prefix='', empty_tag_list_allowed=True))[source]
Get all Git tags in the repository.
- Parameters:
config (GitConfig) – The Git configuration containing the expected prefix and empty tag list allowance.
- Returns:
list[GitTag] – A list of all Git tags.
- Raises:
GitTagError – If there is an error retrieving the Git tags and empty_tag_list_allowed is False.
- Return type: