Your message dated Sat, 14 Apr 2018 19:09:12 +0000
with message-id <e1f7qxw-00036w...@fasolo.debian.org>
and subject line Bug#895553: fixed in sphinx 1.7.2-1
has caused the Debian Bug report #895553,
regarding sphinx: please make the set object description 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.)


-- 
895553: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895553
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: sphinx
Version: 1.6.7-2
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: toolchain randomness
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that sphinx could generates output that is not reproducible.

In particular, the rendering of `set` objects in default arguments
and elsewhere is currently non-determinstic. For example:

    class A_Class(object):
        a_set = {'a', 'b', 'c'}

Might be rendered as any of:

     {'a', 'b', 'c'}
     {'a', 'c', 'b'}
     {'b', 'a', 'c'}
     {'b', 'c', 'a'}
     {'c', 'a', 'b'}
     {'c', 'b', 'a'}

Patch attached that sorts the contents of sets whilst rendering.
This is parallel to the 'dict' key sorting.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
index 7042253..774d21a 100644
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -211,6 +211,10 @@ def object_description(object):
         else:
             items = ("%r: %r" % (key, object[key]) for key in sorted_keys)
             return "{%s}" % ", ".join(items)
+    if isinstance(object, set):
+        # Sort set contents
+        template = "{%s}" if PY3 else "set([%s])"
+        return template % ", ".join(repr(x) for x in sorted(object))
     try:
         s = repr(object)
     except Exception:
diff --git a/tests/test_util_inspect.py b/tests/test_util_inspect.py
index a463f4f..fe85419 100644
--- a/tests/test_util_inspect.py
+++ b/tests/test_util_inspect.py
@@ -138,6 +138,14 @@ class TestObjectDescription(TestCase):
         description = inspect.object_description(dictionary)
         assert description == "{'a': 1, 'b': 4, 'c': 3, 'd': 2}"
 
+    def test_set_sorting(self):
+        set_ = set("gfedcba")
+        description = inspect.object_description(set_)
+        if PY3:
+            assert description == "{'a', 'b', 'c', 'd', 'e', 'f', 'g'}"
+        else:
+            assert description == "set(['a', 'b', 'c', 'd', 'e', 'f', 'g'])"
+
     def test_dict_customtype(self):
         class CustomType(object):
             def __init__(self, value):

