diff --git a/bench/utils/bench.py b/bench/utils/bench.py index a3a0d140..98cfec2e 100644 --- a/bench/utils/bench.py +++ b/bench/utils/bench.py @@ -22,17 +22,18 @@ logger = logging.getLogger(bench.PROJECT_NAME) @lru_cache(maxsize=None) -def get_env_cmd(cmd, bench_path="."): +def get_env_cmd(cmd: str, bench_path: str = ".") -> str: # this supports envs' generated by patched virtualenv or venv (which may cause an extra 'local' folder to be created) existing_python_bins = glob( - os.path.abspath(os.path.join(bench_path, "env", "**", "bin", cmd)), recursive=True + os.path.join(bench_path, "env", "**", "bin", cmd), recursive=True ) if existing_python_bins: return existing_python_bins[0] - return os.path.abspath(os.path.join(bench_path, "env", "bin", cmd)) + cmd = cmd.strip("*") + return os.path.join(bench_path, "env", "bin", cmd) def get_venv_path(verbose=False, python="python3"):