-
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
Add option for global installation warning #11753
base: main
Are you sure you want to change the base?
Conversation
I’m -1 on this. Just use |
In my opinion, the UX with |
My two cents as a user of Pip is that I don't have an opinion on At a quick glance it seems Pip doesn't use ask unless it's to do with authentication or deleting files, otherwise pip tends to succeed or fail. Which means when pip is called in a subprocess (e.g. as part of CI scripts or in conda requirements) you can generally expect it to succeed or fail. Currently you have to set the environmental variable |
Thanks @notatallshaw, that's articulated my reservation far better than I managed. I agree, And we're looking at making |
I was thinking that the use of a prompt could be implemented inside Personally, I'd love to have a prompt and a warning but seems like everyone prefers an error. Should I close this PR then? |
Maybe alternatively we could deprecate But this could be an overkill, idk. |
This PR implements a new (opt-in) option
--global-install-warning
to warn the user if they're installing without a virtual environment activated, this does not conflict with the existing option--require-virtualenv
which gives an error when enabled and a virtualenv is not detected. If both--require-virtualenv
and--global-install-warning
are given then it will behave as if only--require-virtualenv
was passed.Example:
fixes #11752.