--- End Message ---
--- Begin Message ---
Source: sphinx
Source-Version: 1.7.2-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 895...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Chris Lamb <la...@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, 14 Apr 2018 19:32:39 +0100
Source: sphinx
Binary: python-sphinx python3-sphinx sphinx-common sphinx-doc libjs-sphinxdoc
Architecture: source all
Version: 1.7.2-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Modules Team 
<python-modules-t...@lists.alioth.debian.org>
Changed-By: Chris Lamb <la...@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: 895553
Changes:
 sphinx (1.7.2-1) unstable; urgency=medium
 .
   [ Chris Lamb ]
   * New upstream release.
   * Pass -vv to pytest when running the testsuite.
   * Patches:
     - Apply patch series from https://github.com/sphinx-doc/sphinx/pull/4834 to
       make the set output reproducible. (Closes: #895553)
     - Don't use Google Fonts to avoid privacy breach.
     - Fix "arbitary" spelling error in sphinx-quickstart(1) manpage.
     - Fix testsuite to not rely on return types.
     - Refresh and renumber all patches.
   * Bump Standards-Version to 4.1.4.
   * Add myself to Uploaders.
 .
   [ Dmitry Shachnev ]
   * Merge 1.6.7-2 upload from experimental to unstable.
Checksums-Sha1:
 e9df6ddcefcff21e349968cfdbd1312aeb818c72 3754 sphinx_1.7.2-1.dsc
 1d1fa6954ae216cd44ea52dfc67063f26939c8f5 4719536 sphinx_1.7.2.orig.tar.gz
 90e8f6362fd64e541f7878db765665422ca2203a 35644 sphinx_1.7.2-1.debian.tar.xz
 63e52bc0e4fcc6398f0a4f84dbefbf3342f201eb 88880 libjs-sphinxdoc_1.7.2-1_all.deb
 c8e972b46d32164a437db7f2d47deb761e1c144f 443352 python-sphinx_1.7.2-1_all.deb
 14e192c5670a49649eb82bc4b893ac861b20884c 441672 python3-sphinx_1.7.2-1_all.deb
 7f351b3c41abb34ec1919ee9d8c9ae05c03a3595 433396 sphinx-common_1.7.2-1_all.deb
 bf2120dcdccf606ffd6f301c9aa2901719201b86 1198572 sphinx-doc_1.7.2-1_all.deb
 1fe2ae56e116f5c70b6f40aacb294f9cca592123 15238 sphinx_1.7.2-1_amd64.buildinfo
Checksums-Sha256:
 71b809e3287e836ad27cd59141db91965414ee0bf7dd5a4d2066355c009c6b59 3754 
sphinx_1.7.2-1.dsc
 5a1c9a0fec678c24b9a2f5afba240c04668edb7f45c67ce2ed008996b3f21ae2 4719536 
sphinx_1.7.2.orig.tar.gz
 c7f0172a402ed372a1d11a727fccd854f91739cdf652f9c88bf00dcc9dba8c66 35644 
sphinx_1.7.2-1.debian.tar.xz
 243ccd8f90b0853ff64c7b612d730cb6ee93f24361015261a5048187d71cb9c1 88880 
libjs-sphinxdoc_1.7.2-1_all.deb
 efb8e46dca92dddc9a6f465b4dc6f2a8a59d042025457c03203b37ebe86bca69 443352 
python-sphinx_1.7.2-1_all.deb
 5a5d49a5b924f8fb393161b3919a1237f8506ca6725c5536bb8db2af18319b3f 441672 
python3-sphinx_1.7.2-1_all.deb
 ee8bb77deace306069d03e5f821d7dce19d8696cbb16954916163262ada8e2e3 433396 
sphinx-common_1.7.2-1_all.deb
 3fa70ff6fff9027479c63bec759d3b1cdc798b143d718dc50eb5533c260b19b4 1198572 
sphinx-doc_1.7.2-1_all.deb
 57fdda95d37b24cbacaec71a6e0c88a6f0e5c28406fef0be69e148edcb24de7f 15238 
sphinx_1.7.2-1_amd64.buildinfo
Files:
 af32599d9c33089af467541f0a4f15c4 3754 python optional sphinx_1.7.2-1.dsc
 21a08e994e6a289ed14eecefde2b4f2f 4719536 python optional 
sphinx_1.7.2.orig.tar.gz
 7a75fc6eb313011f616b6e43324bc860 35644 python optional 
sphinx_1.7.2-1.debian.tar.xz
 96ea16e14fb79fec506bb4e27ffa090f 88880 javascript optional 
libjs-sphinxdoc_1.7.2-1_all.deb
 7327e1ad2cdcbae5631a2446871921ae 443352 python optional 
python-sphinx_1.7.2-1_all.deb
 d66d43657041d08e48ebc50fdbc33328 441672 python optional 
python3-sphinx_1.7.2-1_all.deb
 be245eb00ce9e82dd2a88a9d4520cf91 433396 python optional 
sphinx-common_1.7.2-1_all.deb
 6f5656533651a18e307406a5dd87e362 1198572 doc optional 
sphinx-doc_1.7.2-1_all.deb
 0338c61e610c6890f7e82c5be7f5044b 15238 python optional 
sphinx_1.7.2-1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEwv5L0nHBObhsUz5GHpU+J9QxHlgFAlrSTZIACgkQHpU+J9Qx
HliPQBAAp8yai6D/V7wc5S5BWBiiir9/vR2zwP36cLzs0DTjtF3JRTIbw3KgmNnf
Mbf7gEixk/7cdjX6VJH95YBkwurzBNOfdvMj4YEiRsYD+gqMnChcSIYGuesfzgig
AQkt/Iula8Qrjn9r1m/1ZLH+yyWd9KuiS5NvYWMaQg/YDaEa9f8ET4KLgWkdrDds
/cO54jUJJhYzEaWno9p/PvkvoaS2Rnm+girPJOMSgrSX28TuD5yq44nZ/ZN/+wDy
lhWlOTZtH3VbkFTWXDboSlz1ZtKsbOHBxWtA9OqvgL8TCCyuGbSE/BuH2PKW6dhi
0Jm6KgE1RWU4GKJvBYeBeg1LTmAf3VdjzRjhm6kUB2Y2eWdGd2cznPffHlVZGI6K
GE6d18kZsD+Iz7CNhvdO7Ic18m/yKKZKYVngqrgf+Md8Y5Tz4S4mYveZyS4uvsCY
0L/gFAK9E0YQCSUsCY5k9ZttzY9+vNuYuvNe1xaOTM0PJpKxmcDTYzwS5MtAX4Zw
Ki++uq2tTA0QWCI65a0jwPErteXOvkqkvYvyaEs9wrrp6gx1q4MHl/NFAKmBNA0Q
Kp/39+++Gui2KR2OlQ5FeTRU602OW6lVBCHRj9rZWkXzDEGfCSixIlHdrpAB0Xs+
qCazfO1z2KoRZgESgBisddk+yEKeswqNLH1PC7WY/NcAmrTf+ZI=
=ec46
-----END PGP SIGNATURE-----

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

Reply via email to