From ef0863831b87590fcf16e1090bb186530641bb1f Mon Sep 17 00:00:00 2001 From: "Felt, Nicholas" Date: Mon, 9 Sep 2024 07:38:51 -0700 Subject: [PATCH] chore: Update contributor_setup.py to encase executables and paths in quotes to avoid splitting paths --- scripts/contributor_setup.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/contributor_setup.py b/scripts/contributor_setup.py index bceda25..b57e625 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: @@ -84,11 +84,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 nodeenv --python-virtualenv --clean-src", - f"{python_executable} -m pre_commit install --install-hooks", - # f"{python_executable} -m tox -e tests", + 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)