Closed kloczek closed 1 year ago
Thanks for posting this issue, @kloczek. It's really strange that we see this nested configupdater.configupdater
causing the duplicate objects. Do you have any idea where this comes from by any chance?
Sorry .. I've not been looking so deep 🤔
I started to look into this issue and it's actually way harder than I expected. Googling a bit it seems that the Napoleon Sphinx extension introduced this behaviour in newer releases. The reason seems to be that configupdater.configupdater
imports some classes and makes them available via __all__
. This leads, according to Sphinx, to an ambiguity as now several identical classes exists that can come from different modules. For me that makes no sense because even though you can import a class like Section
from several modules, it's still the same class and thus I would always reference the module where it is defined.
From my understanding, in order to fix those warning, we would have to change the API. For instance I could get rid of one of the warnings by removing the import in configupdater.configupdater
although this obviously leads to other problems. So we should not go down that road.
Another approach seems to be to add :noindex:
to the generated api files. The problem with this solution is that currently we use sphinx-apidoc
to generate those files on the fly, where we would have to add :noindex:
to all classes, which cause an ambiguity. We could follow this approach by getting rid of apidoc
and maintaining this manually (like it maybe is also supposed to be). I am not a huge fan of more manual work even though it will only happen rarely.
The third option is to learn to live with those warnings :-) My suggestion would be to follow this approach and rather one day switch over from sphinx to mkdocs, which is the more modern and much cleaner approach (in my opinion).
You can peak on fixes that kind of issues in other projects https://github.com/RDFLib/rdflib-sqlalchemy/issues/95 https://github.com/RDFLib/rdflib/pull/2036 https://github.com/click-contrib/sphinx-click/commit/abc31069 https://github.com/frostming/unearth/issues/14 https://github.com/jaraco/cssutils/issues/21 https://github.com/latchset/jwcrypto/pull/289 https://github.com/latchset/jwcrypto/pull/289 https://github.com/pypa/distlib/commit/98b9b89f https://github.com/pywbem/pywbem/pull/2895 https://github.com/sissaschool/elementpath/commit/bf869d9e
I've collected those links out of tickets which I've reported and already has been resolved 😋
Thanks @kloczek! This is really helpful.
Thanks a lot @abravalheri!
Looks like lates sphinx shows some warning