Skip to content

Commit

Permalink
Remove Python 2 configuration and targets (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickeylev authored Jan 27, 2023
1 parent 1e66c02 commit 34fa6a7
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 90 deletions.
3 changes: 3 additions & 0 deletions .bazelci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ tasks:
working_directory: examples
min_supported_targets: &min_supported_targets
- "//..."
# Requires Python 2 under Bazel 4; skip so that Bazel 7 can disable Python 2
# See https://github.com/bazelbuild/bazel/issues/17293
- "-//cmake_android:app"
build_targets: *min_supported_targets
# See comment above regarding --experimental_enable_aggregating_middleman=False
build_flags:
Expand Down
17 changes: 0 additions & 17 deletions examples/third_party/python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@ load("@rules_python//python:defs.bzl", "py_runtime", "py_runtime_pair", "py_test

exports_files(
[
"BUILD.python2.bazel",
"BUILD.python3.bazel",
],
visibility = ["//visibility:public"],
)

py_runtime(
name = "py2_runtime",
files = ["@python2"],
interpreter = "@python2//:python2_bin",
python_version = "PY2",
)

py_runtime(
name = "py3_runtime",
files = ["@python3"],
Expand All @@ -24,7 +16,6 @@ py_runtime(

py_runtime_pair(
name = "py_runtime_pair",
py2_runtime = ":py2_runtime",
py3_runtime = ":py3_runtime",
)

Expand All @@ -34,13 +25,6 @@ toolchain(
toolchain_type = "@rules_python//python:toolchain_type",
)

py_test(
name = "python2_test",
srcs = ["python2_test.py"],
python_version = "PY2",
visibility = ["//:__pkg__"],
)

py_test(
name = "python3_test",
srcs = ["python3_test.py"],
Expand All @@ -51,7 +35,6 @@ py_test(
test_suite(
name = "python_tests",
tests = [
":python2_test",
":python3_test",
],
)
55 changes: 0 additions & 55 deletions examples/third_party/python/BUILD.python2.bazel

This file was deleted.

8 changes: 0 additions & 8 deletions examples/third_party/python/python2_test.py

This file was deleted.

10 changes: 0 additions & 10 deletions examples/third_party/python/python_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

# buildifier: disable=unnamed-macro
def python_repositories():
maybe(
http_archive,
name = "python2",
build_file = Label("//python:BUILD.python2.bazel"),
strip_prefix = "Python-2.7.18",
urls = [
"https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz",
],
sha256 = "da3080e3b488f648a3d7a4560ddee895284c3380b11d6de75edb986526b9a814",
)
maybe(
http_archive,
name = "python3",
Expand Down

0 comments on commit 34fa6a7

Please sign in to comment.