Your message dated Sat, 02 May 2015 21:59:11 +0000
with message-id <e1yofrh-0007yc...@franck.debian.org>
and subject line Bug#776443: fixed in sphinx 1.3.1-1
has caused the Debian Bug report #776443,
regarding sphinx: please make output reproducible
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
776443: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776443
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: sphinx
Version: 1.2.3+dfsg-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: toolchain randomness
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi,

While working on the "reproducible builds" effort [1], we have noticed
that sphinx is generating documentation that is not repoducible.

For example, its output includes non-deterministic memory references
such as:

   <__main__.A at 0x7f68cb685710>

In addition, various generated (objects.inv, searchindex.js,
translations) do not output their keys in a determinstic order,
resulting in further randomness.

The attached patch attempts to remedy these issues. Once applied, many
packages that use sphinx--but alas not sphinx itself yet!--can be built
reproducibly in our current experimental
framework.

 [1]: https://wiki.debian.org/ReproducibleBuilds


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index 9c039e3..f489a35 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -269,7 +269,7 @@ class StandaloneHTMLBuilder(Builder):
         # html_domain_indices can be False/True or a list of index names
         indices_config = self.config.html_domain_indices
         if indices_config:
-            for domain in self.env.domains.itervalues():
+            for domain in sorted(self.env.domains.itervalues()):
                 for indexcls in domain.indices:
                     indexname = '%s-%s' % (domain.name, indexcls.name)
                     if isinstance(indices_config, list):
@@ -808,7 +808,7 @@ class StandaloneHTMLBuilder(Builder):
             compressor = zlib.compressobj(9)
             for domainname, domain in self.env.domains.iteritems():
                 for name, dispname, type, docname, anchor, prio in \
-                        domain.get_objects():
+                        sorted(domain.get_objects()):
                     if anchor.endswith(name):
                         # this can shorten the inventory by as much as 25%
                         anchor = anchor[:-len(name)] + '$'
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 423f921..721fbb4 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -60,7 +60,6 @@ class DefDict(dict):
 
 identity = lambda x: x
 
-
 class Options(dict):
     """A dict/attribute hybrid that returns None on nonexisting keys."""
     def __getattr__(self, name):
@@ -975,7 +974,8 @@ class FunctionDocumenter(DocstringSignatureMixin, 
ModuleLevelDocumenter):
                 argspec = getargspec(self.object.__init__)
                 if argspec[0]:
                     del argspec[0][0]
-        args = inspect.formatargspec(*argspec)
+        args = inspect.formatargspec(*argspec,
+                                     formatvalue=lambda x: '=' + safe_repr(x))
         # escape backslashes for reST
         args = args.replace('\\', '\\\\')
         return args
@@ -1030,7 +1030,8 @@ class ClassDocumenter(ModuleLevelDocumenter):
             return None
         if argspec[0] and argspec[0][0] in ('cls', 'self'):
             del argspec[0][0]
-        return inspect.formatargspec(*argspec)
+        return inspect.formatargspec(*argspec,
+                                     formatvalue=lambda x: '=' + safe_repr(x))
 
     def format_signature(self):
         if self.doc_as_attr:
@@ -1229,7 +1230,8 @@ class MethodDocumenter(DocstringSignatureMixin, 
ClassLevelDocumenter):
         argspec = getargspec(self.object)
         if argspec[0] and argspec[0][0] in ('cls', 'self'):
             del argspec[0][0]
-        args = inspect.formatargspec(*argspec)
+        args = inspect.formatargspec(*argspec,
+                                     formatvalue=lambda x: '=' + safe_repr(x))
         # escape backslashes for reST
         args = args.replace('\\', '\\\\')
         return args
diff --git a/sphinx/search/__init__.py b/sphinx/search/__init__.py
index bd95ecc..760b137 100644
--- a/sphinx/search/__init__.py
+++ b/sphinx/search/__init__.py
@@ -268,13 +268,13 @@ class IndexBuilder(object):
                     if fn in fn2index:
                         rv[k] = fn2index[fn]
                 else:
-                    rv[k] = [fn2index[fn] for fn in v if fn in fn2index]
+                    rv[k] = sorted([fn2index[fn] for fn in v if fn in 
fn2index])
         return rvs
 
     def freeze(self):
         """Create a usable data structure for serializing."""
