Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916213 - dev-python/pyside6-tools: does not install pyside6-uic (nor uic)
Summary: dev-python/pyside6-tools: does not install pyside6-uic (nor uic)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Nowa Ammerlaan
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-24 10:47 UTC by David Roman
Modified: 2023-10-26 14:34 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pyside6 tools logs (pyside6-tools.log,5.14 KB, text/x-log)
2023-10-24 15:17 UTC, David Roman
Details
pyside6-tools ebuild (pyside6-tools-6.6.0.ebuild,951 bytes, application/vnd.gentoo.ebuild)
2023-10-25 08:17 UTC, Nowa Ammerlaan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Roman 2023-10-24 10:47:17 UTC
dev-python/pyside6-tools does not install pyside6-uic. There is, in fact, a cmake option called NO_QT_TOOLS, but it's explicitly enabled because pyside tools conflict with tools from Qt, still, I installed a full set of Qt packages (qt-creator[designer,qmldesigner] and so) but none of those provides any uic binary.
Disabling NO_QT_TOOLS cmake doesn't seem to be enough to enable installation of pyside6 tools in any case.



Reproducible: Always
Comment 1 Nowa Ammerlaan gentoo-dev 2023-10-24 14:15:02 UTC
Disabling NO_QT_TOOLS just results in installing some symlinks that will cause file conflicts.

