Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress "not on PATH" warning when --prefix is given #9821

Closed
nchepanov opened this issue Apr 20, 2021 · 1 comment · Fixed by #9931
Closed

Suppress "not on PATH" warning when --prefix is given #9821

nchepanov opened this issue Apr 20, 2021 · 1 comment · Fixed by #9931
Labels
state: awaiting PR Feature discussed, PR is needed type: feature request Request for a new feature

Comments

@nchepanov
Copy link
Contributor

nchepanov commented Apr 20, 2021

What's the problem this feature will solve?

pip install pkg --prefix foo/ triggers WARNING: The scripts ... are installed in 'foo/bin' which is not on PATH.

For example:

python -m pip --version
pip 21.0.1 from .../tmp/.venv/lib/python3.9/site-packages/pip (python 3.9)
➜  python3.9 -m pip install black --prefix foo
...
Successfully built black
Installing collected packages: typed-ast, regex, pathspec, appdirs, black
  WARNING: The scripts black, black-primer and blackd are installed in 'foo/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed appdirs-1.4.4 black-20.8b1 pathspec-0.8.1 regex-2021.4.4 typed-ast-1.4.3

Describe the solution you'd like

Similar to what's done for --target calls:

# Don't warn about script install locations if
# --target has been specified
avoid printing the warning, since it's clear for the context that it's very likely the executables are not going to be on $PATH

Alternative Solutions

It's possible to work around this warning by providing --no-warn-script-location.

Extra context

Interesting, this warning is triggered when using console_scripts, but not when using scripts.

@uranusjr
Copy link
Member

Sounds reasonable to me, I’ll be happy to accept a PR!

@uranusjr uranusjr added state: awaiting PR Feature discussed, PR is needed type: feature request Request for a new feature labels Apr 21, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
state: awaiting PR Feature discussed, PR is needed type: feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants