From 8c3d168c94c8f40a6a9696e4940b4b764e063862 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:12:17 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pipx/util.py | 2 +- src/pipx/venv.py | 8 ++------ tests/test_install.py | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/pipx/util.py b/src/pipx/util.py index 15031ceecb..8a498e853a 100644 --- a/src/pipx/util.py +++ b/src/pipx/util.py @@ -179,7 +179,7 @@ def run_subprocess( # symlink in argv[0] so that it can locate the venv. if not os.path.islink(cmd_str_list[0]) and WINDOWS: cmd_str_list[0] = os.path.realpath(cmd_str_list[0]) - + # TODO: Switch to using `-P` / PYTHONSAFEPATH instead of running in # separate directory in Python 3.11 completed_process = subprocess.run( diff --git a/src/pipx/venv.py b/src/pipx/venv.py index 567992e67c..96de4e3731 100644 --- a/src/pipx/venv.py +++ b/src/pipx/venv.py @@ -157,9 +157,7 @@ def create_venv(self, venv_args: List[str], pip_args: List[str], override_shared cmd = [self.python, "-m", "venv"] if not override_shared: cmd.append("--without-pip") - venv_process = run_subprocess( - cmd + venv_args + [str(self.root)], run_dir=str(self.root) - ) + venv_process = run_subprocess(cmd + venv_args + [str(self.root)], run_dir=str(self.root)) subprocess_post_check(venv_process) shared_libs.create(self.verbose) @@ -250,9 +248,7 @@ def install_package( ] # no logging because any errors will be specially logged by # subprocess_post_check_handle_pip_error() - pip_process = run_subprocess( - cmd, log_stdout=False, log_stderr=False, run_dir=str(self.root) - ) + pip_process = run_subprocess(cmd, log_stdout=False, log_stderr=False, run_dir=str(self.root)) subprocess_post_check_handle_pip_error(pip_process) if pip_process.returncode: raise PipxError(f"Error installing {full_package_description(package_name, package_or_url)}.") diff --git a/tests/test_install.py b/tests/test_install.py index fcc301ac11..23cfc52fc0 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -344,4 +344,4 @@ def test_install_run_in_separate_directory(caplog, capsys, pipx_temp_env, monkey f = Path("argparse.py") f.touch() - install_package(capsys, pipx_temp_env, caplog, "pycowsay", "pycowsay") + install_packages(capsys, pipx_temp_env, caplog, ["pycowsay"], ["pycowsay"])