From a77f34838ae40a188ad96849bcce11f4d38ad988 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 20 Jul 2020 18:40:16 -0500 Subject: [PATCH] Sphinx: always exclude the build directory We use the _build/ directory for all builders. Some users may not have that directory excluded, leading to some extra copy operations. Fixes https://github.com/readthedocs/readthedocs.org/issues/7200 --- readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl b/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl index b6090222d6e..dd904f931a1 100644 --- a/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl +++ b/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl @@ -178,3 +178,7 @@ if chinese: latex_elements = latex_elements_user or latex_elements_rtd elif japanese: latex_engine = latex_engine_user or 'platex' + +# Make sure our build directory is always excluded +exclude_patterns = globals().get('exclude_patterns', []) +exclude_patterns.extend(['_build'])