The real problem here is that you can't find the uic tool, this should be provided by some qt packages, though I also do not know which. @Qt team could you help with this?
Comment 2 Ionen Wolkens gentoo-dev 2023-10-24 14:46:49 UTC
(In reply to Andrew Ammerlaan from comment #1)
> Disabling NO_QT_TOOLS just results in installing some symlinks that will
> cause file conflicts.
> 
> The real problem here is that you can't find the uic tool, this should be
> provided by some qt packages, though I also do not know which. @Qt team
> could you help with this?
It's installed by qtbase, but it's not a user-facing-tool[1] (aka meant to be found through cmake or qmake if needed, not normally executed directly in PATH), so there's intentionally no /usr/bin symlink and it's available at /usr/lib64/qt6/libexec/uic

[1] https://doc.qt.io/qt-6/packaging-recommendations.html
Comment 3 Ionen Wolkens gentoo-dev 2023-10-24 14:50:43 UTC
For comparison, PyQt6 installs a pyuic6 rather than plain "uic".
Comment 4 David Roman 2023-10-24 14:54:43 UTC
(In reply to Andrew Ammerlaan from comment #1)
> Disabling NO_QT_TOOLS just results in installing some symlinks that will
> cause file conflicts.
> 
> The real problem here is that you can't find the uic tool, this should be
> provided by some qt packages, though I also do not know which. @Qt team
> could you help with this?

Sorry, I should have been more clear. One of the installed files, pyside_tool.py expects uic executable to be installed and available on the system, which is not the case. I guess that pyside6 should install uic file or rather depend on the package that provides uic executable. Given that in the ebuild description, it mentions explicitly pyside6-lupdate it made me think that the tools would be installed with "pyside6-" prefix, but pyside6-lupdate is not installed nor any of the tools are installed with that prefix. My main issue is that uic is not installed but it seems that the problem is more broadly than just that.

A part from that, all the tools that are installed are broken (none of those seems to be able to execute directly). The only way to execute the installed commands are callng to "python /usr/lib/python-exec/python3.xx/tool.py" and even in that case all tested programs break for not being able to import different python modules. Maybe this requires a bug for it's own.
Comment 5 Nowa Ammerlaan gentoo-dev 2023-10-24 15:02:59 UTC
(In reply to David Roman from comment #4)
> Sorry, I should have been more clear. One of the installed files,
> pyside_tool.py expects uic executable to be installed and available on the
> system, which is not the case. 

Does it work if you install qtchooser? Or if you add /usr/lib64/qt6/libexec to your PATH?

> I guess that pyside6 should install uic file
> or rather depend on the package that provides uic executable. Given that in
> the ebuild description, it mentions explicitly pyside6-lupdate it made me
> think that the tools would be installed with "pyside6-" prefix, but
> pyside6-lupdate is not installed nor any of the tools are installed with
> that prefix. My main issue is that uic is not installed but it seems that
> the problem is more broadly than just that.

pyside6-lupdate (and uic) is just a symlink to qtchooser, see also: https://bugs.gentoo.org/907409 

This is why we don't install it. AFAIK it doesn't add functionality and it causes file conflicts (at least it used to cause file conflicts, no idea if it still does)
 
> A part from that, all the tools that are installed are broken (none of those
> seems to be able to execute directly). The only way to execute the installed
> commands are callng to "python /usr/lib/python-exec/python3.xx/tool.py" and
> even in that case all tested programs break for not being able to import
> different python modules. Maybe this requires a bug for it's own.

Which modules are you missing? Could you upload some example output?
Comment 6 David Roman 2023-10-24 15:17:29 UTC
Created attachment 873413 [details]
pyside6 tools logs
Comment 7 David Roman 2023-10-24 15:19:14 UTC
(In reply to Andrew Ammerlaan from comment #5)
> (In reply to David Roman from comment #4)
> > Sorry, I should have been more clear. One of the installed files,
> > pyside_tool.py expects uic executable to be installed and available on the
> > system, which is not the case. 
> 
> Does it work if you install qtchooser? Or if you add /usr/lib64/qt6/libexec
> to your PATH?
> 
> > I guess that pyside6 should install uic file
> > or rather depend on the package that provides uic executable. Given that in
> > the ebuild description, it mentions explicitly pyside6-lupdate it made me
> > think that the tools would be installed with "pyside6-" prefix, but
> > pyside6-lupdate is not installed nor any of the tools are installed with
> > that prefix. My main issue is that uic is not installed but it seems that
> > the problem is more broadly than just that.
> 
> pyside6-lupdate (and uic) is just a symlink to qtchooser, see also:
> https://bugs.gentoo.org/907409 
> 
> This is why we don't install it. AFAIK it doesn't add functionality and it
> causes file conflicts (at least it used to cause file conflicts, no idea if
> it still does)
>  
> > A part from that, all the tools that are installed are broken (none of those
> > seems to be able to execute directly). The only way to execute the installed
> > commands are callng to "python /usr/lib/python-exec/python3.xx/tool.py" and
> > even in that case all tested programs break for not being able to import
> > different python modules. Maybe this requires a bug for it's own.
> 
> Which modules are you missing? Could you upload some example output?

I uploaded a log with the log of the different installed tools. For now installing qtchooser don't seems likely to fix the issue.
Comment 8 Nowa Ammerlaan gentoo-dev 2023-10-25 08:17:25 UTC
Created attachment 873420 [details]
pyside6-tools ebuild

The major difficulty is that I honestly have no clue how this is supposed to work.

This ebuild simplifies things and uses the upstream cmake file to install. This comes with a whole new set of problems. But maybe this ebuild behaves more like you would expect, could you give it a try?
Comment 9 David Roman 2023-10-25 13:50:08 UTC
The results seems to be the same. Maybe I'm misunderstanding something. Also I am confused by the fact that qt-creator, when creating a python project with pyside, references pyside6-uic tool, but CMakeSources.txt from pyside6-tools does not seem to install such a program, or at least with that name. Other tools, like qml.py, seems to be called "pyside6-name" in the source code but are installed like "qml.py". 

Are qml.py (pyside6-tools) and /usr/bin/qml5 from qtdeclarative intended to do the same job? It sems that qml.py does something very similar than qml5 but it extends it to work with python or something like this? 

Maybe is my lack of expertise with pyside, but I find this very messy.
Comment 10 Nowa Ammerlaan gentoo-dev 2023-10-25 15:55:35 UTC
(In reply to David Roman from comment #9)
> The results seems to be the same. Maybe I'm misunderstanding something. Also
> I am confused by the fact that qt-creator, when creating a python project
> with pyside, references pyside6-uic tool, but CMakeSources.txt from
> pyside6-tools does not seem to install such a program, or at least with that
> name. Other tools, like qml.py, seems to be called "pyside6-name" in the
> source code but are installed like "qml.py". 

I dug a bit into this and it seems like those 'pyside6-name' things are only installed by the pip wheel. If you install that in a python venv then you find that all those 'pyside6-name' things actually do is 'from PySide6.Scripts.pyside_tool import name'. This seems the way it is intended to be used because executing anything directly (even pyside_tool.py) just produces errors. 

The question then is is how we can make this work in our ebuild, I honestly have no clue yet. cmake --install doesn't help because it installs those scripts to /usr/bin where it can't be found by python's import.
 
> Are qml.py (pyside6-tools) and /usr/bin/qml5 from qtdeclarative intended to
> do the same job? It sems that qml.py does something very similar than qml5
> but it extends it to work with python or something like this? 

I think so, I still don't understand what it is pyside_tool.py is supposed to do. But the whole thing seems to be just a wrapper.

> Maybe is my lack of expertise with pyside, but I find this very messy.

It is definitely not you, pyside is one big headache. If possible, you might want to give PyQt6 a try. 

I also wonder if we need pyside6-tools packaged at all? If all it does is wrap things then does packaging this add any value or is it just a big confusing complication?
Comment 11 David Roman 2023-10-25 16:45:03 UTC
(In reply to Andrew Ammerlaan from comment #10)
> I dug a bit into this and it seems like those 'pyside6-name' things are only
> installed by the pip wheel. If you install that in a python venv then you
> find that all those 'pyside6-name' things actually do is 'from
> PySide6.Scripts.pyside_tool import name'. This seems the way it is intended
> to be used because executing anything directly (even pyside_tool.py) just
> produces errors. 

I see, that makes sense. 

> It is definitely not you, pyside is one big headache. If possible, you might
> want to give PyQt6 a try. 

I used PyQt in the past, but wanted to try the official tools instead of third-party projects. Seems I would have to stick to PyQt, or create a python venv.

> I also wonder if we need pyside6-tools packaged at all? If all it does is
> wrap things then does packaging this add any value or is it just a big
> confusing complication?

For me it was confusing, but I don't know which use cases it could have. At least if those scripts have to be imported maybe it makes sense to remove the symlinks from /usr/bin?
Comment 12 Larry the Git Cow gentoo-dev 2023-10-25 20:05:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc139b269e3ccd66f17509cc1a1c2f9415f5f677

commit bc139b269e3ccd66f17509cc1a1c2f9415f5f677
Author:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
AuthorDate: 2023-10-25 19:59:53 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
CommitDate: 2023-10-25 20:04:59 +0000

    dev-python/pyside6-tools: correctly install the scripts
    
    None of these should be called directly, they are supposed to be
    imported via pyside_tool.py.
    
    This matches the install layout of the pypi wheel. There are also
    some wrappers installed in the pypi wheel but they don't appear to
    be very useful.
    
    Bug: https://bugs.gentoo.org/916213
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

 ...-tools-6.6.0.ebuild => pyside6-tools-6.6.0-r1.ebuild} | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
Comment 13 Nowa Ammerlaan gentoo-dev 2023-10-25 20:13:31 UTC
The new ebuild installs all the pyside6-tools files exactly as 'pip install' would (I have verified this with diff -r).

I omitted the wrappers because it is still unclear to me what we would need them for and how they should be generated and installed. 

Please let me know if there are any additional problems.
Comment 14 Ionen Wolkens gentoo-dev 2023-10-26 00:33:39 UTC
(In reply to David Roman from comment #11)
> I used PyQt in the past, but wanted to try the official tools instead of
> third-party projects. Seems I would have to stick to PyQt, or create a
> python venv.
Packaging-wise official tools been mostly nothing but a nightmare that breaks for one reason or another, not to mention that they mostly drop support without a commercial license for old Qt branches while python tend to need active development to keep up with new python versions (aka pyside2 is a mess and it's questionable how long will be able to keep it packaged).

Generally I'd recommend to stick to PyQt.
Comment 15 Larry the Git Cow gentoo-dev 2023-10-26 14:34:59 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1bf9c3ea3f709ace61dbe1857b0474e929ac837

commit d1bf9c3ea3f709ace61dbe1857b0474e929ac837
Author:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
AuthorDate: 2023-10-26 14:28:03 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
CommitDate: 2023-10-26 14:34:50 +0000

    dev-python/pyside2-tools: also install pyside_tool.py
    
    This mirrors the recent changes to pyside6-tools
    
    Bug: https://bugs.gentoo.org/916213
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

 .../files/pyside2-tools-5.15.11-no-copy-uic.patch  | 43 ++++++++++++++++++++++
 ...5.11.ebuild => pyside2-tools-5.15.11-r1.ebuild} | 23 +++++-------
 2 files changed, 52 insertions(+), 14 deletions(-)