Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d960872

Browse filesBrowse files
author
Doug Greiman
committed
Silence a warning erroneously emitted by pip.
The warning is: You are using pip version 1.5.4, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. In reality, pip is at 9.0.1, but its bundled version of pkg_resources doesn't know that. See google/subpar#38
1 parent 3558f58 commit d960872
Copy full SHA for d960872

File tree

1 file changed

+4
-7
lines changed
Filter options

1 file changed

+4
-7
lines changed

‎rules_python/piptool.py

Copy file name to clipboardExpand all lines: rules_python/piptool.py
+4-7Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,8 @@
2222
import tempfile
2323
import zipfile
2424

25-
# TODO(mattmoor): When this tool is invoked bundled as a PAR file,
26-
# but not as a py_binary, we get a warning that indicates the system
27-
# installed version of PIP is being picked up instead of our bundled
28-
# version, which should be 9.0.1, e.g.
29-
# You are using pip version 1.5.4, however version 9.0.1 is available.
30-
# You should consider upgrading via the 'pip install --upgrade pip' command.
25+
# PIP erroneously emits an error when bundled as a PAR file. We
26+
# disable the version check to silence it.
3127
try:
3228
# Make sure we're using a suitable version of pip as a library.
3329
# Fallback on using it as a CLI.
@@ -40,7 +36,8 @@ def pip_main(argv):
4036
cert_path = os.path.join(tempfile.mkdtemp(), "cacert.pem")
4137
with open(cert_path, "wb") as cert:
4238
cert.write(pkgutil.get_data("pip._vendor.requests", "cacert.pem"))
43-
return _pip_main(argv + ["--cert", cert_path])
39+
argv = ["--disable-pip-version-check", "--cert", cert_path] + argv
40+
return _pip_main(argv)
4441

4542
except:
4643
import subprocess

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.