-
-
Notifications
You must be signed in to change notification settings - Fork 188
Closed
Labels
Milestone
Description
In my project I have:
mymod.py:
class MyCache(cachetools.LRUCache): ...mymod.rst:
.. autoclass:: mymod.MyCache
:members:
:undoc-members:
:show-inheritance:
sphinx-build -W fails with:
mymod.py:docstring of mymod.MyCache:1: WARNING:
py:class reference target not found: cachetools.lru.LRUCache
The problem is that, in objects.inv, the object appears (correctly) under its public module, but LRUCache.__module__ points to the implementation module:
$ python -m sphinx.ext.intersphinx https://cachetools.readthedocs.io/en/latest/objects.inv| grep LRUCache
cachetools.LRUCache index.html#cachetools.LRUCacheWorkaround
In conf.py:
import cachetools
cachetools.LRUCache.__module__ = "cachetools"Solution
The __module__ hack above should be in cachetools.__init__.
External references
This issue is very common. Here's the exact same problem in two other projects:
Reactions are currently unavailable