Description
check_command_available() in scripts/setup_repository.py uses which to detect whether a command exists:
subprocess.run(
["which", cmd],
capture_output=True,
check=True,
)
which is a Unix utility and does not exist on Windows. The script already has Windows-aware logic elsewhere (e.g. choosing .venv/Scripts/pip vs .venv/bin/pip), but this function will raise FileNotFoundError on Windows before any of that logic is reached.
Impact
Any user generating a project on Windows who runs setup_repository.py (via make setup or directly) will get an immediate failure when checking for git/uv/conda/python availability.
Fix
Use shutil.which(cmd) from the standard library, which works cross-platform:
import shutil
def check_command_available(cmd: str) -> bool:
return shutil.which(cmd) is not None
Description
check_command_available()inscripts/setup_repository.pyuseswhichto detect whether a command exists:whichis a Unix utility and does not exist on Windows. The script already has Windows-aware logic elsewhere (e.g. choosing.venv/Scripts/pipvs.venv/bin/pip), but this function will raiseFileNotFoundErroron Windows before any of that logic is reached.Impact
Any user generating a project on Windows who runs
setup_repository.py(viamake setupor directly) will get an immediate failure when checking for git/uv/conda/python availability.Fix
Use
shutil.which(cmd)from the standard library, which works cross-platform: