-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Warn user when installing scripts outside PATH #4553
Warn user when installing scripts outside PATH #4553
Conversation
We only need this warning if the install actually creates binaries. At the moment it warns unconditionally, whether or not there is an actual issue. I appreciate it's harder to only warn if binaries are being installed (maybe so much harder that it's impractical) but I'd prefer it that way. I'm a strong -1 on "warnings" that don't actually report an issue and can be safely ignored. To ensure the warning is correctly produced, I'd suggest adding two tests - one that tests that installing a package with binaries warns, and one that tests that installing a package with no binary doesn't warn. |
So, should we instead be checking if the installed path contain scripts that would be installed out of PATH?
Will do. |
Personally, I don't think this change is worth it in any case. But as long as the 2 tests I suggested pass, I don't really mind how it's done. |
I think this change is worth it, since in a future where we default to In any case, I agree with @pfmoore that we should not be warning if it's not actually going to be doing something wrong, and I think that instead of explicitly focusing on |
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
So, the approach I'm thinking of taking here is adding the warning conditional to a user specified flag. I'd actually not want to add virtualenv as a special case -- the warning could include how-to-suppress message; something along the lines of:
|
7b43048
to
f8b3697
Compare
Two of these were requested by @pfmoore.
a403a8c
to
b41a74c
Compare
b41a74c
to
4eb8325
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change also 👍
Thanks for the review @xavfernandez! I'll fix these when I rebase/merge. |
Thanks for this @pradyunsg 😄 |
You're welcome! ^>^ |
Should this only warn for RUN virtualenv venv
RUN venv/bin/pip install ...
CMD ["dumb-init" "venv/bin/exe", ...] (or outside of a dockerfile, similarly) virtualenv venv
venv/bin/pip install ...
venv/bin/exe ... (Just noticed this spamming my terminal with a lot of undesirable output after trying out the new 10.x betas) |
Hmm, yes that's a very good point. We shouldn't really be warning in that situation. @pradyunsg any thoughts on this? |
You're right, this is a common use case this PR did not cover. My current thought is: if the executable is installed in Pinging @dstufft @ncoghlan @xavfernandez for inputs. |
Chipping in with my release manager hat on, I think that we need some solution to avoid spamming the user with warnings when installing into a non-activated virtualenv (IMO, using a virtualenv without activating it is an important use case). I'll leave the interested parties to agree on a suitable solution. I'm going to mark this as a release blocker so it doesn't get forgotten about. |
FWIW, this is a matter of adding one line: |
+1 for @pradyunsg's suggested resolution - not sure if you want to convert this into a full issue before resolving it :) |
Thanks, that's fine. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #3813, Helps with #1668.