def merge_pr_tags(repo_root: Text, max_count: int = 50) -> List[Text]:
gitfunc = git(repo_root)
tags: List[Text] = [] if gitfunc isNone: return tags for line in gitfunc("log", "--format=%D", "--max-count=%s" % max_count).split("\n"): for ref in line.split(", "): if ref.startswith("tag: merge_pr_"):
tags.append(ref[5:]) return tags
def score_name(name: Text) -> Optional[int]: """Score how much we like each filename, lower wins, None rejects"""
# Accept both ways of naming the manifest asset, even though # there's no longer a reason to include the commit sha. if name.startswith("MANIFEST-") or name.startswith("MANIFEST."): if zstandard and name.endswith("json.zst"): return 1 if name.endswith(".json.bz2"): return 2 if name.endswith(".json.gz"): return 3 returnNone
if resp.code != 200:
logger.warning("Fetching %s failed; got HTTP status %d" % (url, resp.code)) continue
try:
release = json.load(resp.fp) except ValueError:
logger.warning("Response was not valid JSON") returnNone
candidates = [] for item in release["assets"]:
score = score_name(item["name"]) if score isnotNone:
candidates.append((score, item["browser_download_url"]))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.