docs: move Sphinx object inventory for Bazel under sphinxdocs (#2117)
This moves the inventory file for Bazel objects under the sphinxdocs
directory. Inventory
files are the manifest of things that can be cross referenced from some
external source.
They're moved under sphinxdocs since these are about Bazel in general
and aren't specific
to rules_python.
diff --git a/docs/sphinx/BUILD.bazel b/docs/sphinx/BUILD.bazel
index fe0da1f..b582606 100644
--- a/docs/sphinx/BUILD.bazel
+++ b/docs/sphinx/BUILD.bazel
@@ -17,7 +17,7 @@
load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility
load("//python/private:util.bzl", "IS_BAZEL_7_OR_HIGHER") # buildifier: disable=bzl-visibility
load("//sphinxdocs:readthedocs.bzl", "readthedocs_install")
-load("//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs", "sphinx_inventory")
+load("//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs")
load("//sphinxdocs:sphinx_stardoc.bzl", "sphinx_stardocs")
# We only build for Linux and Mac because:
@@ -38,7 +38,6 @@
sphinx_docs(
name = "docs",
srcs = [
- ":bazel_inventory",
":bzl_api_docs",
] + glob(
include = [
@@ -60,6 +59,7 @@
renamed_srcs = {
"//:CHANGELOG.md": "changelog.md",
"//:CONTRIBUTING.md": "contributing.md",
+ "//sphinxdocs/inventories:bazel_inventory": "bazel_inventory.inv",
},
sphinx = ":sphinx-build",
strip_prefix = package_name() + "/",
@@ -67,12 +67,6 @@
target_compatible_with = _TARGET_COMPATIBLE_WITH,
)
-sphinx_inventory(
- name = "bazel_inventory",
- src = "bazel_inventory.txt",
- visibility = ["//:__subpackages__"],
-)
-
sphinx_stardocs(
name = "bzl_api_docs",
docs = {
diff --git a/sphinxdocs/inventories/BUILD.bazel b/sphinxdocs/inventories/BUILD.bazel
new file mode 100644
index 0000000..9ed7698
--- /dev/null
+++ b/sphinxdocs/inventories/BUILD.bazel
@@ -0,0 +1,22 @@
+# Copyright 2024 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("//sphinxdocs:sphinx.bzl", "sphinx_inventory")
+
+# Inventory for the current Bazel version
+sphinx_inventory(
+ name = "bazel_inventory",
+ src = "bazel_inventory.txt",
+ visibility = ["//visibility:public"],
+)
diff --git a/docs/sphinx/bazel_inventory.txt b/sphinxdocs/inventories/bazel_inventory.txt
similarity index 96%
rename from docs/sphinx/bazel_inventory.txt
rename to sphinxdocs/inventories/bazel_inventory.txt
index c4aaabc..a7f0222 100644
--- a/docs/sphinx/bazel_inventory.txt
+++ b/sphinxdocs/inventories/bazel_inventory.txt
@@ -10,7 +10,7 @@
int bzl:type 1 rules/lib/int -
depset bzl:type 1 rules/lib/depset -
dict bzl:type 1 rules/lib/dict -
-label bzl:type 1 concepts/labels -
+label bzl:doc 1 concepts/labels -
attr.bool bzl:type 1 rules/lib/toplevel/attr#bool -
attr.int bzl:type 1 rules/lib/toplevel/attr#int -
attr.label bzl:type 1 rules/lib/toplevel/attr#label -
diff --git a/sphinxdocs/tests/sphinx_stardoc/BUILD.bazel b/sphinxdocs/tests/sphinx_stardoc/BUILD.bazel
index b03561b..b141e5f 100644
--- a/sphinxdocs/tests/sphinx_stardoc/BUILD.bazel
+++ b/sphinxdocs/tests/sphinx_stardoc/BUILD.bazel
@@ -15,7 +15,7 @@
"html",
],
renamed_srcs = {
- "//docs/sphinx:bazel_inventory": "bazel_inventory.inv",
+ "//sphinxdocs/inventories:bazel_inventory": "bazel_inventory.inv",
},
sphinx = ":sphinx-build",
strip_prefix = package_name() + "/",