Skip to content

Commit

Permalink
Remove Python 2 configuration and targets
Browse files Browse the repository at this point in the history
Bazel is dropping support for Python 2

Work towards bazelbuild/bazel#17293
  • Loading branch information
rickeylev committed Jan 27, 2023
1 parent 1e66c02 commit b8690fa
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 90 deletions.
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 b8690fa

Please sign in to comment.