@@ -772,7 +772,9 @@ def _write_serial(self, docnames: Sequence[str]) -> None:
772772 len (docnames ),
773773 self ._app .verbosity ,
774774 ):
775- _write_docname (docname , app = self ._app , env = self .env , builder = self )
775+ _write_docname (
776+ docname , app = self ._app , env = self .env , builder = self , tags = self .tags
777+ )
776778
777779 def _write_parallel (self , docnames : Sequence [str ], nproc : int ) -> None :
778780 def write_process (docs : list [tuple [str , nodes .document ]]) -> None :
@@ -782,7 +784,9 @@ def write_process(docs: list[tuple[str, nodes.document]]) -> None:
782784
783785 # warm up caches/compile templates using the first document
784786 firstname , docnames = docnames [0 ], docnames [1 :]
785- _write_docname (firstname , app = self ._app , env = self .env , builder = self )
787+ _write_docname (
788+ firstname , app = self ._app , env = self .env , builder = self , tags = self .tags
789+ )
786790
787791 tasks = ParallelTasks (nproc )
788792 chunks = make_chunks (docnames , nproc )
@@ -804,7 +808,9 @@ def on_chunk_done(args: list[tuple[str, nodes.document]], result: None) -> None:
804808 for chunk in chunks :
805809 arg = []
806810 for docname in chunk :
807- doctree = self .env .get_and_resolve_doctree (docname , self )
811+ doctree = self .env .get_and_resolve_doctree (
812+ docname , self , tags = self .tags
813+ )
808814 self .write_doc_serialized (docname , doctree )
809815 arg .append ((docname , doctree ))
810816 tasks .add_task (write_process , arg , on_chunk_done )
@@ -871,11 +877,17 @@ def get_builder_config(self, option: str, default: str) -> Any:
871877
872878
873879def _write_docname (
874- docname : str , / , * , app : Sphinx , env : BuildEnvironment , builder : Builder
880+ docname : str ,
881+ / ,
882+ * ,
883+ app : Sphinx ,
884+ env : BuildEnvironment ,
885+ builder : Builder ,
886+ tags : Tags ,
875887) -> None :
876888 """Write a single document."""
877889 app .phase = BuildPhase .RESOLVING
878- doctree = env .get_and_resolve_doctree (docname , builder = builder )
890+ doctree = env .get_and_resolve_doctree (docname , builder = builder , tags = tags )
879891 app .phase = BuildPhase .WRITING
880892 builder .write_doc_serialized (docname , doctree )
881893 builder .write_doc (docname , doctree )
0 commit comments