bridge.pipelines.shared.version module#
Shared version parsing and comparison utilities for pipelines.
- class bridge.pipelines.shared.version.ParsedVersion(kind, value, raw)[source]#
Bases:
objectParsed version representation.
- Parameters:
kind (VersionKind) – The kind of version parsed (SEMVER, DATE, INT, RANGE, RAW).
value (Any) – The parsed value: - SEMVER: packaging.version.Version - DATE : datetime.date - INT : int - RANGE : (ParsedVersion, ParsedVersion) # [low, high] - RAW : str
raw (str) – The original version string.
-
kind:
VersionKind= <dataclasses._MISSING_TYPE object>#
-
raw:
str= <dataclasses._MISSING_TYPE object>#
-
value:
Any= <dataclasses._MISSING_TYPE object>#
- class bridge.pipelines.shared.version.VersionKind(*values)[source]#
Bases:
EnumEnumeration of version kinds.
Used to classify free-text version strings into comparable groups: semantic versions, dates, integers, numeric ranges, and raw labels.
- bridge.pipelines.shared.version.any_bt_newer_than_gh(gh_latest, bt_versions)[source]#
Check whether any bio.tools version appears newer than the GitHub latest.
Versions are parsed into
ParsedVersionobjects and compared using their defined partial ordering. Incomparable versions (e.g. raw or differing kinds) are ignored.- Parameters:
gh_latest (BiotoolsVersionType) – GitHub latest release tag.
bt_versions (list[BiotoolsVersionType]) – Existing bio.tools versions.
- Returns:
Trueif any bio.tools version is strictly newer than the GitHub latest version under the comparison rules, otherwiseFalse.- Return type:
bool
- bridge.pipelines.shared.version.find_latest_bt_version(bt_versions)[source]#
Find the latest bio.tools version from a list of versions.
Versions are parsed into
ParsedVersionobjects and compared using their defined partial ordering. Incomparable versions (e.g. raw or differing kinds) are ignored.- Parameters:
bt_versions (list[BiotoolsVersionType] | None) – Existing bio.tools versions, or
None.- Returns:
The latest bio.tools version, or
Noneif no comparable versions were found.- Return type:
BiotoolsVersionType | None