Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename installer to is_installer
Browse files Browse the repository at this point in the history
dukecat0 committed Sep 26, 2024
1 parent bca02e2 commit c334237
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pipx/backend.py
Original file line number Diff line number Diff line change
@@ -10,13 +10,13 @@
logger = logging.getLogger(__name__)


def path_to_exec(executable: str, installer: bool = False) -> str:
def path_to_exec(executable: str, is_installer: bool = False) -> str:
if executable in ("venv", "pip"):
return executable
path = shutil.which(executable)
if path:
return path
elif installer:
elif is_installer:
logger.warning(f"'{executable}' not found on PATH. Falling back to 'pip'.")
return ""
else:
4 changes: 2 additions & 2 deletions src/pipx/venv.py
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ def __init__(

if not path_to_exec(self.backend):
self.backend = "venv"
if not path_to_exec(self.installer, installer=True):
if not path_to_exec(self.installer, is_installer=True):
self.installer = "pip"

def check_upgrade_shared_libs(self, verbose: bool, pip_args: List[str], force_upgrade: bool = False):
@@ -505,7 +505,7 @@ def _run_installer(
return self._run_uv(["pip"] + install_cmd, quiet=quiet)

def _run_uv(self, cmd: List[str], quiet: bool = True) -> "CompletedProcess[str]":
cmd = [path_to_exec("uv", installer=True)] + cmd + ["--python", str(self.python_path)]
cmd = [path_to_exec("uv", is_installer=True)] + cmd + ["--python", str(self.python_path)]
if not self.verbose and quiet:
cmd.append("-q")
return run_subprocess(cmd, run_dir=str(self.root))

0 comments on commit c334237

Please sign in to comment.