Users who frequently need to create new virtualenvs during the course of day-to-day development and then use pip to install packages in them currently get a lot of warning noise about updating in their consoles.
(For example, I've just been shown "WARNING: You are using pip version 20.1; however, version 20.2.2 is available" about half a dozen times in a row for the several virtualenvs in a project's tox matrix.)
These warnings are not useful in this context, as these are disposable environments. Given the prevalence of this usage pattern, perhaps this is even the case more often than not when these warnings are shown.
What do you think of adding a global option to either rate limit – e.g. once per week – or completely suppress these warnings, at least when running inside a virtualenv? Or perhaps a global option to auto-upgrade pip when a new version is available?
Seems like _some_ behavior change could make these warnings more useful, i.e. timely and actionable.
Thanks for your consideration!
It already exists - --disable-pip-version-check
Thanks, @pfmoore, just noting though that that option is more all-or-nothing than what this issue is proposing.
pip already limits the message frequency to once a week; the problem is that, since your throwaway environments are all “new” when they are created, the message is always seen since, well, their pip installations were never checked.
Recent virtualenv versions (not the built-in venv) offers a solution by automatically upgrading the “seeded” pip bundle once in a while, so newly-created environments would get an up-to-date pip that does not trigger the warning.
Given that we have virtualenv's capability to upgrade seed packages + pip's behavior of limiting how often it prints the message + --disable-pip-version-check
, we cover this well enough IMO.
status quo: 1 message per week, per environment, nudging to upgrade to newer versions.
Don't want to upgrade? use --disable-pip-version-check
Want virtual environments to have the new pip by default? virtualenv --upgrade-embed-wheels
Gonna close this on the basis that I think we do a good-enough job in this area.
@pradyunsg, in the case of using tox, tox manages the virtualenvs for you, so you can't add the --upgrade-embed-wheels
option to each virtualenv
invocation directly (nor should you have to). Searching the tox docs, it's hard to tell if there's even a way to configure tox to always invoke virtualenv with this option. Any ideas? cc @gaborbernat
Set virtualenv download on via a tox setenv to force all users. Use virtualenv.ini file to set it just for your users. You pay with performance penalty for it.
Most helpful comment
pip already limits the message frequency to once a week; the problem is that, since your throwaway environments are all “new” when they are created, the message is always seen since, well, their pip installations were never checked.
Recent virtualenv versions (not the built-in venv) offers a solution by automatically upgrading the “seeded” pip bundle once in a while, so newly-created environments would get an up-to-date pip that does not trigger the warning.