semantic_release.version.version module#
- class semantic_release.version.version.Version(major: int, minor: int, patch: int, *, prerelease_token: str = 'rc', prerelease_revision: int | None = None, build_metadata: str = '', tag_format: str = 'v{version}')[source]#
Bases:
object
- bump(level: LevelBump) Version [source]#
Return a new Version instance according to the level specified to bump. Note this will intentionally drop the build metadata - that should be added elsewhere for the specific build producing this version.
- property is_prerelease: bool#
- classmethod parse(version_str: str, tag_format: str = 'v{version}', prerelease_token: str = 'rc') Version [source]#
Parse version string to a Version instance. Inspired by semver.version:VersionInfo.parse, this implementation doesn’t allow optional minor and patch versions.
- Parameters:
prerelease_token – will be ignored if the version string is a prerelease, the parsed token from version_str will be used instead.
- property tag_format: str#