Skip to content

Commit 905af69

Browse files
authored
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.
1 parent d69559d commit 905af69

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

docs/sphinx/BUILD.bazel

+2-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ load("//python:pip.bzl", "compile_pip_requirements")
1717
load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility
1818
load("//python/private:util.bzl", "IS_BAZEL_7_OR_HIGHER") # buildifier: disable=bzl-visibility
1919
load("//sphinxdocs:readthedocs.bzl", "readthedocs_install")
20-
load("//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs", "sphinx_inventory")
20+
load("//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs")
2121
load("//sphinxdocs:sphinx_stardoc.bzl", "sphinx_stardocs")
2222

2323
# We only build for Linux and Mac because:
@@ -38,7 +38,6 @@ _TARGET_COMPATIBLE_WITH = select({
3838
sphinx_docs(
3939
name = "docs",
4040
srcs = [
41-
":bazel_inventory",
4241
":bzl_api_docs",
4342
] + glob(
4443
include = [
@@ -60,19 +59,14 @@ sphinx_docs(
6059
renamed_srcs = {
6160
"//:CHANGELOG.md": "changelog.md",
6261
"//:CONTRIBUTING.md": "contributing.md",
62+
"//sphinxdocs/inventories:bazel_inventory": "bazel_inventory.inv",
6363
},
6464
sphinx = ":sphinx-build",
6565
strip_prefix = package_name() + "/",
6666
tags = ["docs"],
6767
target_compatible_with = _TARGET_COMPATIBLE_WITH,
6868
)
6969

70-
sphinx_inventory(
71-
name = "bazel_inventory",
72-
src = "bazel_inventory.txt",
73-
visibility = ["//:__subpackages__"],
74-
)
75-
7670
sphinx_stardocs(
7771
name = "bzl_api_docs",
7872
docs = {

sphinxdocs/inventories/BUILD.bazel

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 The Bazel Authors. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
load("//sphinxdocs:sphinx.bzl", "sphinx_inventory")
16+
17+
# Inventory for the current Bazel version
18+
sphinx_inventory(
19+
name = "bazel_inventory",
20+
src = "bazel_inventory.txt",
21+
visibility = ["//visibility:public"],
22+
)

docs/sphinx/bazel_inventory.txt renamed to sphinxdocs/inventories/bazel_inventory.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bool bzl:type 1 rules/lib/bool -
1010
int bzl:type 1 rules/lib/int -
1111
depset bzl:type 1 rules/lib/depset -
1212
dict bzl:type 1 rules/lib/dict -
13-
label bzl:type 1 concepts/labels -
13+
label bzl:doc 1 concepts/labels -
1414
attr.bool bzl:type 1 rules/lib/toplevel/attr#bool -
1515
attr.int bzl:type 1 rules/lib/toplevel/attr#int -
1616
attr.label bzl:type 1 rules/lib/toplevel/attr#label -

sphinxdocs/tests/sphinx_stardoc/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ sphinx_docs(
1515
"html",
1616
],
1717
renamed_srcs = {
18-
"//docs/sphinx:bazel_inventory": "bazel_inventory.inv",
18+
"//sphinxdocs/inventories:bazel_inventory": "bazel_inventory.inv",
1919
},
2020
sphinx = ":sphinx-build",
2121
strip_prefix = package_name() + "/",

0 commit comments

Comments
 (0)