Skip to content

Commit

Permalink
Merge pull request #5407 from stsewd/share-doctree-between-builders
Browse files Browse the repository at this point in the history
Share doctree between builders
  • Loading branch information
stsewd committed Mar 12, 2019
2 parents 874c920 + b0f2ccd commit b44dab4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
5 changes: 4 additions & 1 deletion readthedocs/doc_builder/backends/sphinx.py
Expand Up @@ -213,11 +213,14 @@ def build(self):
build_command.append('-E')
if self.config.sphinx.fail_on_warning:
build_command.append('-W')
doctree_path = f'_build/doctrees-{self.sphinx_builder}'
if self.project.has_feature(Feature.SHARE_SPHINX_DOCTREE):
doctree_path = '_build/doctrees'
build_command.extend([
'-b',
self.sphinx_builder,
'-d',
'_build/doctrees-{format}'.format(format=self.sphinx_builder),
doctree_path,
'-D',
'language={lang}'.format(lang=project.language),
'.',
Expand Down
33 changes: 21 additions & 12 deletions readthedocs/projects/models.py
Expand Up @@ -1313,31 +1313,40 @@ def add_features(sender, **kwargs):
API_LARGE_DATA = 'api_large_data'
DONT_SHALLOW_CLONE = 'dont_shallow_clone'
USE_TESTING_BUILD_IMAGE = 'use_testing_build_image'
SHARE_SPHINX_DOCTREE = 'share_sphinx_doctree'

FEATURES = (
(USE_SPHINX_LATEST, _('Use latest version of Sphinx')),
(USE_SETUPTOOLS_LATEST, _('Use latest version of setuptools')),
(ALLOW_DEPRECATED_WEBHOOKS, _('Allow deprecated webhook views')),
(PIP_ALWAYS_UPGRADE, _('Always run pip install --upgrade')),
(SKIP_SUBMODULES, _('Skip git submodule checkout')), (
(SKIP_SUBMODULES, _('Skip git submodule checkout')),
(
DONT_OVERWRITE_SPHINX_CONTEXT,
_(
'Do not overwrite context vars in conf.py with Read the Docs context',
),
), (
),
(
MKDOCS_THEME_RTD,
_('Use Read the Docs theme for MkDocs as default theme')
), (
_('Use Read the Docs theme for MkDocs as default theme'),
),
(
DONT_SHALLOW_CLONE,
_(
'Do not shallow clone when cloning git repos',
),
), (
_('Do not shallow clone when cloning git repos'),
),
(
USE_TESTING_BUILD_IMAGE,
_(
'Use Docker image labelled as `testing` to build the docs',
),
), (API_LARGE_DATA, _('Try alternative method of posting large data'))
_('Use Docker image labelled as `testing` to build the docs'),
),
(
API_LARGE_DATA,
_('Try alternative method of posting large data'),
),
(
SHARE_SPHINX_DOCTREE,
_('Use shared directory for doctrees'),
),
)

projects = models.ManyToManyField(
Expand Down

0 comments on commit b44dab4

Please sign in to comment.