absfuyu.version module
Absfuyu: Version
Package versioning module
Version: 5.1.0 Date updated: 10/03/2025 (dd/mm/yyyy)
- class absfuyu.version.ReleaseOption(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
MAJOR
,MINOR
,PATCH
- MAJOR = 'major'
- MINOR = 'minor'
- PATCH = 'patch'
- class absfuyu.version.ReleaseLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
FINAL
,DEV
,RC
- FINAL = 'final'
- DEV = 'dev'
- RC = 'rc'
- class absfuyu.version.Version(major: int | str, minor: int | str, patch: int | str, release_level: str = ReleaseLevel.FINAL, serial: int | str = 0)[source]
Bases:
BaseClass
- property version: str
Return version string
Example:
>>> test = Version(1, 0, 0) >>> test.version 1.0.0 >>> str(test) # test.__str__() 1.0.0
>>> test_serial = Version(1, 0, 0, "dev", 1) >>> test_serial.version 1.0.0.dev1
- classmethod from_tuple(iterable: tuple[int, int, int] | tuple[int, int, int, str, int]) Self [source]
Convert to
Version
from atuple
- Parameters:
iterable (tuple[int, int, int] | tuple[int, int, int, str, int]) – Version tuple in correct format
- Returns:
Version
- Return type:
- Raises:
ValueError – Wrong tuple format
Example:
>>> test = Version.from_tuple((1, 0, 0)) >>> test.version 1.0.0
- classmethod from_str(version_string: str) Self [source]
Convert to
Version
from astr
- Parameters:
version_string (str) –
Version str in correct format<major>.<minor>.<patch>
<major>.<minor>.<patch>.<release level><serial>
- Returns:
Version
- Return type:
- Raises:
ValueError – Wrong version_string format
Example:
>>> test = Version.from_str("1.0.0") >>> test.version 1.0.0
- class absfuyu.version.Bumper(major: int | str, minor: int | str, patch: int | str, release_level: str = ReleaseLevel.FINAL, serial: int | str = 0)[source]
Bases:
Version
Version bumper
- bump(*, option: str = ReleaseOption.PATCH, channel: str = ReleaseLevel.FINAL) None [source]
Bump current version (internally)
- Parameters:
option (str) – Release option (Default:
"patch"
)channel (str) – Release channel (Default:
"final"
)
Example:
>>> test = Bumper(1, 0, 0) >>> test.version 1.0.0 >>> test.bump() >>> test.version 1.0.1