mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #2009 from ProgVal/determinism
Make files generation at install deterministic
This commit is contained in:
commit
a7723ff6f4
2
setup.py
2
setup.py
@ -162,7 +162,7 @@ else:
|
||||
messages=jscatalog,
|
||||
plural_expr=catalog.plural_expr,
|
||||
locale=str(catalog.locale)
|
||||
), outfile)
|
||||
), outfile, sort_keys=True)
|
||||
outfile.write(');')
|
||||
finally:
|
||||
outfile.close()
|
||||
|
@ -837,7 +837,7 @@ class StandaloneHTMLBuilder(Builder):
|
||||
u'# The remainder of this file is compressed using zlib.\n'
|
||||
% (self.config.project, self.config.version)).encode('utf-8'))
|
||||
compressor = zlib.compressobj(9)
|
||||
for domainname, domain in iteritems(self.env.domains):
|
||||
for domainname, domain in sorted(self.env.domains.items()):
|
||||
for name, dispname, type, docname, anchor, prio in \
|
||||
sorted(domain.get_objects()):
|
||||
if anchor.endswith(name):
|
||||
|
@ -4,6 +4,10 @@
|
||||
from __future__ import print_function
|
||||
|
||||
from six import iteritems
|
||||
try:
|
||||
from collections import OrderedDict
|
||||
except ImportError: # Fallback for Python 2.6
|
||||
OrderedDict = dict
|
||||
|
||||
# Pgen imports
|
||||
|
||||
@ -57,7 +61,7 @@ class ParserGenerator(object):
|
||||
def make_first(self, c, name):
|
||||
rawfirst = self.first[name]
|
||||
first = {}
|
||||
for label in rawfirst:
|
||||
for label in sorted(rawfirst):
|
||||
ilabel = self.make_label(c, label)
|
||||
##assert ilabel not in first # X X X failed on <> ... !=
|
||||
first[ilabel] = 1
|
||||
@ -138,8 +142,8 @@ class ParserGenerator(object):
|
||||
totalset[label] = 1
|
||||
overlapcheck[label] = {label: 1}
|
||||
inverse = {}
|
||||
for label, itsfirst in iteritems(overlapcheck):
|
||||
for symbol in itsfirst:
|
||||
for label, itsfirst in sorted(overlapcheck.items()):
|
||||
for symbol in sorted(itsfirst):
|
||||
if symbol in inverse:
|
||||
raise ValueError("rule %s is ambiguous; %s is in the"
|
||||
" first sets of %s as well as %s" %
|
||||
@ -349,6 +353,9 @@ class NFAState(object):
|
||||
assert isinstance(next, NFAState)
|
||||
self.arcs.append((label, next))
|
||||
|
||||
def __hash__(self):
|
||||
return hash(tuple(x[0] for x in self.arcs))
|
||||
|
||||
class DFAState(object):
|
||||
|
||||
def __init__(self, nfaset, final):
|
||||
@ -357,7 +364,10 @@ class DFAState(object):
|
||||
assert isinstance(final, NFAState)
|
||||
self.nfaset = nfaset
|
||||
self.isfinal = final in nfaset
|
||||
self.arcs = {} # map from label to DFAState
|
||||
self.arcs = OrderedDict() # map from label to DFAState
|
||||
|
||||
def __hash__(self):
|
||||
return hash(tuple(self.arcs))
|
||||
|
||||
def addarc(self, next, label):
|
||||
assert isinstance(label, str)
|
||||
|
@ -275,9 +275,9 @@ class IndexBuilder(object):
|
||||
rv = {}
|
||||
otypes = self._objtypes
|
||||
onames = self._objnames
|
||||
for domainname, domain in iteritems(self.env.domains):
|
||||
for domainname, domain in sorted(iteritems(self.env.domains)):
|
||||
for fullname, dispname, type, docname, anchor, prio in \
|
||||
domain.get_objects():
|
||||
sorted(domain.get_objects()):
|
||||
# XXX use dispname?
|
||||
if docname not in fn2index:
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user