-
Notifications
You must be signed in to change notification settings - Fork 54
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
Pyside support and usage #114
Comments
You made a very good analysis of the issue, thanks. In short, I would absolutely love to clean this up. It just hasn't been high on anyone's priority list. I agree with you that it would be much better to pick one solution here, and make it work. Keep in mind that whatever solution we pick has to satisfy the following constraints:
If the solutions you outline above meet all of that, then we would be happy to review patches to make the conversion over. This will also simplify your other PR for RViz, as we can use the same solution there. |
First, thanks for the quick response!
Okay, that RHEL narrows things down to pyqt5 as default option, as there is no PySide2 packages available. QtPy is not available in RHEL package index, but it could be installed via pip.
PySide adn pyqt have versions that work with Qt5 and Qt6, qtpy works with qt4-6.
All are installable with pip on Windows so it should work - primary target of pyside seems to be infact windows. However, pip installs do not come with cmake, so there would need to be a seperate FindPackage.cmake for pip installs in order to make this packages cmake files work. Plan of Work:
Information needed: Here are the python_qt_binding dependants: |
Okay, one correction, qtpy seems to be in EPEL 8 https://packages.fedoraproject.org/pkgs/python-QtPy/python3-QtPy/. So I think we can move along with using qtpy as well. |
This package was carried over from ROS 1. I'm not familiar with QtPy, but I'd guess it wasn't an option back when this package was created. It seems like QtPy and QtPy:
This package
Is it possible to remove |
Yes this should be possible. I have added a temporary pass through in #115, that uses qtpy and warns users, that import via python_qt_binding is going to be deprecated. QtPy has also the advantage that it will ease potential switching to qt6 in the future... |
Alright, what I have done for now is the following:
|
@sloretz
Motivation
I was working on ros2/rviz#889 and I have found a couple of issues with qt python integration, especially dependencies. I was looking into creating python bindings for rviz only with PySide2. No I was wondering how to resolve dependencies and turns out there is no key for pyside2 is not in rosdistro but partially in python_qt5_bindings. This all seems kind of unorganised and super hard if you want to create bindings that only support one of the to binding generators.
Problems
pyside2 in rosdistro:
The most essential packages python3-pyside2.qtcore, python3-pyside2.qtgui and python3-pyside2.qtwidgets are not installed by libpyside2-dev, libshiboken2-dev or shiboken in rosdistro. python-pyside2 does not even exist in Ubuntu.
By changing to the following we would at least install the same libraries for pyqt and pyside on Ubuntu:
Interoperability of PyQt and PySide:
Additionally, why are we not using QtPy(https://github.com/spyder-ide/qtpy) (MIT LICENSE), which has much better support for interoperability between pyside and pyqt, than just replacing names, especially for edge cases. There are also ubuntu/debian binaries in universe.
Conclusion
Qt for Python support is super shady and not well organised. It is very hard to understand which systemdeps to reference to install what. In addition python_qt_bindings will install both pyside2 and pyqt5. Generally, I would rather like to see an approach similar to the rmw's where we have a default and the option to install and use the the other.
Suggestion
The text was updated successfully, but these errors were encountered: