Skip to content

Commit fbfa598

Browse files
committed
Fix #10127: Remove Python 2 dependency from tools/android.
A couple of files still specified PY2 as their python_version. This fails on modern systems that do not ship Python 2 anymore, or at least do not install it by default (like Ubuntu 20.04).
1 parent 20dab69 commit fbfa598

File tree

6 files changed

+1
-79
lines changed

6 files changed

+1
-79
lines changed

tools/android/BUILD.tools

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
load("//tools/python:private/defs.bzl", "py_binary", "py_library")
2-
load("//tools/python:private/version.bzl", "PY_BINARY_VERSION")
32
load(":defs.bzl", "run_ijar", "run_singlejar")
43

54
package(default_visibility = ["//visibility:public"])
@@ -269,21 +268,18 @@ alias(
269268
py_binary(
270269
name = "instrumentation_test_check",
271270
srcs = ["instrumentation_test_check.py"],
272-
python_version = PY_BINARY_VERSION,
273271
deps = ["//third_party/py/abseil"],
274272
)
275273

276274
py_binary(
277275
name = "build_incremental_dexmanifest",
278276
srcs = [":build_incremental_dexmanifest.py"],
279-
python_version = PY_BINARY_VERSION,
280277
deps = [],
281278
)
282279

283280
py_binary(
284281
name = "build_split_manifest",
285282
srcs = ["build_split_manifest.py"],
286-
python_version = PY_BINARY_VERSION,
287283
deps = [
288284
"//third_party/py/abseil",
289285
],
@@ -292,7 +288,6 @@ py_binary(
292288
py_binary(
293289
name = "incremental_install",
294290
srcs = ["incremental_install.py"],
295-
python_version = PY_BINARY_VERSION,
296291
deps = [
297292
"//third_party/py/abseil",
298293
"//third_party/py/concurrent:futures",
@@ -302,7 +297,6 @@ py_binary(
302297
py_binary(
303298
name = "strip_resources",
304299
srcs = ["strip_resources.py"],
305-
python_version = PY_BINARY_VERSION,
306300
deps = [
307301
"//third_party/py/abseil",
308302
],
@@ -313,7 +307,6 @@ py_binary(
313307
srcs = [
314308
"aar_native_libs_zip_creator.py",
315309
],
316-
python_version = PY_BINARY_VERSION,
317310
deps = [
318311
":junction_lib",
319312
"//third_party/py/abseil",
@@ -323,7 +316,6 @@ py_binary(
323316
py_binary(
324317
name = "stubify_manifest",
325318
srcs = ["stubify_manifest.py"],
326-
python_version = PY_BINARY_VERSION,
327319
deps = [
328320
"//third_party/py/abseil",
329321
],
@@ -332,7 +324,6 @@ py_binary(
332324
py_binary(
333325
name = "aar_embedded_jars_extractor",
334326
srcs = ["aar_embedded_jars_extractor.py"],
335-
python_version = PY_BINARY_VERSION,
336327
deps = [
337328
":junction_lib",
338329
"//third_party/py/abseil",
@@ -342,7 +333,6 @@ py_binary(
342333
py_binary(
343334
name = "aar_resources_extractor",
344335
srcs = ["aar_resources_extractor.py"],
345-
python_version = PY_BINARY_VERSION,
346336
deps = [
347337
":junction_lib",
348338
"//third_party/py/abseil",
@@ -352,7 +342,6 @@ py_binary(
352342
py_binary(
353343
name = "resource_extractor",
354344
srcs = ["resource_extractor.py"],
355-
python_version = PY_BINARY_VERSION,
356345
)
357346

358347
py_library(

tools/build_defs/pkg/BUILD

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
load("//tools/build_defs/pkg:pkg.bzl", "pkg_deb", "pkg_tar")
33
load("//tools/config:common_settings.bzl", "bool_flag")
44
load("//tools/python:private/defs.bzl", "py_binary", "py_library", "py_test")
5-
load("//tools/python:private/version.bzl", "PY_BINARY_VERSION")
65

76
licenses(["notice"]) # Apache 2.0
87

@@ -43,7 +42,6 @@ py_test(
4342
"testenv.py",
4443
],
4544
data = [":archive_testdata"],
46-
python_version = PY_BINARY_VERSION,
4745
srcs_version = "PY2AND3",
4846
tags = [
4947
# archive.py requires xzcat, which is not available by default on Mac
@@ -64,7 +62,6 @@ py_test(
6462
py_binary(
6563
name = "build_tar",
6664
srcs = ["build_tar.py"],
67-
python_version = PY_BINARY_VERSION,
6865
srcs_version = "PY2AND3",
6966
visibility = ["//visibility:public"],
7067
deps = [
@@ -79,7 +76,6 @@ py_binary(
7976
deprecation = "The internal version of make_deb is deprecated. Please " +
8077
"use the replacement for pkg_deb from " +
8178
"https://github.com/bazelbuild/rules_pkg/blob/master/pkg.",
82-
python_version = PY_BINARY_VERSION,
8379
srcs_version = "PY2AND3",
8480
visibility = ["//visibility:public"],
8581
deps = [

tools/python/BUILD

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ filegroup(
1212

1313
filegroup(
1414
name = "embedded_tools",
15-
srcs = glob(
16-
["**"],
17-
exclude = ["private/version.bzl"],
18-
) + [
15+
srcs = glob(["**"]) + [
1916
"//tools/python/runfiles:embedded_tools",
2017
],
2118
visibility = ["//tools:__pkg__"],

tools/python/BUILD.tools

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ exports_files([
5454
"utils.bzl",
5555
"private/defs.bzl",
5656
"private/py_test_alias.bzl",
57-
"private/version.bzl",
5857
# write_file.bzl fortunately doesn't need to be exposed because it's only
5958
# used in this BUILD file.
6059
])
@@ -64,7 +63,6 @@ filegroup(
6463
srcs = glob(["*.bzl"]) + [
6564
"private/defs.bzl",
6665
"private/py_test_alias.bzl",
67-
"private/version.bzl",
6866
],
6967
visibility = ["//tools:__pkg__"],
7068
)

tools/python/private/version.bzl

Lines changed: 0 additions & 28 deletions
This file was deleted.

tools/python/private/version.bzl.tools

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)