From e2063a424657f703d97d764763dad60480e30922 Mon Sep 17 00:00:00 2001 From: "Felt, Nicholas" Date: Mon, 9 Sep 2024 07:51:18 -0700 Subject: [PATCH] chore: Update contributor_setup.py to quote paths to avoid shell splitting --- scripts/contributor_setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/contributor_setup.py b/scripts/contributor_setup.py index 6b52b7ce..956c6c86 100644 --- a/scripts/contributor_setup.py +++ b/scripts/contributor_setup.py @@ -25,7 +25,7 @@ def create_virtual_environment(virtual_env_dir: str | os.PathLike[str]) -> None: virtual_env_dir: The directory where the virtual environment should be created """ print(f"\nCreating virtualenv located at '{virtual_env_dir}'") - _run_cmd_in_subprocess(f"{sys.executable} -m venv {virtual_env_dir} --clear") + _run_cmd_in_subprocess(f'"{sys.executable}" -m venv "{virtual_env_dir}" --clear') def _run_cmd_in_subprocess(command: str) -> None: @@ -78,9 +78,11 @@ def main() -> None: ) python_executable = files[0] commands_to_send = ( - f"{python_executable} -m pip install -U pip wheel poetry", - f"{python_executable} -m poetry install", - f"{python_executable} -m pre_commit install --install-hooks", + f'"{python_executable}" -m pip install -U pip wheel poetry', + f'"{python_executable}" -m poetry install', + f'"{python_executable}" -m nodeenv --python-virtualenv --clean-src', + f'"{python_executable}" -m pre_commit install --install-hooks', + f'"{python_executable}" -m tox -e tests', ) for command in commands_to_send: _run_cmd_in_subprocess(command)