From 29d650aefbba4fcb47d44d9ef3399baefa60f993 Mon Sep 17 00:00:00 2001 From: Yannic Bonenberger Date: Thu, 24 Oct 2019 20:02:07 +0200 Subject: [PATCH] [bazel] Add `strip_prefix` to download of @six This way, we can avoid an unnecessary copy. --- protobuf_deps.bzl | 1 + third_party/six.BUILD | 15 +++++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index 9209b1c5a3..b5971a5a37 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -27,6 +27,7 @@ def protobuf_deps(): name = "six", build_file = "@com_google_protobuf//:third_party/six.BUILD", sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73", + strip_prefix = "six-1.12.0", urls = ["https://pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz"], ) diff --git a/third_party/six.BUILD b/third_party/six.BUILD index 88c75520de..327049cd14 100644 --- a/third_party/six.BUILD +++ b/third_party/six.BUILD @@ -1,13 +1,8 @@ -genrule( - name = "copy_six", - srcs = ["six-1.12.0/six.py"], - outs = ["__init__.py"], - cmd = "cp $< $(@)", -) +load("@rules_python//python:defs.bzl", "py_library") py_library( - name = "six", - srcs = ["__init__.py"], - srcs_version = "PY2AND3", - visibility = ["//visibility:public"], + name = "six", + srcs = ["six.py"], + srcs_version = "PY2AND3", + visibility = ["//visibility:public"], )