From 3581ee24e98eee66aef442590f61ff4726de3bd8 Mon Sep 17 00:00:00 2001 From: Yannic Date: Fri, 25 Oct 2019 14:12:36 +0200 Subject: [PATCH] Update six.BUILD --- third_party/six.BUILD | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/third_party/six.BUILD b/third_party/six.BUILD index 327049cd14..5d66ba7d61 100644 --- a/third_party/six.BUILD +++ b/third_party/six.BUILD @@ -1,8 +1,19 @@ load("@rules_python//python:defs.bzl", "py_library") +# Consume `six.py` as `__init__.py` for compatibility +# with `--incompatible_default_to_explicit_init_py`. +# https://github.com/protocolbuffers/protobuf/pull/6795#issuecomment-546060749 +# https://github.com/bazelbuild/bazel/issues/10076 +genrule( + name = "copy_six", + srcs = ["six-1.12.0/six.py"], + outs = ["__init__.py"], + cmd = "cp $< $(@)", +) + py_library( - name = "six", - srcs = ["six.py"], - srcs_version = "PY2AND3", - visibility = ["//visibility:public"], + name = "six", + srcs = ["__init__.py"], + srcs_version = "PY2AND3", + visibility = ["//visibility:public"], )