Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and chrysle committed Jan 31, 2024
1 parent b511eaa commit ffbbed4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/pipx/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 2 additions & 6 deletions src/pipx/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)}.")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit ffbbed4

Please sign in to comment.