bridge.pipelines.bt2gh_for_pr_issues.map_funcs.license module

Contents

bridge.pipelines.bt2gh_for_pr_issues.map_funcs.license module#

Map license metadata from bio.tools to GitHub.

This module compares the license recorded in bio.tools with the license detected on a GitHub repository and, when appropriate, proposes a pull request that adds a full LICENSE file based on the SPDX canonical text. It applies a bio.tools-over-GitHub policy.

async bridge.pipelines.bt2gh_for_pr_issues.map_funcs.license.map_license(gh_license, bt_license)[source]#

Propose a GitHub pull request to add a LICENSE file based on bio.tools license metadata, using the generic bio.tools-over-GitHub policy.

The GitHub license (when present) is normalized via its SPDX identifier and compared against the bio.tools license enum. If bio.tools provides a license, the full canonical license text is fetched from the SPDX service and proposed as a new LICENSE.txt file. If GitHub already declares a different license, that value is treated as authoritative, a conflict is logged, but the pull request is still proposed.

Parameters:
  • gh_license (GHLicense | None) – License metadata detected on the GitHub repository, or None if no license is declared.

  • bt_license (BTLicense | None) – License value from the bio.tools entry, represented as a bio.tools license enum, or None if not available.

Returns:

A dictionary with the filename LICENSE.txt as key and the full license text as value, or None if no pull request should be created under the policy.

Return type:

dict[str, str] | None