Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Failed to build doc for pyside6 in qch by following the doc

Failed to build doc for pyside6 in qch by following the doc

Scheduled Pinned Locked Moved Solved Qt for Python
18 Posts 3 Posters 3.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jronaldJ jronald

    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?

    jronaldJ Offline
    jronaldJ Offline
    jronald
    wrote on last edited by jronald
    #7

    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?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      friedemannkleint
      wrote on last edited by
      #8

      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.

      jronaldJ 1 Reply Last reply
      1
      • F friedemannkleint

        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.

        jronaldJ Offline
        jronaldJ Offline
        jronald
        wrote on last edited by jronald
        #9

        @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.
        ...
        
        1 Reply Last reply
        0
        • F Offline
          F Offline
          friedemannkleint
          wrote on last edited by friedemannkleint
          #10

          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.

          jronaldJ 1 Reply Last reply
          1
          • F friedemannkleint

            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.

            jronaldJ Offline
            jronaldJ Offline
            jronald
            wrote on last edited by jronald
            #11

            @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 of cmake 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
            
            1 Reply Last reply
            0
            • jronaldJ Offline
              jronaldJ Offline
              jronald
              wrote on last edited by
              #12

              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.
              
              JonBJ 1 Reply Last reply
              0
              • jronaldJ jronald

                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.
                
                JonBJ Online
                JonBJ Online
                JonB
                wrote on last edited by JonB
                #13

                @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 accepts qtpaths --query? Try both of these from the command line to see if that is the cause of the error message?

                jronaldJ 1 Reply Last reply
                1
                • JonBJ JonB

                  @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 accepts qtpaths --query? Try both of these from the command line to see if that is the cause of the error message?

                  jronaldJ Offline
                  jronaldJ Offline
                  jronald
                  wrote on last edited by jronald
                  #14

                  @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)
                  
                  1 Reply Last reply
                  0
                  • jronaldJ Offline
                    jronaldJ Offline
                    jronald
                    wrote on last edited by
                    #15

                    screenshot
                    4ddb06a7-b8eb-4f72-a28e-318517fce8b2-image.png

                    1 Reply Last reply
                    0
                    • jronaldJ Offline
                      jronaldJ Offline
                      jronald
                      wrote on last edited by jronald
                      #16

                      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)
                      
                      1 Reply Last reply
                      0
                      • F Offline
                        F Offline
                        friedemannkleint
                        wrote on last edited by
                        #17

                        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.

                        jronaldJ 1 Reply Last reply
                        2
                        • F friedemannkleint

                          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.

                          jronaldJ Offline
                          jronaldJ Offline
                          jronald
                          wrote on last edited by jronald
                          #18

                          @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.

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved