File tree 4 files changed +7
-10
lines changed
4 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
1
# Bazel Python Rules
2
2
3
- [ ![ Build Status] ( http ://ci.bazel.io/buildStatus/icon?job=rules_python)] ( http ://ci.bazel.io/job/rules_python)
3
+ [ ![ Build Status] ( https ://ci.bazel.io/buildStatus/icon?job=rules_python)] ( https ://ci.bazel.io/job/rules_python)
4
4
5
5
## Rules
6
6
Original file line number Diff line number Diff line change 22
22
import tempfile
23
23
import zipfile
24
24
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.
31
27
try :
32
28
# Make sure we're using a suitable version of pip as a library.
33
29
# Fallback on using it as a CLI.
@@ -40,7 +36,8 @@ def pip_main(argv):
40
36
cert_path = os .path .join (tempfile .mkdtemp (), "cacert.pem" )
41
37
with open (cert_path , "wb" ) as cert :
42
38
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 )
44
41
45
42
except :
46
43
import subprocess
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def metadata(self):
58
58
# directory.
59
59
with zipfile .ZipFile (self .path (), 'r' ) as whl :
60
60
with whl .open (os .path .join (self ._dist_info (), 'metadata.json' )) as f :
61
- return json .loads (f .read ())
61
+ return json .loads (f .read (). decode ( "utf-8" ) )
62
62
63
63
def name (self ):
64
64
return self .metadata ().get ('name' )
Original file line number Diff line number Diff line change @@ -15,5 +15,5 @@ package(default_visibility = ["//visibility:public"])
15
15
16
16
licenses (["notice" ]) # Apache 2.0
17
17
18
- # This is generated and updated by ./update_piptool .sh
18
+ # This is generated and updated by ./update_tools .sh
19
19
exports_files (["piptool.par" ])
You can’t perform that action at this time.
0 commit comments