瀏覽代碼

Fix usage of six in //:protobuf_python rule and add import (#6310)

* Fix reference to six in //:protobuf_python rule

* Add six to protobuf_deps.bzl

* Use six archive directly as repo @six
Adam Liddell 6 年之前
父節點
當前提交
a74c43bbd9
共有 3 個文件被更改,包括 10 次插入7 次删除
  1. 1 1
      BUILD
  2. 1 6
      WORKSPACE
  3. 8 0
      protobuf_deps.bzl

+ 1 - 1
BUILD

@@ -911,7 +911,7 @@ py_proto_library(
     py_extra_srcs = glob(["python/**/__init__.py"]),
     py_libs = [
         ":python_srcs",
-        "//external:six",
+        "@six//:six",
     ],
     srcs_version = "PY2AND3",
     visibility = ["//visibility:public"],

+ 1 - 6
WORKSPACE

@@ -13,7 +13,7 @@ new_local_repository(
 )
 
 http_archive(
-    name = "six_archive",
+    name = "six",
     build_file = "@//:six.BUILD",
     sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
     urls = ["https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55"],
@@ -41,11 +41,6 @@ bind(
     actual = "@submodule_gmock//:gtest_main",
 )
 
-bind(
-    name = "six",
-    actual = "@six_archive//:six",
-)
-
 maven_jar(
     name = "guava_maven",
     artifact = "com.google.guava:guava:18.0",

+ 8 - 0
protobuf_deps.bzl

@@ -13,3 +13,11 @@ def protobuf_deps():
             strip_prefix = "zlib-1.2.11",
             urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
         )
+
+    if "six" not in native.existing_rules():
+        http_archive(
+            name = "six",
+            build_file = "@//:six.BUILD",
+            sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
+            urls = ["https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55"],
+        )