Skip to content

Commit

Permalink
Add pipx installation detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Dramelac committed Nov 9, 2024
1 parent 4db334d commit 543e8a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions exegol/config/ConstantConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class ConstantConfig:
# Install mode, check if Exegol has been git cloned or installed using pip package
git_source_installation: bool = (src_root_path_obj / '.git').is_dir()
pip_installed: bool = src_root_path_obj.name == "site-packages"
pipx_installed: bool = "/pipx/venvs/" in src_root_path_obj.as_posix()
# Dockerhub Exegol images repository
DOCKER_HUB: str = "hub.docker.com" # Don't handle docker login operations
DOCKER_REGISTRY: str = "registry-1.docker.io" # Don't handle docker login operations
Expand Down
3 changes: 2 additions & 1 deletion exegol/manager/ExegolManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ def print_version(cls):
@classmethod
def print_debug_banner(cls):
"""Print header debug info"""
logger.debug(f"Pip installation: {boolFormatter(ConstantConfig.pip_installed)}")
logger.debug(f"Pip installation: {boolFormatter(ConstantConfig.pip_installed)}"
f"{'[bright_black](pipx)[/bright_black]' if ConstantConfig.pipx_installed else ''}")
logger.debug(f"Git source installation: {boolFormatter(ConstantConfig.git_source_installation)}")
logger.debug(f"Host OS: {EnvInfo.getHostOs().value} [bright_black]({EnvInfo.getDockerEngine().value})[/bright_black]")
logger.debug(f"Arch: {EnvInfo.arch}")
Expand Down
5 changes: 4 additions & 1 deletion exegol/utils/GitUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def __init__(self,
except ReferenceError:
if self.__git_name == "wrapper":
logger.warning("Exegol has [red]not[/red] been installed via git clone. Skipping wrapper auto-update operation.")
if ConstantConfig.pip_installed:
if ConstantConfig.pipx_installed:
logger.info("If you have installed Exegol with pipx, check for an update with the command "
"[green]pipx upgrade exegol[/green]")
elif ConstantConfig.pip_installed:
logger.info("If you have installed Exegol with pip, check for an update with the command "
"[green]pip3 install exegol --upgrade[/green]")
abort_loading = True
Expand Down

0 comments on commit 543e8a1

Please sign in to comment.