From 2f2baa54f03e5c37a2aefa7eea81ee68a89df24f Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius Date: Mon, 3 Apr 2023 14:49:19 +0900 Subject: [PATCH 1/2] fix: correct the labels returned by all_requirements lists This apparently was not working to begin with, but the CI running the example did not catch it. Tested with: ``` bazel build ... bazel run //:gazelle ``` --- python/pip_install/pip_repository.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pip_install/pip_repository.bzl b/python/pip_install/pip_repository.bzl index 733142ba92..fce0dcdd47 100644 --- a/python/pip_install/pip_repository.bzl +++ b/python/pip_install/pip_repository.bzl @@ -370,11 +370,11 @@ def _pip_repository_bzlmod_impl(rctx): rctx.file("BUILD.bazel", build_contents) rctx.template("requirements.bzl", rctx.attr._template, substitutions = { "%%ALL_REQUIREMENTS%%": _format_repr_list([ - "@@{}//{}".format(repo_name, p) if rctx.attr.incompatible_generate_aliases else "@{}_{}//:pkg".format(rctx.attr.name, p) + "@{}//{}".format(repo_name, p) if rctx.attr.incompatible_generate_aliases else "@{}_{}//:pkg".format(rctx.attr.name, p) for p in bzl_packages ]), "%%ALL_WHL_REQUIREMENTS%%": _format_repr_list([ - "@@{}//{}:whl".format(repo_name, p) if rctx.attr.incompatible_generate_aliases else "@{}_{}//:whl".format(rctx.attr.name, p) + "@{}//{}:whl".format(repo_name, p) if rctx.attr.incompatible_generate_aliases else "@{}_{}//:whl".format(rctx.attr.name, p) for p in bzl_packages ]), "%%NAME%%": rctx.attr.name, From 4c7bc9169c7c57647362758a401d7139723be5da Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius Date: Tue, 4 Apr 2023 11:02:02 +0900 Subject: [PATCH 2/2] fix: add an empty WORKSPACE.bzlmod file --- examples/build_file_generation/WORKSPACE.bzlmod | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 examples/build_file_generation/WORKSPACE.bzlmod diff --git a/examples/build_file_generation/WORKSPACE.bzlmod b/examples/build_file_generation/WORKSPACE.bzlmod new file mode 100644 index 0000000000..721e065154 --- /dev/null +++ b/examples/build_file_generation/WORKSPACE.bzlmod @@ -0,0 +1,2 @@ +# This file will be used when bzlmod is enabled, keep it empty +# to ensure that all of the setup is done in MODULE.bazel