bridge.pipelines.gh2bt_for_meta.map_funcs.version module

Contents

bridge.pipelines.gh2bt_for_meta.map_funcs.version module#

Mapping releases for version metadata.

This module reconciles GitHub release tags with bio.tools version metadata. It supports multiple common versioning styles (semantic versions, dates, integers, ranges, and raw labels) and provides a safe comparison mechanism to detect when existing bio.tools versions appear newer than the latest GitHub release.

bridge.pipelines.gh2bt_for_meta.map_funcs.version.map_version(gh_latest_version_tag, bt_versions)[source]#

Map and reconcile GitHub release metadata and bio.tools version metadata.

Ensures that the GitHub latest release tag is present in the bio.tools version list. If any existing bio.tools version appears newer than the GitHub latest (based on parsed version comparison), the bio.tools version list is reset to contain only the GitHub version.

Policy: 1. If GitHub provides no latest tag, existing bio.tools versions are preserved. 2. If bio.tools has no versions, the GitHub version is adopted. 3. If the GitHub version is already present, no change is made. 4. If a newer bio.tools version is detected, a conflict is logged and the

list is reset to the GitHub version only.

  1. Otherwise, the GitHub version is appended to the existing list.

Parameters:
  • gh_latest_version_tag (str | None) – Latest GitHub release tag, or None if unavailable.

  • bt_versions (list[VersionType] | None) – Existing bio.tools versions.

Returns:

Updated list of bio.tools versions after reconciliation.

Return type:

list[VersionType] | None