Skip to content

Commit dcf98b2

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 5ab633f commit dcf98b2

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_library", "py_binary")
2-
load("//tools/python:private/version.bzl", "PY_BINARY_VERSION")
32

43
package(default_visibility = ["//visibility:public"])
54

@@ -277,21 +276,18 @@ alias(
277276
py_binary(
278277
name = "instrumentation_test_check",
279278
srcs = ["instrumentation_test_check.py"],
280-
python_version = PY_BINARY_VERSION,
281279
deps = ["//third_party/py/abseil"],
282280
)
283281

284282
py_binary(
285283
name = "build_incremental_dexmanifest",
286284
srcs = [":build_incremental_dexmanifest.py"],
287-
python_version = PY_BINARY_VERSION,
288285
deps = [],
289286
)
290287

291288
py_binary(
292289
name = "build_split_manifest",
293290
srcs = ["build_split_manifest.py"],
294-
python_version = PY_BINARY_VERSION,
295291
deps = [
296292
"//third_party/py/abseil",
297293
],
@@ -300,7 +296,6 @@ py_binary(
300296
py_binary(
301297
name = "incremental_install",
302298
srcs = ["incremental_install.py"],
303-
python_version = PY_BINARY_VERSION,
304299
deps = [
305300
"//third_party/py/concurrent:futures",
306301
"//third_party/py/abseil",
@@ -310,7 +305,6 @@ py_binary(
310305
py_binary(
311306
name = "strip_resources",
312307
srcs = ["strip_resources.py"],
313-
python_version = PY_BINARY_VERSION,
314308
deps = [
315309
"//third_party/py/abseil",
316310
],
@@ -321,7 +315,6 @@ py_binary(
321315
srcs = [
322316
"aar_native_libs_zip_creator.py",
323317
],
324-
python_version = PY_BINARY_VERSION,
325318
deps = [
326319
":junction_lib",
327320
"//third_party/py/abseil",
@@ -331,7 +324,6 @@ py_binary(
331324
py_binary(
332325
name = "stubify_manifest",
333326
srcs = ["stubify_manifest.py"],
334-
python_version = PY_BINARY_VERSION,
335327
deps = [
336328
"//third_party/py/abseil",
337329
],
@@ -340,7 +332,6 @@ py_binary(
340332
py_binary(
341333
name = "aar_embedded_jars_extractor",
342334
srcs = ["aar_embedded_jars_extractor.py"],
343-
python_version = PY_BINARY_VERSION,
344335
deps = [
345336
":junction_lib",
346337
"//third_party/py/abseil",
@@ -350,7 +341,6 @@ py_binary(
350341
py_binary(
351342
name = "aar_resources_extractor",
352343
srcs = ["aar_resources_extractor.py"],
353-
python_version = PY_BINARY_VERSION,
354344
deps = [
355345
":junction_lib",
356346
"//third_party/py/abseil",
@@ -360,7 +350,6 @@ py_binary(
360350
py_binary(
361351
name = "resource_extractor",
362352
srcs = ["resource_extractor.py"],
363-
python_version = PY_BINARY_VERSION,
364353
)
365354

366355
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)