Skip to content

Commit

Permalink
Also pass --no-input when pip is installed in the target env
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Aug 17, 2024
1 parent 75813d3 commit 9197fce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/158.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Also pass `--no-input` to pip when it is installed in the target venv.
5 changes: 3 additions & 2 deletions src/pip_deepfreeze/sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ def get_pip_version(python: str) -> Version:

@lru_cache
def get_pip_command(python: str) -> Tuple[str, ...]:
pip_options = ("--no-input",)
env_pip_version = _get_env_info(python).get("pip_version")
if env_pip_version:
# pip is installed in the target environment, let's use it
return (python, "-m", "pip")
return (python, "-m", "pip", *pip_options)
if not local_pip_compatible(python):
log_error(
f"pip is not available to {python}, and the pip version. "
f"installed the pip-deepfreeze environment is not compatible with it. "
f"Please install pip in the target environment."
)
raise typer.Exit(1)
return (sys.executable, "-m", "pip", "--python", python, "--no-input")
return (sys.executable, "-m", "pip", "--python", python, *pip_options)

Check warning on line 64 in src/pip_deepfreeze/sanity.py

View check run for this annotation

Codecov / codecov/patch

src/pip_deepfreeze/sanity.py#L64

Added line #L64 was not covered by tests


@lru_cache
Expand Down

0 comments on commit 9197fce

Please sign in to comment.