build: change gazelle rules_python override to use bazelrc (#3382)
This is because the `--override_module` flag in BCR presubmit configs
can't affect local_path_override in MODULE.bazel.
Per
https://github.com/bazelbuild/bazel-central-registry/pull/6241#issuecomment-3431422637
diff --git a/gazelle/examples/bzlmod_build_file_generation/.bazelrc b/gazelle/examples/bzlmod_build_file_generation/.bazelrc
index 0289886..d586655 100644
--- a/gazelle/examples/bzlmod_build_file_generation/.bazelrc
+++ b/gazelle/examples/bzlmod_build_file_generation/.bazelrc
@@ -7,3 +7,10 @@
coverage --java_runtime_version=remotejdk_11
common:bazel7.x --incompatible_python_disallow_native_rules
+
+# NOTE: This override is specific to the development of gazelle itself
+# and the testing of it during its BCR release presubmits.
+# In development of gazelle itself, we override it to the development
+# rules_python code. In the BCR presubmits, this override is removed
+# and the bazel_dep version of rules_python is used.
+common --override_module=rules_python=../../../
diff --git a/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel b/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel
index 5ace7f3..d93e606 100644
--- a/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel
+++ b/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel
@@ -15,15 +15,6 @@
# https://github.com/bazel-contrib/rules_python/releases
bazel_dep(name = "rules_python", version = "1.0.0")
-# NOTE: This override is removed for BCR presubmits and the version
-# specified by bazel_dep() is used instead.
-# The following loads rules_python from the file system.
-# For usual setups you should remove this local_path_override block.
-local_path_override(
- module_name = "rules_python",
- path = "../../..",
-)
-
# The following stanza defines the dependency rules_python_gazelle_plugin.
# For typical setups you set the version.
# See the releases page for available versions.