MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / main

Function main

diffusers/utils/fetch_latest_release_branch.py:49–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48
49def main():
50 # Fetch all branches
51 branches = fetch_all_branches(USER, REPO)
52
53 # Filter branches.
54 # print(f"Total branches: {len(branches)}")
55 filtered_branches = []
56 for branch in branches:
57 if branch.startswith("v") and ("-release" in branch or "-patch" in branch):
58 filtered_branches.append(branch)
59 # print(f"Filtered: {branch}")
60
61 sorted_branches = sorted(filtered_branches, key=lambda x: parse(x.split("-")[0][1:]), reverse=True)
62 latest_branch = sorted_branches[0]
63 # print(f"Latest branch: {latest_branch}")
64 return latest_branch
65
66
67if __name__ == "__main__":

Callers 1

Calls 1

fetch_all_branchesFunction · 0.85

Tested by

no test coverage detected