alembic / sphinx puzzler

Chris Lamb chris at reproducible-builds.org
Wed Feb 15 19:27:09 UTC 2023


Hey James,

> I noticed what _seemed_ like a quick reproducible-build fix for alembic 
> (a database migration framework written in Python).  A few hours later 
> though, I'm still puzzled.

This seems to be because Sphinx is essentially running repr(…) on a
set() data structure nested within a tuple object, and it isn't
sorting the contents of that nested set() when rendering it.

This change to Sphinx makes alembic reproducible:

  https://github.com/lamby/sphinx/commit/4ad7670c1df00f82e758aaa8a7b9aaea83b8eaba

Does this patch work for you? It looks like this in the final HTML:

  https://i.imgur.com/BZ8glwi.png

Why it hasn't been a problem before is rather curious to me, though.
It may be just that it hasn't come up, but it may be because this
value ultimately comes from a Python typing annotation. Yet at that
point in the code, there doesn't seem to be anything special
whatsoever about this tuple & set: it's really just a regular tuple
and set.


Best wishes,

-- 
      o
    ⬋   ⬊      Chris Lamb
   o     o     reproducible-builds.org 💠
    ⬊   ⬋
      o


More information about the rb-general mailing list