forked from bazel-contrib/rules_python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBUILD.bazel
More file actions
44 lines (39 loc) · 1.15 KB
/
BUILD.bazel
File metadata and controls
44 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs")
load(":defs.bzl", "gen_directory")
# We only build for Linux and Mac because:
# 1. The actual doc process only runs on Linux
# 2. Mac is a common development platform, and is close enough to Linux
# it's feasible to make work.
# Making CI happy under Windows is too much of a headache, though, so we don't
# bother with that.
_TARGET_COMPATIBLE_WITH = select({
"@platforms//os:linux": [],
"@platforms//os:macos": [],
"//conditions:default": ["@platforms//:incompatible"],
})
sphinx_docs(
name = "docs",
srcs = glob(["*.md"]) + [
":generated_directory",
],
config = "conf.py",
formats = ["html"],
sphinx = ":sphinx-build",
target_compatible_with = _TARGET_COMPATIBLE_WITH,
)
gen_directory(
name = "generated_directory",
)
sphinx_build_binary(
name = "sphinx-build",
tags = ["manual"], # Only needed as part of sphinx doc building
deps = [
"@dev_pip//myst_parser",
"@dev_pip//sphinx",
],
)
build_test(
name = "docs_build_test",
targets = [":docs"],
)