Skip to content

Commit

Permalink
Merge pull request #12066 from Mr-Pepe/docs/improve-root-user-action-…
Browse files Browse the repository at this point in the history
…docs
  • Loading branch information
uranusjr authored Mar 26, 2024
2 parents 0807480 + 27042f9 commit 0a6662e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Empty file.
2 changes: 1 addition & 1 deletion src/pip/_internal/cli/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def _handle_config_settings(
dest="root_user_action",
default="warn",
choices=["warn", "ignore"],
help="Action if pip is run as a root user. By default, a warning message is shown.",
help="Action if pip is run as a root user [warn, ignore] (default: warn)",
)


Expand Down
7 changes: 5 additions & 2 deletions src/pip/_internal/cli/req_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,12 @@ def warn_if_run_as_root() -> None:

logger.warning(
"Running pip as the 'root' user can result in broken permissions and "
"conflicting behaviour with the system package manager. "
"conflicting behaviour with the system package manager, possibly "
"rendering your system unusable."
"It is recommended to use a virtual environment instead: "
"https://pip.pypa.io/warnings/venv"
"https://pip.pypa.io/warnings/venv. "
"Use the --root-user-action option if you know what you are doing and "
"want to suppress this warning."
)


Expand Down

0 comments on commit 0a6662e

Please sign in to comment.