@@ -103,7 +103,7 @@ def sphinx_docs(
103103        strip_prefix  =  "" ,
104104        extra_opts  =  [],
105105        tools  =  [],
106-         use_persistent_workers  =  False ,
106+         allow_persistent_workers  =  True ,
107107        ** kwargs ):
108108    """Generate docs using Sphinx. 
109109
@@ -143,8 +143,9 @@ def sphinx_docs(
143143        tools: {type}`list[label]` Additional tools that are used by Sphinx and its plugins. 
144144            This just makes the tools available during Sphinx execution. To locate 
145145            them, use {obj}`extra_opts` and `$(location)`. 
146-         use_persistent_workers: {type}`bool` (experimental) If enable, use a persistent 
147-             worker to run Sphinx for improved incremental, caching, and startup performance. 
146+         allow_persistent_workers: {type}`bool` (experimental) If true, allow 
147+             using persistent workers for running Sphinx, if Bazel decides to do so. 
148+             This can improve incremental building of docs. 
148149        **kwargs: {type}`dict` Common attributes to pass onto rules. 
149150    """ 
150151    add_tag (kwargs , "@rules_python//sphinxdocs:sphinx_docs" )
@@ -168,7 +169,7 @@ def sphinx_docs(
168169        source_tree  =  internal_name  +  "/_sources" ,
169170        extra_opts  =  extra_opts ,
170171        tools  =  tools ,
171-         use_persistent_workers  =  use_persistent_workers ,
172+         allow_persistent_workers  =  allow_persistent_workers ,
172173        ** kwargs 
173174    )
174175
@@ -213,7 +214,7 @@ def _sphinx_docs_impl(ctx):
213214            source_path  =  source_dir_path ,
214215            output_prefix  =  paths .join (ctx .label .name , "_build" ),
215216            inputs  =  inputs ,
216-             use_persistent_workers  =  ctx .attr .use_persistent_workers ,
217+             allow_persistent_workers  =  ctx .attr .allow_persistent_workers ,
217218        )
218219        outputs [format ] =  output_dir 
219220        per_format_args [format ] =  args_env 
@@ -253,7 +254,7 @@ _sphinx_docs = rule(
253254            cfg  =  "exec" ,
254255            doc  =  "Additional tools that are used by Sphinx and its plugins." ,
255256        ),
256-         "use_persistent_workers " : attr .bool (
257+         "allow_persistent_workers " : attr .bool (
257258            doc  =  "(experimental) Whether to invoke Sphinx as a persistent worker." ,
258259            default  =  False ,
259260        ),
@@ -263,7 +264,7 @@ _sphinx_docs = rule(
263264    },
264265)
265266
266- def  _run_sphinx (ctx , format , source_path , inputs , output_prefix , use_persistent_workers ):
267+ def  _run_sphinx (ctx , format , source_path , inputs , output_prefix , allow_persistent_workers ):
267268    output_dir  =  ctx .actions .declare_directory (paths .join (output_prefix , format ))
268269
269270    run_args  =  []  # Copy of the args to forward along to debug runner 
@@ -326,7 +327,7 @@ def _run_sphinx(ctx, format, source_path, inputs, output_prefix, use_persistent_
326327    # requirements and disable workers. Thus, we can't assume that these 
327328    # exec requirements will actually be respected. 
328329    execution_requirements  =  {}
329-     if  use_persistent_workers :
330+     if  allow_persistent_workers :
330331        execution_requirements ["supports-workers" ] =  "1" 
331332        execution_requirements ["requires-worker-protocol" ] =  "json" 
332333
0 commit comments