Skip to content

Commit a497e69

Browse files
committed
revert to using a previous version of the bazel integration test rules and use our shell script to update deleted pkgs
1 parent dfcb8c3 commit a497e69

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# This lets us glob() up all the files inside the examples to make them inputs to tests
44
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
55
# To update these lines, execute
6-
# `bazel run @rules_bazel_integration_test//tools:update_deleted_packages`
7-
common --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/examples/bzlmod_build_file_generation,gazelle/examples/bzlmod_build_file_generation/other_module/other_module/pkg,gazelle/examples/bzlmod_build_file_generation/runfiles,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/python/private,gazelle/pythonconfig,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/custom_commands,tests/integration/local_toolchains,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered,tests/modules/another_module,tests/modules/other,tests/modules/other/nspkg_delta,tests/modules/other/nspkg_gamma,tests/modules/other/nspkg_single,tests/modules/other/simple_v1,tests/modules/other/simple_v2,tests/modules/other/with_external_data,tests/whl_with_build_files/testdata,tests/whl_with_build_files/testdata/somepkg,tests/whl_with_build_files/testdata/somepkg-1.0.dist-info,tests/whl_with_build_files/testdata/somepkg/subpkg
6+
# `./tools/update_deleted_packages.sh`
7+
common --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/py_proto_library/foo_external,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/custom_commands,tests/integration/local_toolchains,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered,tests/modules/another_module,tests/modules/other,tests/modules/other/nspkg_delta,tests/modules/other/nspkg_gamma,tests/modules/other/nspkg_single,tests/modules/other/simple_v1,tests/modules/other/simple_v2,tests/modules/other/with_external_data
88

99
test --test_output=errors
1010

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ repos:
4848
language: system
4949
# 7.x is necessary until https://github.com/bazel-contrib/rules_bazel_integration_test/pull/414
5050
# is merged and released
51-
entry: bazel run @rules_bazel_integration_test//tools:update_deleted_packages --exclude_dir gazelle/docs
51+
entry: ./tools/update_deleted_packages.sh
5252
files: ^((examples|tests)/.*/(MODULE.bazel|WORKSPACE|WORKSPACE.bzlmod|BUILD.bazel)|.bazelrc)$
5353
pass_filenames: false

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ use_repo(pip, "rules_python_publish_deps")
215215
bazel_dep(name = "stardoc", version = "0.7.2", repo_name = "io_bazel_stardoc")
216216

217217
# ===== DEV ONLY DEPS AND SETUP BELOW HERE =====
218-
bazel_dep(name = "rules_bazel_integration_test", version = "0.34.0", dev_dependency = True)
218+
bazel_dep(name = "rules_bazel_integration_test", version = "0.27.0", dev_dependency = True)
219219
bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
220220
bazel_dep(name = "rules_shell", version = "0.3.0", dev_dependency = True)
221221
bazel_dep(name = "rules_multirun", version = "0.9.0", dev_dependency = True)

tools/update_deleted_packages.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# 2. For each of the directories, get all directories that contains a BUILD.bazel file.
2424
# 3. Sort and remove duplicates.
2525

26-
set -euxo pipefail
26+
set -euo pipefail
2727

2828
DIR="$(dirname $0)/.."
2929
cd $DIR
@@ -35,5 +35,6 @@ sed -i.bak "/^[^#].*--deleted_packages/s#=.*#=$(\
3535
xargs -n 1 -I{} find {} \( -name BUILD -or -name BUILD.bazel \) |
3636
xargs -n 1 dirname |
3737
sort -u |
38+
grep -v 'gazelle/docs' |
3839
paste -sd, -\
3940
)#" $DIR/.bazelrc && rm .bazelrc.bak

0 commit comments

Comments
 (0)