-
Notifications
You must be signed in to change notification settings - Fork 53
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
Make the sphinx extension compatible with manpage writer #555
Comments
Hello @kloczek, You're missing our inthersphinx URL, please add |
Hi @kloczek, sorry I did not understand the issue at first glance. It seems that the pydoctor intersphinx is not added your sphinx app. We're using |
Using tox IMO is wrong because it assumes that documentation will be generated against installed module and it requires install module. Only handful of python modules still is doing that and NONE of the non-python projects. Nevertheless probably you are using tox because with current source tree it is not possible to use directly --- a/docs/source/conf.py~ 2022-03-31 14:37:49.000000000 +0000
+++ b/docs/source/conf.py 2022-05-01 18:55:06.479309978 +0000
@@ -10,9 +10,9 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
+import os
+import sys
+sys.path.insert(0, os.path.abspath('../..'))
import os
import subprocess That patch fixes exactly what is mentioned in the comment above modified lines and it allows skip assembly tox venv. In other words: with that patch it is quarantine that documentation will be generated out of source tree (like in any other project outside python domain) and it allows generate documentation faster (KISS principle). |
Hi @kloczek, I think what your talking about it unrelated to the issue your facing. Pydoctor works by static analysis, I suspect, because of the
|
That patch it is not |
OK I get it now, but I'm usure if it's the best way to fix the issue. Would it be possible to use Also, it seems that there is another potential issue: right now, the local See
I'll try it out when I have a moment, yes. |
FYI that teak is even mentioned in template/example sphinx copy.py file https://www.sphinx-doc.org/en/master/usage/configuration.html#example-of-configuration-file |
@kloczek, I've tried the following command locally
And of course, if When pydoctor (and all docs requirements) are accessible in the path (either installed or the Again, the reason for those warnings is that the sphinx inventory of Hope this helps, |
And that what fixes suggested patch .. |
@kloczek, all I’m saying it that tweaking the Now, if you like to submit a pull request in which you tweak the |
And that what I said as well 😄 |
let’s focus on one independent issue per ticket, this will avoid future confusions like this. Let’s have this ticket be about Sphinx warnings only. For the About these warnings: they are present only because your building with the man page builder and not the html builder. Right now, pydoctor is no where close to support different kind of outputs, the model is still quite couple with html rendering logic. And I doubt that generating html when the user expects man pages is not helping. But maybe the extension could generate the objects.inv file no matter the builder in use? This way the links could resolve, but the files wouldn’t actually exist. What do you think @kloczek ? |
Issu eis that seruptools<>sphins integration is already sheduled as deprecated. Warnings it is separated subject. |
Whether the documentation have specific requirements is not a problem in my opinion. Now, I'll close this issue since there is no way to get the man page build work for now and it looks like these warnings are not a real problem. Please next time do not talk about two independent issue in the same ticket, this will avoid confusion. |
FYI: those refs as links are rendered only in html outpout. |
Gentle ping .. any update? 🤔 + /usr/bin/sphinx-build -n -T -b man docs/source build/sphinx/man
Running Sphinx v7.3.7
Initializing Spelling Checker 8.0.0
loading intersphinx inventory from https://tristanlatr.github.io/apidocs/twisted/objects.inv...
loading intersphinx inventory from https://bw2.github.io/ConfigArgParse/objects.inv...
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: targets for 0 po files that are out of date
writing output...
building [man]: all manpages
updating environment: [new config] 22 added, 0 changed, 0 removed
reading sources... [100%] transition
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-pydoctor.3 { quickstart codedoc docformat/index docformat/epytext docformat/epytext_demo/index docformat/restructuredtext docformat/restructuredtext_demo/index docformat/google-numpy docformat/google_demo/index docformat/numpy_demo/index sphinx-integration customize help faq transition contrib readme api/index } /home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/docformat/google-numpy.rst:22: WARNING: py:mod reference target not found: pydoctor.napoleon
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/sphinx-integration.rst:75: WARNING: py:mod reference target not found: pydoctor.sphinx_ext.build_apidocs
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:103: WARNING: py:mod reference target not found: pydoctor.qnmatch
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:111: WARNING: py:class reference target not found: pydoctor.model.System
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:127: WARNING: py:class reference target not found: pydoctor.extensions.ExtRegistrar
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:133: WARNING: py:class reference target not found: pydoctor.model.Documentable
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:136: WARNING: py:mod reference target not found: pydoctor.extensions.zopeinterface
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:136: WARNING: py:mod reference target not found: pydoctor.extensions.deprecate
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:212: WARNING: py:class reference target not found: pydoctor.model.System
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:212: WARNING: py:meth reference target not found: pydoctor.model.System.__init__
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:212: WARNING: py:class reference target not found: pydoctor.sphinx.SphinxInventory
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:218: WARNING: py:mod reference target not found: pydoctor.extensions
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:224: WARNING: py:class reference target not found: pydoctor.templatewriter.TemplateWriter
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:224: WARNING: py:class reference target not found: pydoctor.templatewriter.IWriter
/home/tkloczko/rpmbuild/BUILD/pydoctor-24.3.3/docs/source/customize.rst:229: WARNING: py:class reference target not found: pydoctor.templatewriter.IWriter
done
build succeeded, 15 warnings. |
Hello @kloczek, Looks like you don't have the pydoctor inventory in your sphinx app, this is because our sphinx extension is only compatible with the html writer. Not the man page writer. See my last comment The issue should be "Make the sphinx extension compatible with manpage writer", until this, these warnings are normal and should be ignored. |
reference target not found
Man page is perfectly fine and nothing is missing for that. Please use |
Looks like you’re using -b man which uses the man page writer. Our extension (responsible to generate the intershpinx links before Sphinx is run) only generate it if the writer name is html (see the code that I linked in may 2022). I believe this is why the manpage writer fails to link these names. Now you say that the issue is present for the html build.. |
Again .. please try to use |
Hello @kloczek this is what I did and here is the result (absolute path replaced by /.../ ):
Note the sphinx inventories loading from files, this is because I used the |
I get it now: what your trying to do is simply not possible since the pydoctor documentation (generated by Sphinx html build) depends on pydoctor itself. edit: But with the patch of sys.path it might do the trick with the html build only, not the man pages build. |
FYI I'm using such patch --- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -10,9 +10,9 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
+import os
+import sys
+sys.path.insert(0, os.path.abspath("../.."))
import os
import subprocess Do you want above as PR? 🤔 |
Maybe the sys.path tweak can be done if the pydoctor import fails with ImportError, so we’re not patching when pydoctor is already installed. But otherwise looks like a useful patch. |
On building my packages I'm using
sphinx-build
command with-n
switch which shows warmings about missing references. These are not critical issues.Here is the output with warnings:
The text was updated successfully, but these errors were encountered: