Skip to content
Snippets Groups Projects
Commit da96b3d2 authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

run-util: add some typing and enforce path existence at the CLI level

parent 2ba5847f
No related branches found
No related tags found
1 merge request!37general improvements
......@@ -50,7 +50,7 @@
core["compatible-revision-range"] = rev_range
def get_benchmark(path_def):
def get_benchmark(path_def: str):
"""get a benchmark from path applying possible variant selection on the way
Expected syntax is PATH[;dimension_name=variant_name][;d=v]...
......
#!/usr/bin/env python3
from pathlib import Path
import sys
import click
from poulpe import runner
@click.command(no_args_is_help=True)
......@@ -2,10 +3,10 @@
import sys
import click
from poulpe import runner
@click.command(no_args_is_help=True)
@click.argument("bin_env")
@click.argument('data_env')
@click.argument("bin_env", type=click.Path(exists=True, file_okay=False, path_type=Path))
@click.argument('data_env', type=click.Path(exists=True, file_okay=False, path_type=Path))
@click.argument('benchmark')
@click.option("--debug", is_flag=True)
......@@ -10,7 +11,15 @@
@click.argument('benchmark')
@click.option("--debug", is_flag=True)
@click.argument('result')
def run_util(bin_env, data_env, benchmark, result, debug=False):
@click.argument(
'result',
type=click.Path(
path_type=Path,
exists=False,
dir_okay=False,
allow_dash=True,
),
)
def run_util(bin_env: Path, data_env: Path, benchmark: str, result: Path, debug=False):
"""Run an "atomic" benchmark unit from already setup environments.
\b
......
......@@ -148,7 +148,12 @@
print(m, file=sys.stderr)
def run_one_core(bin_env_path, data_env_path, benchmark_path, debug=False):
def run_one_core(
bin_env_path: pathlib.Path,
data_env_path: pathlib.Path,
benchmark_path: str,
debug=False,
):
result_data = {}
result_data["run"] = {}
result_data["run"]["timestamp"] = time.time()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment