Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2045

Replace Command with Python Function in pyside6-project

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P4: Low
    • None
    • 6.3
    • PySide, Tooling
    • None
    • All

    Description

      Currently, the way pyside6-project invoking pyside6-uic and other tools is using subprocess. This will not work if the user does not install PySide6 in global site-packages. A workaround for user is to enter the venv before run pyside6-project.

      I think we can replace the command with the Python function. So, the user only need to specify the correct Python interpreter with PySide6 installed. Namely,

      # instead of using subprocess.call(['pyside6-uic', *args])
      
      from PySide6.scripts.pyside_tool import uic
      
      sys.argv = # update argv accordingly
      uic()
      

      In this way, the user do not need to care what is the current shell environment (global, in venv or in Poetry) to execute the command. Also, it would be much easier for editor extension development as the extension only needs to specify the correct Python interpreter without any knowledge about shell environment. (e.g. https://marketplace.visualstudio.com/items?itemName=seanwu.vscode-qt-for-python)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shpremna Shyamnath Premnadh
            alan13wake Sean Wu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes