Update six version to 1.12.0 and fix legacy_create_init issue

When the @six//:six library is used on a target without the
`legacy_create_init` flag disabled, the library will not be
usable due to __init__.py being empty and the six code will
be in six.py. This change forces six to occupy the __init__
name, preventing this file getting created regardless of
the `legacy_create_init` setting.

See comments on a74c43bbd9 for
context:
a74c43bbd9
This commit is contained in:
Adam Liddell 2019-07-16 15:17:28 +00:00 committed by Adam Cozzette
parent 8c46be0328
commit 23e520e7fc
3 changed files with 7 additions and 7 deletions

View File

@ -19,8 +19,8 @@ protobuf_deps()
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"],
sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73",
urls = ["https://pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz"],
)
bind(

View File

@ -26,8 +26,8 @@ def protobuf_deps():
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"],
sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73",
urls = ["https://pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz"],
)
if not native.existing_rule("rules_cc"):

View File

@ -1,13 +1,13 @@
genrule(
name = "copy_six",
srcs = ["six-1.10.0/six.py"],
outs = ["six.py"],
srcs = ["six-1.12.0/six.py"],
outs = ["__init__.py"],
cmd = "cp $< $(@)",
)
py_library(
name = "six",
srcs = ["six.py"],
srcs = ["__init__.py"],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
)