Skip to content

Commit

Permalink
chore: Update contributor_setup.py to quote paths to avoid shell spli…
Browse files Browse the repository at this point in the history
…tting
  • Loading branch information
nfelt14 committed Sep 9, 2024
1 parent a751a27 commit 224de53
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/contributor_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 224de53

Please sign in to comment.