diff --git a/tools/android/BUILD.tools b/tools/android/BUILD.tools index f9f7f1ae65c0c8..fb4b49d8fbbecd 100644 --- a/tools/android/BUILD.tools +++ b/tools/android/BUILD.tools @@ -1,5 +1,4 @@ load("//tools/python:private/defs.bzl", "py_binary", "py_library") -load("//tools/python:private/version.bzl", "PY_BINARY_VERSION") load(":defs.bzl", "run_ijar", "run_singlejar") package(default_visibility = ["//visibility:public"]) @@ -269,21 +268,21 @@ alias( py_binary( name = "instrumentation_test_check", srcs = ["instrumentation_test_check.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", deps = ["//third_party/py/abseil"], ) py_binary( name = "build_incremental_dexmanifest", srcs = [":build_incremental_dexmanifest.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", deps = [], ) py_binary( name = "build_split_manifest", srcs = ["build_split_manifest.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", deps = [ "//third_party/py/abseil", ], @@ -292,7 +291,7 @@ py_binary( py_binary( name = "incremental_install", srcs = ["incremental_install.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", deps = [ "//third_party/py/abseil", "//third_party/py/concurrent:futures", @@ -302,7 +301,7 @@ py_binary( py_binary( name = "strip_resources", srcs = ["strip_resources.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", deps = [ "//third_party/py/abseil", ], @@ -313,7 +312,7 @@ py_binary( srcs = [ "aar_native_libs_zip_creator.py", ], - python_version = PY_BINARY_VERSION, + python_version = "PY3", deps = [ ":junction_lib", "//third_party/py/abseil", @@ -323,7 +322,7 @@ py_binary( py_binary( name = "stubify_manifest", srcs = ["stubify_manifest.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", deps = [ "//third_party/py/abseil", ], @@ -332,7 +331,7 @@ py_binary( py_binary( name = "aar_embedded_jars_extractor", srcs = ["aar_embedded_jars_extractor.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", deps = [ ":junction_lib", "//third_party/py/abseil", @@ -342,7 +341,7 @@ py_binary( py_binary( name = "aar_resources_extractor", srcs = ["aar_resources_extractor.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", deps = [ ":junction_lib", "//third_party/py/abseil", @@ -352,7 +351,7 @@ py_binary( py_binary( name = "resource_extractor", srcs = ["resource_extractor.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", ) py_library( diff --git a/tools/build_defs/pkg/BUILD b/tools/build_defs/pkg/BUILD index 31f0e1ebb18ce0..4c2c9b922d847f 100644 --- a/tools/build_defs/pkg/BUILD +++ b/tools/build_defs/pkg/BUILD @@ -2,7 +2,6 @@ load("//tools/build_defs/pkg:pkg.bzl", "pkg_deb", "pkg_tar") load("//tools/config:common_settings.bzl", "bool_flag") load("//tools/python:private/defs.bzl", "py_binary", "py_library", "py_test") -load("//tools/python:private/version.bzl", "PY_BINARY_VERSION") licenses(["notice"]) # Apache 2.0 @@ -43,7 +42,7 @@ py_test( "testenv.py", ], data = [":archive_testdata"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", srcs_version = "PY2AND3", tags = [ # archive.py requires xzcat, which is not available by default on Mac @@ -64,7 +63,7 @@ py_test( py_binary( name = "build_tar", srcs = ["build_tar.py"], - python_version = PY_BINARY_VERSION, + python_version = "PY3", srcs_version = "PY2AND3", visibility = ["//visibility:public"], deps = [ @@ -79,7 +78,7 @@ py_binary( deprecation = "The internal version of make_deb is deprecated. Please " + "use the replacement for pkg_deb from " + "https://github.com/bazelbuild/rules_pkg/blob/master/pkg.", - python_version = PY_BINARY_VERSION, + python_version = "PY3", srcs_version = "PY2AND3", visibility = ["//visibility:public"], deps = [ diff --git a/tools/python/BUILD b/tools/python/BUILD index 82db2596e0385a..d7c324331cf837 100644 --- a/tools/python/BUILD +++ b/tools/python/BUILD @@ -12,10 +12,7 @@ filegroup( filegroup( name = "embedded_tools", - srcs = glob( - ["**"], - exclude = ["private/version.bzl"], - ) + [ + srcs = glob(["**"]) + [ "//tools/python/runfiles:embedded_tools", ], visibility = ["//tools:__pkg__"], diff --git a/tools/python/BUILD.tools b/tools/python/BUILD.tools index c2ef69586a96e7..e289d9521cf370 100644 --- a/tools/python/BUILD.tools +++ b/tools/python/BUILD.tools @@ -54,7 +54,6 @@ exports_files([ "utils.bzl", "private/defs.bzl", "private/py_test_alias.bzl", - "private/version.bzl", # write_file.bzl fortunately doesn't need to be exposed because it's only # used in this BUILD file. ]) @@ -64,7 +63,6 @@ filegroup( srcs = glob(["*.bzl"]) + [ "private/defs.bzl", "private/py_test_alias.bzl", - "private/version.bzl", ], visibility = ["//tools:__pkg__"], ) diff --git a/tools/python/private/version.bzl b/tools/python/private/version.bzl deleted file mode 100644 index cb9734c2222e3f..00000000000000 --- a/tools/python/private/version.bzl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2019 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This is a Bazel-internal file; do not load() it! - -'python_version' value for py_binary and py_test rules in the Bazel source tree. -See also "version.bzl.tools", which defines the value for targets in the -@bazel_tools repository. - -We use PY3 in the source tree because PY2 reaches end of life in December 2019. -Building Bazel requires PY3. - -We use PY2 in @bazel_tools to retain PY2 compatibility for users who run Bazel -with Python 2. -""" - -PY_BINARY_VERSION = "PY3" diff --git a/tools/python/private/version.bzl.tools b/tools/python/private/version.bzl.tools deleted file mode 100644 index 5a8b2c86b7ce68..00000000000000 --- a/tools/python/private/version.bzl.tools +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2019 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This is a Bazel-internal file; do not load() it! - -'python_version' value for py_binary and py_test rules in the @bazel_tools -repository. See also "version.bzl", which defines the value for targets in the -Bazel source tree. - -We use PY3 in the source tree because PY2 reaches end of life in December 2019. -Building Bazel requires PY3. - -We use PY2 in @bazel_tools to retain PY2 compatibility for users who run Bazel -with Python 2. -""" - -# TODO(bazel-team): delete this variable and use PY3 everywhere as part of -# fixing https://github.com/bazelbuild/bazel/issues/10127. -PY_BINARY_VERSION = "PY2"