Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Python 2 configuration and targets #1006

Merged
merged 6 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .bazelci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,13 @@ tasks:
- "--experimental_enable_aggregating_middleman=False"
min_supported_version_examples:
name: "Minimum Supported Version Examples"
bazel: "4.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically bazel 4 is still under LTS support until the end of this year and so I'd rather that we just disable the failing tests and keep this at 4 as the rest of these changes only affect the examples / tests and don't change the ability of this ruleset to continue support v4.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I restored 4.0 as the min version.

I'll try my hand at modifying the config.yaml to skip the offending tests, but I might come back asking for some help on how to do so. (If you happen to have a link that explains these bazelci config files, that'd be great; the only thing i've found is https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/README.md which doesn't explain many of the things i see or how to use them).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I think I figured it out.

Ready for another look

bazel: "5.0.0"
platform: ubuntu1804
working_directory: examples
min_supported_targets: &min_supported_targets
- "//..."
build_targets: *min_supported_targets
# See comment above regarding --experimental_enable_aggregating_middleman=False
build_flags:
- "--experimental_enable_aggregating_middleman=False"
test_targets: *min_supported_targets
test_flags:
- "--experimental_enable_aggregating_middleman=False"

buildifier:
version: "5.1.0"
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