From ec51d9a5c3199656c068c27678129b1ffed987a9 Mon Sep 17 00:00:00 2001 From: khanxmetu Date: Sun, 15 Sep 2024 22:48:11 +0300 Subject: [PATCH] Ensure deterministic resolution of toctree --- sphinx/builders/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 76e7e230cdc..b3e5d559124 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -613,6 +613,9 @@ def write( docnames.add(tocdocname) docnames.add(self.config.root_doc) + # sort to ensure deterministic toctree generation + self.env.toctree_includes = dict(sorted(self.env.toctree_includes.items())) + with progress_message(__('preparing documents')): self.prepare_writing(docnames)