From 51aab9be78afb22b1d87dc1e3cb0fb3e9f1e639b Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 2 Nov 2023 19:32:53 +0000 Subject: [PATCH 1/2] Move python dep to upstream rules_python Signed-off-by: Michael Carroll --- lint/BUILD.bazel | 11 +++++------ lint/bazel_lint.bzl | 6 +++--- skylark/BUILD.bazel | 8 +------- skylark/build_defs.bzl | 1 + 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/lint/BUILD.bazel b/lint/BUILD.bazel index 4f00122..9f9af07 100644 --- a/lint/BUILD.bazel +++ b/lint/BUILD.bazel @@ -1,13 +1,12 @@ -package(default_visibility = ["//visibility:public"]) - -load("@gz//bazel/lint:lint.bzl", "add_lint_tests") load( - "@gz//bazel/skylark:gz_py.bzl", + "@gz//bazel/skylark:build_defs.bzl", + "add_lint_tests", "gz_py_binary", - "gz_py_library", - "gz_py_unittest", + "gz_py_library" ) +package(default_visibility = ["//visibility:public"]) + gz_py_library( name = "find_data", srcs = ["find_data.py"], diff --git a/lint/bazel_lint.bzl b/lint/bazel_lint.bzl index 49b0fd9..c3b1625 100644 --- a/lint/bazel_lint.bzl +++ b/lint/bazel_lint.bzl @@ -1,7 +1,7 @@ # -*- mode: python -*- # vi: set ft=python : -load("@gz//bazel/skylark:gz_py.bzl", "py_test_isolated") +load("@rules_python//python:defs.bzl", "py_test") #------------------------------------------------------------------------------ # Internal helper; set up test given name and list of files. Will do nothing @@ -17,7 +17,7 @@ def _bazel_lint(name, files, ignore): ignores_as_arg = ["--ignore=" + ",".join(ignores)] locations = ["$(locations %s)" % f for f in files] - py_test_isolated( + py_test( name = name + "_codestyle", size = "small", srcs = ["@gz//bazel/lint:bzlcodestyle"], @@ -27,7 +27,7 @@ def _bazel_lint(name, files, ignore): tags = ["bzlcodestyle", "lint"], ) - py_test_isolated( + py_test( name = name + "_buildifier", size = "small", srcs = ["@gz//bazel/lint:buildifier"], diff --git a/skylark/BUILD.bazel b/skylark/BUILD.bazel index ae7767b..3558e69 100644 --- a/skylark/BUILD.bazel +++ b/skylark/BUILD.bazel @@ -1,12 +1,6 @@ # -*- python -*- -load("@gz//bazel/skylark:gz_py.bzl", "gz_py_binary") - -# Used by :python_env.bzl. -config_setting( - name = "linux", - values = {"cpu": "k8"}, -) +load(":build_defs.bzl", "gz_py_binary") gz_py_binary( name = "gz_configure_file", diff --git a/skylark/build_defs.bzl b/skylark/build_defs.bzl index 64086d8..ad1b200 100644 --- a/skylark/build_defs.bzl +++ b/skylark/build_defs.bzl @@ -40,6 +40,7 @@ GZ_FEATURES = [ cmake_configure_file = _cmake_configure_file gz_configure_header = _gz_configure_header +gz_configure_file = _gz_configure_header gz_export_header = _gz_export_header gz_include_header = _gz_include_header add_lint_tests = _add_lint_tests From 3eb59056a54daf291c5997d466cf6b12c2d21dec Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 2 Nov 2023 19:42:03 +0000 Subject: [PATCH 2/2] Lint Signed-off-by: Michael Carroll --- lint/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint/BUILD.bazel b/lint/BUILD.bazel index 9f9af07..244a914 100644 --- a/lint/BUILD.bazel +++ b/lint/BUILD.bazel @@ -2,7 +2,7 @@ load( "@gz//bazel/skylark:build_defs.bzl", "add_lint_tests", "gz_py_binary", - "gz_py_library" + "gz_py_library", ) package(default_visibility = ["//visibility:public"])