Skip to content

Commit

Permalink
Don't use repr for paths in console output
Browse files Browse the repository at this point in the history
  • Loading branch information
KotlinIsland committed Jun 19, 2023
1 parent b758002 commit 0084db1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fallback to user's log path if the default log path (`$PIPX_HOME/logs`) is not writable to aid with pipx being used for multi-user (e.g. system-wide) installs of applications
- Fix wrong interpreter usage when injecting local pip-installable dependencies into venvs
- add pre-commit hook support
- Don't use `repr` for paths in console output

## 1.2.0

Expand Down
2 changes: 1 addition & 1 deletion src/pipx/commands/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def warn_if_not_on_path(local_bin_dir: Path) -> None:
logger.warning(
pipx_wrap(
f"""
{hazard} Note: {str(local_bin_dir)!r} is not on your PATH
{hazard} Note: '{str(local_bin_dir)}' is not on your PATH
environment variable. These apps will not be globally
accessible until your PATH is updated. Run `pipx ensurepath` to
automatically add it, or manually modify your PATH in your
Expand Down
2 changes: 1 addition & 1 deletion src/pipx/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def install(
pipx_wrap(
f"""
{venv.name!r} already seems to be installed. Not modifying
existing installation in {str(venv_dir)!r}. Pass '--force'
existing installation in '{venv_dir}'. Pass '--force'
to force installation.
"""
)
Expand Down
4 changes: 2 additions & 2 deletions src/pipx/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ def run_package(
pypackage_bin_path = get_pypackage_bin_path(app)
if pypackage_bin_path.exists():
logger.info(
f"Using app in local __pypackages__ directory at {str(pypackage_bin_path)}"
f"Using app in local __pypackages__ directory at '{pypackage_bin_path}'"
)
run_pypackage_bin(pypackage_bin_path, app_args)
if pypackages:
raise PipxError(
f"""
'--pypackages' flag was passed, but {str(pypackage_bin_path)!r} was
'--pypackages' flag was passed, but '{pypackage_bin_path}' was
not found. See https://github.com/cs01/pythonloc to learn how to
install here, or omit the flag.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/pipx/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _get_sys_executable() -> str:
def _get_absolute_python_interpreter(env_python: str) -> str:
which_python = shutil.which(env_python)
if not which_python:
raise PipxError(f"Default python interpreter {repr(env_python)} is invalid.")
raise PipxError(f"Default python interpreter '{env_python}' is invalid.")
return which_python


Expand Down
2 changes: 1 addition & 1 deletion src/pipx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ def setup(args: argparse.Namespace) -> None:
logger.debug(f"{time.strftime('%Y-%m-%d %H:%M:%S')}")
logger.debug(f"{' '.join(sys.argv)}")
logger.info(f"pipx version is {__version__}")
logger.info(f"Default python interpreter is {repr(DEFAULT_PYTHON)}")
logger.info(f"Default python interpreter is '{DEFAULT_PYTHON}'")

mkdir(constants.PIPX_LOCAL_VENVS)
mkdir(constants.LOCAL_BIN_DIR)
Expand Down

0 comments on commit 0084db1

Please sign in to comment.