Skip to content

Commit

Permalink
expose debugging flag to CLI (#17)
Browse files Browse the repository at this point in the history
* expose debugging flag to CLI

* add bench flag too

* propagate to asv run
  • Loading branch information
CodyCBakerPhD authored Jan 27, 2024
1 parent f36c1ec commit 6c76785
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/nwb_benchmarks/command_line_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ def main():
return

command = sys.argv[1]
flags_list = sys.argv[2:]

debug_mode = "--debug" in flags_list
bench_mode = "--bench" in flags_list
if bench_mode:
specific_benchmark_pattern = flags_list[flags_list.index("--bench")+1]

if command == "run":
commit_hash = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]).decode("ascii").strip()
Expand All @@ -24,6 +30,10 @@ def main():
"--set-commit-hash",
commit_hash,
]
if debug_mode:
cmd.extend(["--verbose", "--show-std-err"])
if bench_mode:
cmd.extend(["--bench", specific_benchmark_pattern])

process = subprocess.Popen(cmd, stdout=subprocess.PIPE) # , bufsize=1)
encoding = locale.getpreferredencoding() # This is how ASV chooses to encode the output
Expand Down

0 comments on commit 6c76785

Please sign in to comment.