diff --git a/CHANGES b/CHANGES index dfcf2a6bd..64d561e09 100644 --- a/CHANGES +++ b/CHANGES @@ -284,8 +284,8 @@ Documentation * #5083: Fix wrong make.bat option for internationalization. * #5115: napoleon: add admonitions added by #4613 to the docs. -Release 1.7.9 (in development) -============================== +Release 1.7.10 (in development) +=============================== Dependencies ------------ @@ -305,6 +305,19 @@ Bugs fixed Testing -------- +Release 1.7.9 (released Sep 05, 2018) +===================================== + +Features added +-------------- + +* #5359: Make generated texinfo files reproducible by sorting the anchors + +Bugs fixed +---------- + +* #5361: crashed on incremental build if document uses include directive + Release 1.7.8 (released Aug 29, 2018) ===================================== diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index 7b116970f..100531be8 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -19,7 +19,7 @@ from os import path from docutils.utils import get_source_line from six import BytesIO, next -from six.moves import cPickle as pickle, reduce +from six.moves import cPickle as pickle from sphinx import addnodes from sphinx.deprecation import RemovedInSphinx20Warning, RemovedInSphinx30Warning @@ -67,7 +67,7 @@ default_settings = { # or changed to properly invalidate pickle files. # # NOTE: increase base version by 2 to have distinct numbers for Py2 and 3 -ENV_VERSION = 53 + (sys.version_info[0] - 2) +ENV_VERSION = 54 + (sys.version_info[0] - 2) # config status CONFIG_OK = 1 @@ -724,7 +724,7 @@ class BuildEnvironment(object): def check_consistency(self): # type: () -> None """Do consistency checks.""" - included = reduce(lambda x, y: x | y, self.included.values(), set()) # type: Set[unicode] # NOQA + included = set().union(*self.included.values()) # type: ignore for docname in sorted(self.all_docs): if docname not in self.files_to_rebuild: if docname == self.config.master_doc: diff --git a/sphinx/writers/texinfo.py b/sphinx/writers/texinfo.py index 6b7ec5932..701880a61 100644 --- a/sphinx/writers/texinfo.py +++ b/sphinx/writers/texinfo.py @@ -612,7 +612,7 @@ class TexinfoTranslator(nodes.NodeVisitor): node_name = node['node_name'] pointers = tuple([node_name] + self.rellinks[node_name]) self.body.append('\n@node %s,%s,%s,%s\n' % pointers) # type: ignore - for id in self.next_section_ids: + for id in sorted(self.next_section_ids): self.add_anchor(id, node) self.next_section_ids.clear() diff --git a/tests/test_build_texinfo.py b/tests/test_build_texinfo.py index 6b6892594..b1fd8c2a9 100644 --- a/tests/test_build_texinfo.py +++ b/tests/test_build_texinfo.py @@ -50,6 +50,10 @@ def test_texinfo_warnings(app, status, warning): def test_texinfo(app, status, warning): TexinfoTranslator.ignore_missing_images = True app.builder.build_all() + result = (app.outdir / 'SphinxTests.texi').text(encoding='utf8') + assert ('@anchor{markup doc}@anchor{12}' + '@anchor{markup id1}@anchor{13}' + '@anchor{markup testing-various-markup}@anchor{14}' in result) # now, try to run makeinfo over it cwd = os.getcwd() os.chdir(app.outdir)