MCPcopy
hub / github.com/PaddlePaddle/PaddleFormers / get_fleet_commit_id

Function get_fleet_commit_id

scripts/ci_utils/get_fleet_commit.py:16–24  ·  view source on GitHub ↗
(setup_file_path)

Source from the content-addressed store, hash-verified

14
15# 读取setup.py文件 拿到fleet的commit id
16def get_fleet_commit_id(setup_file_path):
17 with open(setup_file_path, "r") as f:
18 for line in f:
19 if "paddlefleet==" in line:
20 commit_id = line.split("paddlefleet==")[1].strip().strip('"').strip("'")
21 commit_id = commit_id.split("+")[1].strip() # 如果有版本号,取最后的commit id部分
22 commit_id = commit_id.split('"')[0].strip() # 如果有版本号,取最后的commit id部分
23 return commit_id
24 raise ValueError("FLEET_COMMIT_ID not found in setup.py")
25
26
27if __name__ == "__main__":

Callers 1

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected