-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What does "No referent" error mean? #2
Comments
@martinpakosch apologies for the cryptic error message this puts out. I'll try and clean those up at some point. In general you'll get a "No referent" error in the following cases where the thing being referred to...
It's worth noting that, depending on your configuration, even though you haven't explicitly referenced Given this, my suspicion is that |
Hi Ryan, thanks for picking up. Ok, now I got the point. Your extensions works somehow as a hook and yes, I use apidoc, which generates rst-files with What I do not understand is why it emits your warning, because:
So why does the discovery fail? Can this be because of the relative import in |
Hi Ryan, once more... regarding my suspicion about the relative imports... I have noticed some more referent warnings, but all come from modules, that import Now, my subclassing looks like this:
The file |
Two other things to check.
|
Ok, you got me... :-/ Unfortunately you are right, I accidentally grabbed the repo from 23andMe. I repeated the test with this one and it looks fine. No referent warnings for my base classes, although they were indeed excluded from Sphinx docs due to an empty However, with your newer code I noticed a new referent warning related to a type annotation. It seems it is emitted due to a lack of support for lazy annotations (or what they are called) - or in this case multiple inheritance:
Am I right? I mean I can overcome this by reordering my code, but in some cases (self-references) this might be difficult. Is this due to your extension or is it a sphinx problem? I do not use the |
I don't think self reference should be an issue because all sphinx is concerned with is where the definition for a given symbol resides. What is the specific warning message? |
The point is, there I'm importing |
Hi @rmorshea,
I came across this issue as I am affected myself and across your extension. I gave it a try, simply pulled the source into my venv as I wanted to try the latest updates. ;-)
However, as soon as I activate this extension I get additional warnings on my builds while the cross-reference warnings still persist. My new warnings look like this:
The question is, what does this mean? My structure:
mylib.resources.backbone.mymodule.MySpecificAPI
mymodule.py
.BaseDataAPI
, and that's the only reference toBaseDataAPI
.mymodule.py
withfrom ...core.base import BaseDataAPI
.mylib.core.base.BaseDataAPI
base.py
.MySpecificAPI
there is no more to say - its simply a subclass and its unknown/unrelated fromBaseDataAPI
class's perspective.My Env:
@AA-Turner
Regarding the cross-reference warnings (to share some experience):
My usecase is fairly simple. Example with one warning regarding my custom exception
InvalidError
:mylib.exceptions.errors.InvalidError
mylib.exceptions.InvalidError
, provided via import to simplify public API structure.mylib.resources.something.mymodule.MySpecificAPI
as relative reference::raises: InvalidError
. It is imported viafrom ...exceptions import InvalidError
.So this is fairly simple in terms of complexity. My expectation would be, that Sphinx sees this docstring reference, tries to find
InvalidError
locally in module.py where it is referenced, then looks at the imports and traces it back to its secondary access point. But without warnings. :D Hopefully this will work at least with rmorshea's extension after it's included to the Sphinx core. Right now it's not working in my case.Kind regards, Martin
Originally posted by @martinpakosch in sphinx-doc/sphinx#4961 (comment)
The text was updated successfully, but these errors were encountered: