version_config
Module for managing Versions and their internal parts.
Classes¶
VersionConfig
¶
VersionConfig(parse: str, serialize: Tuple[str], search: str, replace: str, part_configs: Optional[Dict[str, VersionComponentSpec]] = None)
Hold a complete representation of a version string.
Attributes¶
order
property
¶
order: List[str]
Methods:¶
parse
¶
parse(version_string: Optional[str] = None, raise_error: bool = False) -> Optional[Version]
Parse a version string into a Version object.
| PARAMETER | DESCRIPTION |
|---|---|
version_string
|
Version string to parse |
raise_error
|
Raise an exception if a version string is invalid
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Optional[Version]
|
A Version object representing the string. |
| RAISES | DESCRIPTION |
|---|---|
BumpVersionError
|
If a version string is invalid and raise_error is True. |
serialize
¶
serialize(version: Version, context: MutableMapping) -> str
Serialize a version to a string.
| PARAMETER | DESCRIPTION |
|---|---|
version
|
The version to serialize
TYPE:
|
context
|
The context to use when serializing the version
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The serialized version as a string |