alembic / sphinx puzzler

Chris Lamb chris at
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:

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

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,

    ⬋   ⬊      Chris Lamb
   o     o 💠
    ⬊   ⬋

More information about the rb-general mailing list