Skip to content

Commit bed4556

Browse files
committed
cleanup
1 parent 34e1cde commit bed4556

File tree

6 files changed

+6
-15
lines changed

6 files changed

+6
-15
lines changed

docs/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ sphinx_docs(
7070
strip_prefix = package_name() + "/",
7171
tags = ["docs"],
7272
target_compatible_with = _TARGET_COMPATIBLE_WITH,
73+
use_persistent_workers = True,
7374
deps = [
7475
":bzl_api_docs",
7576
":py_api_srcs",

sphinxdocs/private/sphinx.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ def _run_sphinx(ctx, format, source_path, inputs, output_prefix, use_persistent_
269269
run_args = [] # Copy of the args to forward along to debug runner
270270
args = ctx.actions.args() # Args passed to the action
271271

272+
# NOTE: sphinx_build.py relies on the first two args being the srcdir and
273+
# outputdir, in that order.
272274
args.add(source_path)
273275
args.add(output_dir.path)
274276

sphinxdocs/private/sphinx_build.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
import argparse
21
import contextlib
32
import io
43
import json
54
import logging
65
import os
7-
import pathlib
86
import shutil
97
import sys
10-
import time
118
import traceback
129
import typing
13-
from pathlib import Path
1410

1511
import sphinx.application
1612
from sphinx.cmd.build import main
@@ -34,8 +30,8 @@ def __init__(
3430
# Bazel send worker stderr to the worker log file.
3531
# outputBase=$(bazel info output_base)
3632
# find $outputBase/bazel-workers/ -type f -printf '%T@ %p\n' | sort -n | tail -1 | awk '{print $2}'
37-
logging.basicConfig(level=logging.DEBUG)
38-
logger.info("initializing worker")
33+
logging.basicConfig(level=logging.WARN)
34+
logger.info("Initializing worker")
3935

4036
# The directory that paths are relative to.
4137
self._exec_root = exec_root
@@ -114,12 +110,6 @@ def _prepare_sphinx(self, request):
114110
for entry in request["inputs"]:
115111
path = entry["path"]
116112
digest = entry["digest"]
117-
118-
##mtime = pathlib.Path(path).stat().st_mtime
119-
##logger.info("incoming path %s mtime: %s", path, mtime)
120-
### Sphinx appears to treat 0 mtime as always changed
121-
##os.utime(path, (100, 100))
122-
123113
# Make the path srcdir-relative so Sphinx understands it.
124114
path = path.removeprefix(srcdir + "/")
125115
incoming_digests[path] = digest

sphinxdocs/tests/sphinx_docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# -- Project info
77

8-
project = "Sphinx Docs Test xx"
8+
project = "Sphinx Docs Test"
99

1010
extensions = [
1111
"myst_parser",
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# doc1
22

33
hello doc 1
4-
x
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# doc 2
22

3-
43
hello doc 3

0 commit comments

Comments
 (0)