Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share doctree between builders #5407

Merged
merged 3 commits into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion readthedocs/doc_builder/backends/sphinx.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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')),
(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but it was bothering me seeing this js kind of indentation p:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change made by pre-commit? If you did it manually, it will be reverted in the next pass otherwise.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it manually, but I run precommit on this file, and it didn't change anything

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