Skip to content

Commit ec109ce

Browse files
authored
Merge branch 'master' into mattmoor-patch-1
2 parents 140e6d7 + 979fca9 commit ec109ce

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Bazel Python Rules
22

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)
44

55
## Rules
66

rules_python/piptool.py

+4-7
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

rules_python/whl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def metadata(self):
5858
# directory.
5959
with zipfile.ZipFile(self.path(), 'r') as whl:
6060
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"))
6262

6363
def name(self):
6464
return self.metadata().get('name')

tools/BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ package(default_visibility = ["//visibility:public"])
1515

1616
licenses(["notice"]) # Apache 2.0
1717

18-
# This is generated and updated by ./update_piptool.sh
18+
# This is generated and updated by ./update_tools.sh
1919
exports_files(["piptool.par"])

0 commit comments

Comments
 (0)