mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Disable pip's version check for commands that do not touch the index
This commit is contained in:
parent
0d9c05ec32
commit
885a000775
2
news/5433.bugfix
Normal file
2
news/5433.bugfix
Normal file
|
@ -0,0 +1,2 @@
|
|||
Run self-version-check only on commands that may access the index, instead of
|
||||
trying on every run and failing to do so due to missing options.
|
|
@ -170,12 +170,14 @@ class Command(object):
|
|||
|
||||
return UNKNOWN_ERROR
|
||||
finally:
|
||||
# Check if we're using the latest version of pip available
|
||||
skip_version_check = (
|
||||
options.disable_pip_version_check or
|
||||
getattr(options, "no_index", False)
|
||||
allow_version_check = (
|
||||
# Does this command have the index_group options?
|
||||
hasattr(options, "no_index") and
|
||||
# Is this command allowed to perform this check?
|
||||
not (options.disable_pip_version_check or options.no_index)
|
||||
)
|
||||
if not skip_version_check:
|
||||
# Check if we're using the latest version of pip available
|
||||
if allow_version_check:
|
||||
session = self._build_session(
|
||||
options,
|
||||
retries=0,
|
||||
|
|
Loading…
Reference in a new issue