Skip to content

Commit f728843

Browse files
committed
Fix argparse add_mutually_exclusive_group usage
Signed-off-by: Huy Do <huydhn@gmail.com>
1 parent 462364c commit f728843

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

vllm-benchmarks/upload_benchmark_results.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@ def parse_args() -> Any:
5454
action=ValidateDir,
5555
help="the directory that the repo is checked out",
5656
)
57-
branch_commit = repo_metadata.add_argument_group("the branch and commit metadata")
58-
branch_commit.add_argument(
57+
repo_metadata.add_argument(
5958
"--repo-name",
6059
type=str,
6160
help="the name of the repo",
6261
)
63-
branch_commit.add_argument(
62+
63+
parser.add_argument(
6464
"--head-branch",
6565
type=str,
6666
default="main",
6767
help="the name of the branch the benchmark runs on",
6868
)
69-
branch_commit.add_argument(
69+
parser.add_argument(
7070
"--head-sha",
7171
type=str,
7272
help="the commit SHA the benchmark runs on",
@@ -295,8 +295,16 @@ def main() -> None:
295295
args = parse_args()
296296

297297
if args.repo:
298+
if args.head_branch or args.head_sha:
299+
warning("No need to set --head-branch and --head-sha when using --repo")
300+
sys.exit(1)
301+
298302
repo_name, head_branch, head_sha, timestamp = get_git_metadata(args.repo)
299303
else:
304+
if not args.head_branch or not args.head_sha:
305+
warning(f"Need to set --head-branch and --head-sha when manually setting --repo-name")
306+
sys.exit(1)
307+
300308
repo_name, head_branch, head_sha, timestamp = (
301309
args.repo_name,
302310
args.head_branch,

0 commit comments

Comments
 (0)