functions
Generators for version parts.
Classes¶
CalVerFunction
¶
CalVerFunction(calver_format: str)
Bases: PartFunction
This is a class that provides a CalVer function for version parts.
IndependentFunction
¶
IndependentFunction(value: Union[str, int, None] = None)
Bases: PartFunction
This is a class that provides an independent function for version parts.
It simply returns the optional value, which is equal to the first value.
NumericFunction
¶
NumericFunction(
optional_value: Union[str, int, None] = None,
first_value: Union[str, int, None] = None,
)
Bases: PartFunction
This is a class that provides a numeric function for version parts.
It simply starts with the provided first_value (0 by default) and increases it following the sequence of integer numbers.
The optional value of this function is equal to the first value.
This function also supports alphanumeric parts, altering just the numeric part (e.g. ‘r3’ –> ‘r4’). Only the first numeric group found in the part is considered (e.g. ‘r3-001’ –> ‘r4-001’).
PartFunction
¶
ValuesFunction
¶
ValuesFunction(
values: List[str],
optional_value: Optional[str] = None,
first_value: Optional[str] = None,
)
Bases: PartFunction
This is a class that provides a values list based function for version parts.
It is initialized with a list of values and iterates through them when bumping the part.
The default optional value of this function is equal to the first value, but may be otherwise specified.
When trying to bump a part which has already the maximum value in the list you get a ValueError exception.