pythonwrench.semver module¶
- class pythonwrench.semver.Version(version: Self, /)[source]¶
- class pythonwrench.semver.Version(version_str: str, /)
- class pythonwrench.semver.Version(version_dict: Mapping[str, int | str | None | list[str | int]], /)
- class pythonwrench.semver.Version(version_tuple: tuple[int | str | None | list[str | int], ...], /)
-
class pythonwrench.semver.Version(major: int, minor: int, patch: int, prerelease: int | str | None | list[str | int] =
None, buildmetadata: int | str | None | list[str | int] =None) Bases:
objectVersion utility class following Semantic Versioning (SemVer) spec.
Version format is: MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA]
Based on https://semver.org/ version 2.0.0.
-
equals(other: Version | str | Mapping[str, int | str | None | list[str | int]] | tuple[int | str | None | list[str | int], ...], *, ignore_buildmetadata: bool =
False) bool[source]¶
- classmethod from_str(version_str: str) Self[source]¶
-
next_major(keep_prerelease: bool =
False, keep_buildmetadata: bool =False) Version[source]¶
-
next_minor(keep_prerelease: bool =
False, keep_buildmetadata: bool =False) Version[source]¶
-
next_patch(keep_prerelease: bool =
False, keep_buildmetadata: bool =False) Version[source]¶
-
classmethod python(releaselevel_in_metadata: bool =
False) Self[source]¶ Create an instance of Version with Python version.
Note: Python ‘micro’ value is mapped to ‘patch’.
-
to_dict(exclude_none: bool =
True) VersionDict[source]¶
-
equals(other: Version | str | Mapping[str, int | str | None | list[str | int]] | tuple[int | str | None | list[str | int], ...], *, ignore_buildmetadata: bool =