Failed to build doc for pyside6 in qch by following the doc
-
Thanks very much, it saved me.
A little tricky, qt6 source is at https://code.qt.io/cgit/qt/qt5.git/
Ref: https://wiki.qt.io/Building_Qt_6_from_Git -
New error
$ python setup.py build_rst_docs --build-docs --qt-src-dir=/path/to/qtbase ... RuntimeError: Could not run /usr/bin/qtpaths: None ... $ whereis qtpaths qtpaths: /usr/bin/qtpaths
-
UPDATE
$ python setup.py build_rst_docs --build-docs --qt-src-dir=/path/to/qt6/qtbase ... qtpaths: Unknown option 'qt-query'. Could not find Qt. You can pass the --qt-target-path=<qt-dir> option as a hint where to find Qt. Error was:
@JonB said in Failed to build doc for pyside6 in qch by following the doc:
Just make sure what file /usr/bin/qtpaths and ls -l /usr/bin/qtpaths return? And try running it yourself from a terminal.
$ file /usr/bin/qtpaths /usr/bin/qtpaths: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=77022ee7473a4933ba05ccf4d55e33d4ee4143b0, for GNU/Linux 4.4.0, stripped $ ls -l /usr/bin/qtpaths -rwxr-xr-x 1 root root 30808 Sep 8 16:51 /usr/bin/qtpaths $ /usr/bin/qtpaths --qt-version 5.15.6
When both Qt5 and Qt6 are installed, it finds 5.15.6 instead of 6.4.0.
Is this a problem? -
New problem
$ python setup.py build_rst_docs --build-docs --qt-target-path=/usr --qt-src-dir=/path/to/qtbase ... running build_rst_docs -- This build process will not include the API documentation.API documentation requires a full build of pyside/shiboken. ...
Does it have to build the pyside6 first and then use the intermediate stuff for building to genereate the doc for pyside6?
-
If you want the full API docs, you need to build PySide 6 yourself, as described in the getting started page. You also need to get rid of Qt 5. If Qt 6 is installed by the Online installer, make sure it is first in PATH. If it comes from the system, find the Qt6 qtpaths binary and pass that using the --qtpaths option of setup.py.
The --qt-target-path= option is for cross builds only; it should not be used here. -
@friedemannkleint said in Failed to build doc for pyside6 in qch by following the doc:
If you want the full API docs, you need to build PySide 6 yourself, as described in the getting started page.
I've built it in
pyside-setup/out/
, how to use it?$ python setup.py build_rst_docs --build-docs --qtpaths=/usr/lib/qt6/bin/qtpaths --qt=6 --qt-src-dir=/path/to/qt6/qtbase ... This build process will not include the API documentation.API documentation requires a full build of pyside/shiboken. ...
-
Have you checked https://doc.qt.io/qtforpython-6/gettingstarted.html ? Do you have libxml, libxslt (dev packages) and graphviz installed? You then need to go to the build directory (something like build/testenv_td/build/pyside6) and then run ninja apidoc as described.
-
@friedemannkleint said in Failed to build doc for pyside6 in qch by following the doc:
Have you checked https://doc.qt.io/qtforpython-6/gettingstarted.html ?
Yes, I've read it several times.
Do you have libxml, libxslt (dev packages) and graphviz installed?
Yes
You then need to go to the build directory (something like build/testenv_td/build/pyside6) and then run ninja apidoc as described.
I can't find the directory.
UPDATE
Now using
python setup.py install ...
instead ofcmake
to build, it seems ok, in progress.$ python setup.py install --build-docs --qtpaths=/usr/lib/qt6/bin/qtpaths --qt-src-dir=/path/to/qt6/qtbase --ignore-git --parallel=8
-
New error
$ ninja apidoc ... qtpaths: Unknown options: q, u, e, r, y. Traceback (most recent call last): File "/path/to/pyside-setup/sources/pyside6/doc/qtattributionsscannertorst.py", line 102, in <module> runScanner(directory, targetFileName) File "/path/to/pyside-setup/sources/pyside6/doc/qtattributionsscannertorst.py", line 67, in runScanner libexec_b = subprocess.check_output('qtpaths -query QT_INSTALL_LIBEXECS', File "/usr/lib/python3.10/subprocess.py", line 421, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.10/subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'qtpaths -query QT_INSTALL_LIBEXECS' returned non-zero exit status 1. ninja: build stopped: subcommand failed.
-
@jronald said in Failed to build doc for pyside6 in qch by following the doc:
qtpaths: Unknown options: q, u, e, r, y.
Command 'qtpaths -query QT_INSTALL_LIBEXECS' returned non-zero exit status 1.
I know nothing about why this happening/what you are supposed to do about it, but that sounds like something is invoking
qtpaths -query
when it only acceptsqtpaths --query
? Try both of these from the command line to see if that is the cause of the error message? -
@JonB said in Failed to build doc for pyside6 in qch by following the doc:
I know nothing about why this happening/what you are supposed to do about it, but that sounds like something is invoking qtpaths -query when it only accepts qtpaths --query? Try both of these from the command line to see if that is the cause of the error message?
$ /usr/lib/qt6/bin/qtpaths --query QT_INSTALL_LIBEXECS /usr/lib/qt6
It's a bug in
/path/to/pyside-setup/sources/pyside6/doc/qtattributionsscannertorst.py
:libexec_b = subprocess.check_output('qtpaths -query QT_INSTALL_LIBEXECS', shell=True)
The codes below also don't work, because
qtpaths
here is for qt5 and it doesn't support--query
,
qtpaths
here should be controlled by the command param--qtpaths
libexec_b = subprocess.check_output('qtpaths --query QT_INSTALL_LIBEXECS', shell=True)
The codes below work as a temp solution.
libexec_b = subprocess.check_output('/usr/lib/qt6/bin/qtpaths --query QT_INSTALL_LIBEXECS', shell=True)
-
-
Summary
pyside-setup-path=... venv-name=... venv-prefix=... venv-path=${venv-prefix}/${venv-name} qtpaths-exe-path=... # e.g. /usr/lib/qt6/bin/qtpaths qt-src-path=... # qtbase path in source tree, e.g. /path/to/qt6-src/qtbase python -m venv ${venv-path} source ${venv-path}/bin/activate cd ${venv-path} pip install -r requirements.txt pip install graphviz # build pyside6 doc cd ${pyside-setup-path} python ./setup.py build_rst_docs # build api doc python setup.py install --build-docs --qtpaths=${qtpaths_exe_path} --qt-src-dir=${qt-src-path} --ignore-git --parallel=8 cd ${pyside-setup-path}/build/${venv-name}/build/pyside6 ninja apidoc # Result: ${pyside-setup-path}/build/${venv-name}/build/pyside6/doc/html/PySide.qch
Bug fix (manjaro)
file
/path/to/pyside-setup/sources/pyside6/doc/qtattributionsscannertorst.py
buggy codes
libexec_b = subprocess.check_output('qtpaths -query QT_INSTALL_LIBEXECS', shell=True)
fix
libexec_b = subprocess.check_output('/usr/lib/qt6/bin/qtpaths --query QT_INSTALL_LIBEXECS', shell=True)
-
The qtattributionsscannertorst.py error will be fixed by https://codereview.qt-project.org/c/pyside/pyside-setup/+/442370 , hopefully. As for missing links, did you really pass a Qt source tree - --qt-src-dir=/path/to/qt6/qtbase does not look like it. We use qdoc which needs the source tree.
-
@friedemannkleint said in Failed to build doc for pyside6 in qch by following the doc:
As for missing links, did you really pass a Qt source tree - --qt-src-dir=/path/to/qt6/qtbase does not look like it.
Yes, in practice I'm using a real path to
qt6/qtbase
instead of/path/to/qt6/qtbase
as a placeholder here.
12/18