Skip to content

Commit

Permalink
docs: move Sphinx object inventory for Bazel under sphinxdocs (#2117)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rickeylev authored Aug 15, 2024
1 parent d69559d commit 905af69
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
10 changes: 2 additions & 8 deletions docs/sphinx/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ load("//python:pip.bzl", "compile_pip_requirements")
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:
Expand All @@ -38,7 +38,6 @@ _TARGET_COMPATIBLE_WITH = select({
sphinx_docs(
name = "docs",
srcs = [
":bazel_inventory",
":bzl_api_docs",
] + glob(
include = [
Expand All @@ -60,19 +59,14 @@ sphinx_docs(
renamed_srcs = {
"//:CHANGELOG.md": "changelog.md",
"//:CONTRIBUTING.md": "contributing.md",
"//sphinxdocs/inventories:bazel_inventory": "bazel_inventory.inv",
},
sphinx = ":sphinx-build",
strip_prefix = package_name() + "/",
tags = ["docs"],
target_compatible_with = _TARGET_COMPATIBLE_WITH,
)

sphinx_inventory(
name = "bazel_inventory",
src = "bazel_inventory.txt",
visibility = ["//:__subpackages__"],
)

sphinx_stardocs(
name = "bzl_api_docs",
docs = {
Expand Down
22 changes: 22 additions & 0 deletions sphinxdocs/inventories/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bool bzl:type 1 rules/lib/bool -
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 -
Expand Down
2 changes: 1 addition & 1 deletion sphinxdocs/tests/sphinx_stardoc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sphinx_docs(
"html",
],
renamed_srcs = {
"//docs/sphinx:bazel_inventory": "bazel_inventory.inv",
"//sphinxdocs/inventories:bazel_inventory": "bazel_inventory.inv",
},
sphinx = ":sphinx-build",
strip_prefix = package_name() + "/",
Expand Down

0 comments on commit 905af69

Please sign in to comment.