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
65 lines (58 loc) · 1.8 KB
/
BUILD.bazel
File metadata and controls
65 lines (58 loc) · 1.8 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
load("//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
load("//sphinxdocs:sphinx_stardoc.bzl", "sphinx_stardocs")
load("//sphinxdocs/private:util.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility
package(default_visibility = ["//sphinxdocs:__subpackages__"])
# 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"],
}) if BZLMOD_ENABLED else ["@platforms//:incompatible"]
sphinx_docs_library(
name = "docs_lib",
visibility = ["//visibility:public"],
deps = [
":artisian_api_docs",
":bzl_docs",
":py_api_srcs",
":regular_docs",
],
)
sphinx_docs_library(
name = "regular_docs",
srcs = glob(
["**/*.md"],
exclude = ["api/**"],
),
prefix = "sphinxdocs/",
)
sphinx_docs_library(
name = "artisian_api_docs",
srcs = glob(
["api/**/*.md"],
),
prefix = "api/sphinxdocs/",
strip_prefix = "sphinxdocs/docs/api/",
)
sphinx_stardocs(
name = "bzl_docs",
srcs = [
"//sphinxdocs:readthedocs_bzl",
"//sphinxdocs:sphinx_bzl",
"//sphinxdocs:sphinx_docs_library_bzl",
"//sphinxdocs:sphinx_stardoc_bzl",
"//sphinxdocs/private:sphinx_docs_library_bzl",
],
prefix = "api/sphinxdocs/",
target_compatible_with = _TARGET_COMPATIBLE_WITH,
)
sphinx_docs_library(
name = "py_api_srcs",
srcs = ["//sphinxdocs/src/sphinx_bzl"],
strip_prefix = "sphinxdocs/src/",
)