Skip to content

Commit 411b937

Browse files
authored
refactor: remove gazelle plugin as dev dependency (#3436)
Remove the gazelle pluging as a dev-time dependency of rules_python itself. This is to avoid gazelle-related build issues that affect the main build. The gazelle code paths in tests/integration are removed because they were just test runners being defined, but weren't actually used with any tests.
1 parent 1771677 commit 411b937

File tree

4 files changed

+2
-47
lines changed

4 files changed

+2
-47
lines changed

BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ filegroup(
4545
"version.bzl",
4646
"//python:distribution",
4747
"//tools:distribution",
48-
"@rules_python_gazelle_plugin//:distribution",
4948
],
5049
visibility = [
5150
"//:__subpackages__",

MODULE.bazel

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,6 @@ bazel_dep(name = "another_module", version = "0", dev_dependency = True)
227227
# Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests.
228228
# We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides.
229229
bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
230-
bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True)
231-
bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True, repo_name = "bazel_gazelle")
232230

233231
internal_dev_deps = use_extension(
234232
"//python/private:internal_dev_deps.bzl",
@@ -258,13 +256,6 @@ dev_rules_python_config.add_transition_setting(
258256
setting = "//tests/multi_pypi:external_deps_name",
259257
)
260258

261-
# Add gazelle plugin so that we can run the gazelle example as an e2e integration
262-
# test and include the distribution files.
263-
local_path_override(
264-
module_name = "rules_python_gazelle_plugin",
265-
path = "gazelle",
266-
)
267-
268259
local_path_override(
269260
module_name = "other",
270261
path = "tests/modules/other",

tests/integration/BUILD.bazel

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ _WORKSPACE_FLAGS = [
2323
"--enable_workspace",
2424
]
2525

26-
_WORKSPACE_GAZELLE_PLUGIN_FLAGS = [
27-
"--override_repository=rules_python_gazelle_plugin=../../../rules_python_gazelle_plugin",
28-
]
29-
30-
_GAZELLE_PLUGIN_FLAGS = [
31-
"--override_module=rules_python_gazelle_plugin=../../../rules_python_gazelle_plugin",
32-
]
33-
3426
default_test_runner(
3527
name = "workspace_test_runner",
3628
bazel_cmds = [
@@ -40,31 +32,11 @@ default_test_runner(
4032
visibility = ["//visibility:public"],
4133
)
4234

43-
default_test_runner(
44-
name = "workspace_test_runner_gazelle_plugin",
45-
bazel_cmds = [
46-
"info {}".format(" ".join(_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)),
47-
"test {} //...".format(" ".join(_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)),
48-
],
49-
visibility = ["//visibility:public"],
50-
)
51-
5235
default_test_runner(
5336
name = "test_runner",
5437
visibility = ["//visibility:public"],
5538
)
5639

57-
default_test_runner(
58-
name = "test_runner_gazelle_plugin",
59-
bazel_cmds = [
60-
"info {}".format(" ".join(_GAZELLE_PLUGIN_FLAGS)),
61-
"test {} //...".format(" ".join(_GAZELLE_PLUGIN_FLAGS)),
62-
],
63-
visibility = ["//visibility:public"],
64-
)
65-
66-
# TODO: add compile_pip_requirements_test_from_external_repo
67-
6840
rules_python_integration_test(
6941
name = "compile_pip_requirements_test",
7042
)

tests/integration/integration_test.bzl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ load(
2121
)
2222
load("//python:py_test.bzl", "py_test")
2323

24-
def _test_runner(*, name, bazel_version, py_main, bzlmod, gazelle_plugin):
24+
def _test_runner(*, name, bazel_version, py_main, bzlmod):
2525
if py_main:
2626
test_runner = "{}_bazel_{}_py_runner".format(name, bazel_version)
2727
py_test(
@@ -35,20 +35,15 @@ def _test_runner(*, name, bazel_version, py_main, bzlmod, gazelle_plugin):
3535
)
3636
return test_runner
3737

38-
if bzlmod and gazelle_plugin:
39-
return "//tests/integration:test_runner_gazelle_plugin"
40-
elif bzlmod:
38+
if bzlmod:
4139
return "//tests/integration:test_runner"
42-
elif gazelle_plugin:
43-
return "//tests/integration:workspace_test_runner_gazelle_plugin"
4440
else:
4541
return "//tests/integration:workspace_test_runner"
4642

4743
def rules_python_integration_test(
4844
name,
4945
workspace_path = None,
5046
bzlmod = True,
51-
gazelle_plugin = False,
5247
tags = None,
5348
py_main = None,
5449
bazel_versions = None,
@@ -61,7 +56,6 @@ def rules_python_integration_test(
6156
`_test` suffix.
6257
bzlmod: bool, default True. If true, run with bzlmod enabled, otherwise
6358
disable bzlmod.
64-
gazelle_plugin: Whether the test uses the gazelle plugin.
6559
tags: Test tags.
6660
py_main: Optional `.py` file to run tests using. When specified, a
6761
python based test runner is used, and this source file is the main
@@ -98,7 +92,6 @@ def rules_python_integration_test(
9892
bazel_version = bazel_version,
9993
py_main = py_main,
10094
bzlmod = bzlmod,
101-
gazelle_plugin = gazelle_plugin,
10295
)
10396
bazel_integration_test(
10497
name = "{}_bazel_{}".format(name, bazel_version),

0 commit comments

Comments
 (0)