Skip to content

Commit

Permalink
Builder.build: save env also with only new documents
Browse files Browse the repository at this point in the history
Saving/pickling the environment is necessary for intersphinx to have its
cache saved.

Currently a new build would fetch the inventories, but the cache would
not get saved.

This appears to break no existing test, but should probably get a new
one then?
  • Loading branch information
blueyed committed Jun 13, 2018
1 parent 2855721 commit 20f625b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sphinx/builders/__init__.py
Expand Up @@ -372,14 +372,14 @@ def build(self, docnames, summary=None, method='update'):
else:
logger.info(__('none found'))

if updated_docnames:
# save the environment
from sphinx.application import ENV_PICKLE_FILENAME
logger.info(bold(__('pickling environment... ')), nonl=True)
with open(path.join(self.doctreedir, ENV_PICKLE_FILENAME), 'wb') as f:
pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL)
logger.info(__('done'))
# save the environment
from sphinx.application import ENV_PICKLE_FILENAME
logger.info(bold(__('pickling environment... ')), nonl=True)
with open(path.join(self.doctreedir, ENV_PICKLE_FILENAME), 'wb') as f:
pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL)
logger.info(__('done'))

if updated_docnames:
# global actions
self.app.phase = BuildPhase.CONSISTENCY_CHECK
logger.info(bold(__('checking consistency... ')), nonl=True)
Expand Down

0 comments on commit 20f625b

Please sign in to comment.