From f18c5e320d3388c6a277bd88233edf875365be1a Mon Sep 17 00:00:00 2001 From: Alex Myers Date: Tue, 18 Oct 2022 17:44:53 -0500 Subject: [PATCH] reckless: detect pip3 or pip --- tools/reckless | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/reckless b/tools/reckless index 99ba6c62f..fda32eaa8 100755 --- a/tools/reckless +++ b/tools/reckless @@ -350,10 +350,14 @@ def _install_plugin(src): if checkout.returncode != 0: print(f'failed to checkout referenced commit {src.commit}') return False - # Install dependencies via requirements.txt + + # Install dependencies via requirements.txt or pyproject.toml + mypip = 'pip3' if shutil.which('pip3') else 'pip' + if not shutil.which(mypip): + raise Exception(f'{mypip} not found in PATH') install_methods = { - 'requirements.txt': ['pip', 'install', '-r', 'requirements.txt'], - 'pyproject.toml': ['pip', 'install', '-e', '.'] + 'requirements.txt': [mypip, 'install', '-r', 'requirements.txt'], + 'pyproject.toml': [mypip, 'install', '-e', '.'] } if src.deps is not None: