From 25e5eda68ec8e4f13e4162b2ba6e1d9444f3473c Mon Sep 17 00:00:00 2001 From: Douglas Thor Date: Mon, 4 Aug 2025 20:18:33 -0700 Subject: [PATCH] bare minimum for linking modules_mapping --- docs/BUILD.bazel | 6 ++++++ gazelle/docs/installation_and_usage.md | 4 ++-- gazelle/modules_mapping/BUILD.bazel | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index fdb74f9407..46ecd97eeb 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -82,9 +82,15 @@ build_test( targets = [":docs"], ) +alias( + name = "gazelle_modules_mapping_def_bzl", + actual = "@rules_python_gazelle_plugin//modules_mapping:def_bzl", +) + sphinx_stardocs( name = "bzl_api_docs", srcs = [ + ":gazelle_modules_mapping_def_bzl", "//python:defs_bzl", "//python:features_bzl", "//python:packaging_bzl", diff --git a/gazelle/docs/installation_and_usage.md b/gazelle/docs/installation_and_usage.md index e764957581..b510c47f73 100644 --- a/gazelle/docs/installation_and_usage.md +++ b/gazelle/docs/installation_and_usage.md @@ -61,8 +61,8 @@ bazel_dep(name = "rules_python_gazelle_plugin", version = "1.5.1") Next, we'll fetch metadata about your Python dependencies, so that gazelle can determine which package a given import statement comes from. This is provided -by the `modules_mapping` rule. We'll make a target for consuming this -`modules_mapping`, and writing it as a manifest file for Gazelle to read. +by the {bzl:obj}`modules_mapping` rule. We'll make a target for consuming this +{bzl:obj}`modules_mapping`, and writing it as a manifest file for Gazelle to read. This is checked into the repo for speed, as it takes some time to calculate in a large monorepo. diff --git a/gazelle/modules_mapping/BUILD.bazel b/gazelle/modules_mapping/BUILD.bazel index 3a9a8a47f3..20c2eafdf8 100644 --- a/gazelle/modules_mapping/BUILD.bazel +++ b/gazelle/modules_mapping/BUILD.bazel @@ -1,3 +1,4 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@bazel_skylib//rules:copy_file.bzl", "copy_file") load("@rules_python//python:defs.bzl", "py_binary", "py_test") @@ -38,3 +39,9 @@ filegroup( srcs = glob(["**"]), visibility = ["//:__pkg__"], ) + +bzl_library( + name = "def_bzl", + srcs = ["def.bzl"], + visibility = ["//visibility:public"], +)