Skip to content

Commit

Permalink
refactor: Load rules_python content from proper locations
Browse files Browse the repository at this point in the history
Loading all public symbols from `<language>/defs.bzl` is a deprecated
approach for language rules. More fine grained loading prevents Bazel
analyzing things unrelated to what one actually is interested in.
We do this now to be consistent to how we use `rules_cc`.
  • Loading branch information
martis42 committed Dec 16, 2024
1 parent f46cb90 commit 5ab007a
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion scripts/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_python//python:py_binary.bzl", "py_binary")

py_binary(
name = "extract_std_headers",
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_python//python:defs.bzl", "py_test")
load("@rules_python//python:py_test.bzl", "py_test")

py_test(
name = "extract_std_headers_test",
Expand Down
3 changes: 2 additions & 1 deletion src/analyze_includes/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
load("@rules_python//python:py_binary.bzl", "py_binary")
load("@rules_python//python:py_library.bzl", "py_library")

py_library(
name = "lib",
Expand Down
2 changes: 1 addition & 1 deletion src/analyze_includes/test/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_python//python:defs.bzl", "py_test")
load("@rules_python//python:py_test.bzl", "py_test")

py_test(
name = "evaluate_includes_test",
Expand Down
3 changes: 2 additions & 1 deletion src/apply_fixes/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
load("@rules_python//python:py_binary.bzl", "py_binary")
load("@rules_python//python:py_library.bzl", "py_library")

py_library(
name = "lib",
Expand Down
2 changes: 1 addition & 1 deletion src/apply_fixes/test/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_python//python:defs.bzl", "py_test")
load("@rules_python//python:py_test.bzl", "py_test")

py_test(
name = "bazel_query_test",
Expand Down
2 changes: 1 addition & 1 deletion src/aspect/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_python//python:py_binary.bzl", "py_binary")

py_binary(
name = "process_target",
Expand Down
2 changes: 1 addition & 1 deletion test/aspect/tree_artifact/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_python//python:py_binary.bzl", "py_binary")
load(":create_tree_artifact.bzl", "create_tree_artifacts")

py_binary(
Expand Down
2 changes: 1 addition & 1 deletion third_party/pcpp/pcpp.BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_python//python:defs.bzl", "py_library")
load("@rules_python//python:py_library.bzl", "py_library")

py_library(
name = "pcpp",
Expand Down

0 comments on commit 5ab007a

Please sign in to comment.