I'm in the same boat here. I saw that you went with the autoattribute approach, thus duplicating your code file in the documentation. It should be possible to avoid that by using the Python 'ast' module from within a Sphinx extension to emit something like:
.. attribute:: mymodule.MYCONSTANT
:annotation: = somevalue
...for each sympol found via the ast module, thus avoiding the duplication. The ast module is quite simple to work with so it wouldn't add much code, and be resilient to change.
There is one problem though, I have no idea what extension code is needed to create the above from say, for example:
.. myautoconst:: mymodule
...and I'm having a hard time to make sense of the documentation. The goal here should be, for me at least, to have the attributes cross-referable via `MYCONSTANT` and the default_role='any'. Any help would be very much appreciated. Either to get this working, or to fix sphinx to actually automatically document the consts.