-        filenames = self._titles.keys()
-        titles = self._titles.values()
+        filenames = sorted(self._titles.keys())
+        titles = sorted(self._titles.values())
         fn2index = dict((f, i) for (i, f) in enumerate(filenames))
         terms, title_terms = self.get_terms(fn2index)
 
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
index cdbfea7..e04f1fa 100644
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -9,6 +9,7 @@
     :license: BSD, see LICENSE for details.
 """
 
+import re
 import sys
 
 # this imports the standard library inspect module without resorting to
@@ -135,7 +136,10 @@ def safe_repr(object):
     except Exception:
         raise ValueError
     if isinstance(s, bytes):
-        return force_decode(s, None).replace('\n', ' ')
+        s = force_decode(s, None)
+    # Strip non-deterministic memory addresses such as
+    # ``<__main__.A at 0x7f68cb685710>``
+    s = re.sub(r' at 0x[0-9a-f]{8,12}(?=>$)', '', s)
     return s.replace('\n', ' ')
 
 
diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py
index 85845a7..cc62eab 100644
--- a/sphinx/util/jsdump.py
+++ b/sphinx/util/jsdump.py
@@ -87,11 +87,13 @@ def dumps(obj, key=False):
     elif isinstance(obj, (int, long, float)):
         return str(obj)
     elif isinstance(obj, dict):
-        return '{%s}' % ','.join('%s:%s' % (
+        return '{%s}' % ','.join(sorted('%s:%s' % (
             dumps(key, True),
             dumps(value)
-        ) for key, value in obj.iteritems())
-    elif isinstance(obj, (tuple, list, set)):
+        ) for key, value in obj.iteritems()))
+    elif isinstance(obj, set):
+        return '[%s]' % ','.join(sorted(dumps(x) for x in obj))
+    elif isinstance(obj, (tuple, list)):
         return '[%s]' % ','.join(dumps(x) for x in obj)
     elif isinstance(obj, basestring):
         return encode_string(obj)

--- End Message ---
--- Begin Message ---
Source: sphinx
Source-Version: 1.3.1-1

We believe that the bug you reported is fixed in the latest version of
sphinx, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 776...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dmitry Shachnev <mity...@debian.org> (supplier of updated sphinx package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 02 May 2015 22:18:56 +0300
Source: sphinx
Binary: python-sphinx python3-sphinx sphinx-common sphinx-doc libjs-sphinxdoc
Architecture: source all
Version: 1.3.1-1
Distribution: experimental
Urgency: medium
Maintainer: Debian Python Modules Team 
<python-modules-team@lists.alioth.debian.org>
Changed-By: Dmitry Shachnev <mity...@debian.org>
Description:
 libjs-sphinxdoc - JavaScript support for Sphinx documentation
 python-sphinx - documentation generator for Python projects (implemented in 
Pytho
 python3-sphinx - documentation generator for Python projects (implemented in 
Pytho
 sphinx-common - documentation generator for Python projects - common data
 sphinx-doc - documentation generator for Python projects - documentation
Closes: 776443 779458
Changes:
 sphinx (1.3.1-1) experimental; urgency=medium
 .
   [ Helmut Grohne ]
   * Mark libjs-sphinxdoc Multi-Arch: foreign (closes: #779458).
 .
   [ Dmitry Shachnev ]
   * New upstream release.
     - The codebase now works with Python 3 with no need to run 2to3.
     - Output is now reproducible (closes: #776443).
   * Remove patches:
     - python3_test_build_dir.diff (no longer needed)
     - parallel_2to3.diff (no longer needed)
     - fix_latex_hlines.diff (applied upstream)
   * Bump required versions of python, docutils and pygments.
   * Build-depend and depend on:
     - python[3]-six
     - python[3]-babel
     - python[3]-sphinx-rtd-theme
     - python[3]-alabaster
   * Add python[3]-mock to build-dependencies and test dependencies.
   * Use upstream tarball, which now contains non-minified versions of
     jquery.js and underscore.js.
   * Update debian/watch to use pypi.debian.net redirector.
   * Simplify debian/rules:
     - Adjust for using upstream tarballs.
     - Do not mention site-packages anymore.
   * Update JS tests for the new version.
   * Add a patch to skip JS libraries versions check.
   * Drop 2to3 call from debian/tests/python3-sphinx.
   * Properly clean up after running tests.
   * Bring debian/copyright in sync with upstream AUTHORS file.
   * Disable snowballstemmer-based search until upstream implements
     it correctly (without JS blobs) and we get snowballstemmer packaged.
   * Bump Standards-Version to 3.9.6, no changes needed.
   * Override lintian false positive warnings about missing sources for
     minified files (jquery.js, underscore.js, and css3-mediaqueries.js).
   * debian/dh-sphinxdoc/install-js: Update list of files to be installed.
Checksums-Sha1:
 28aa5f66e5a800819a39ee7829a36451e79cbc4b 2980 sphinx_1.3.1-1.dsc
 c2288193166ee1f276b5f35a960e1d1e49aa74d4 3469782 sphinx_1.3.1.orig.tar.gz
 8d2c369564c62e7d7434af96500edd450592b319 27616 sphinx_1.3.1-1.debian.tar.xz
 07065e1e8ea154bc80169a88ccbaa42da8b63150 351424 python-sphinx_1.3.1-1_all.deb
 108d9a404c2348bf424c55e2f807276d2fcde0f8 350422 python3-sphinx_1.3.1-1_all.deb
 2dad1ee3dd919309fba61b01f832785effefe7f9 319826 sphinx-common_1.3.1-1_all.deb
 ffcea9b38907df5730eb3732974ad2e75ff8bc01 1116912 sphinx-doc_1.3.1-1_all.deb
 e7e44d1f60f143195f6f825010be8a535161bbf3 52432 libjs-sphinxdoc_1.3.1-1_all.deb
Checksums-Sha256:
 87349f2d70cb2bf7a692c9aa7fd4fbe05b610a135804938a8c19750d6af7e845 2980 
sphinx_1.3.1-1.dsc
 1a6e5130c2b42d2de301693c299f78cc4bd3501e78b610c08e45efc70e2b5114 3469782 
sphinx_1.3.1.orig.tar.gz
 13357cf057703fbd370a0efc77fe145910ff580deb9e34e7eb973a98a9a109a8 27616 
sphinx_1.3.1-1.debian.tar.xz
 8cb0f1b1b41552cbc17f414b9dc4ea689b1f087b2b0c22d4195c4b79656cb436 351424 
python-sphinx_1.3.1-1_all.deb
 ff5f8eadd2e43c48a7fd56397bcb0fe14e494b7c88c50a1e8c2017d4380390f7 350422 
python3-sphinx_1.3.1-1_all.deb
 aad433ef9dde387f30428193cbe4f0ca37069c62e90c67127de66482c8f93f1b 319826 
sphinx-common_1.3.1-1_all.deb
 6af92d9d55219082f7bef7c9c29e51531289ec36eebd9e25bfa304296982a306 1116912 
sphinx-doc_1.3.1-1_all.deb
 7691853aa67d720de7364fb71c28dd763a650caa54666b4bbfcb70cac2dd3b8f 52432 
libjs-sphinxdoc_1.3.1-1_all.deb
Files:
 bf968dd23abfc686a16e171550e6651f 2980 python optional sphinx_1.3.1-1.dsc
 8786a194acf9673464c5455b11fd4332 3469782 python optional 
sphinx_1.3.1.orig.tar.gz
 ffa2a5386fddf647ec890198c8df2029 27616 python optional 
sphinx_1.3.1-1.debian.tar.xz
 c833b62087ef12afc9a2d17633372af6 351424 python optional 
python-sphinx_1.3.1-1_all.deb
 956cb5d270dd277ee15b956f4a68e822 350422 python optional 
python3-sphinx_1.3.1-1_all.deb
 bea37d92e8cb84796a1a28029c6a700f 319826 python optional 
sphinx-common_1.3.1-1_all.deb
 5117eeea9063aa7079e2ef8542e04f34 1116912 doc optional 
sphinx-doc_1.3.1-1_all.deb
 ea3930cff5d5edd73fa31f38d233d857 52432 web optional 
libjs-sphinxdoc_1.3.1-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJVRS5iAAoJENb+cQNj+F3TTWYP/jqUGDArGAY1ECUYLA0ADd9r
NewNjWlqb8ZT4eloup7o9csFTDNDodQ3Dz1IjpfoVHLFJUEJepCpX1aAsO+FDgxe
3kgxY/GdTwUT/GurGsQjsJiLzFFuBdbhwDDdHTIlVUB4lCyxGnYLK09DrSfQdfTF
hMbcXsYbSyzrI0CLkrBrAl18GJ7Ka/KnjkzIPzMyDZX30Y6z7DNZnTlAAe80EAZz
G9CLGoK/DrX7cf1fgIUxEoZV3EBAjTv3h+5vI9Jr5OKrDVj7AdBHt51tOl6EkjEV
ePTXBc0khu4ZU06U1s/RqzhUjrtg5JWN/HXxO52XWVyE5ga5AQDDz5c6wbbGgjdD
vQvZg/2t6Tswp8Xj5P989WOeClKHpq9a5rGbE7bVSE3dB7FBV4dPwQJgR4T+F4Cw
xOc6GM+IAO3HIrK81C3yheDc1+mVen/I8OPtGsYIhj3P9RLboMsDK5Oo2lppzUsN
Tp4N3z3jaRbAyNVW+4IY/VSVHtSsARWn636Da64AP8W684iZojSXbNBw/CEwioZn
4jCR1VvsPzxJ4L//Wk1Es6C9H5pZwTLRkawnIfwyMwrYUKVCCoLOjs7ivuB3rZCT
cW2yMWnJ4yiOzHfvgdW1xtD40ZTOKkNdzmB5S/o5rTEVnSHYLoeHf0YqQ0b8Dxyh
ik8AhRtf4zquA4FB9xWW
=y95T
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to