(setup_file_path)
| 14 | |
| 15 | # 读取setup.py文件 拿到fleet的commit id |
| 16 | def 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 | |
| 27 | if __name__ == "__main__": |
no test coverage detected