Opened 5 years ago

Closed 4 years ago

#57823 closed enhancement (fixed)

py-qtpy: allow py-pyside2 instead of py-pyqt5

Reported by: chrstphrchvz (Christopher Chavez) Owned by: eborisch (Eric A. Borisch)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mamoll (Mark Moll), pmetzger (Perry E. Metzger), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), reneeotten (Renee Otten)
Port: py-qtpy py-pyqt5 py-pyside2

Description (last modified by chrstphrchvz (Christopher Chavez))

Since QtPy supports PySide2 (which is now Qt's official bindings for Python) in addition to PyQt5, should it be possible for the py-qtpy port (as well as any ports using it, e.g. Spyder) to allow py-pyside2 as a substitute for py-pyqt5? I am not an expert on their differences, nor do I have any preference that PySide2 become MacPorts' default over PyQt5.

If so, I imagine adding a variant qtpy +pyside2 would be the approach for this (similar to what py-matplotlib has, though it doesn't use QtPy). However if the py-qtpy port is what ensures a Qt backend is installed, should that dependency then be removed from ports depending on qtpy (spyder and spyder-devel), or is the PyQt5 dependency used to ensure a Qt5 backend is present—i.e. when Qt4 can't be used?

Change History (6)

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Cc: mamoll pmetzger MarcusCalhoun-Lopez reneeotten added
Owner: set to eborisch
Status: newassigned

comment:2 Changed 5 years ago by reneeotten (Renee Otten)

A while back I opened a PR2615 to add variants for the different backends. Admittedly, there were some issues with my suggested changes in that PR, but the idea of adding variants was not met with much enthusiasm. I am not against looking at this again, but I am not sure whether @eborisch has changed his opinion on this (at least the comments in the abovementioned PR should be kept in mind).

comment:3 Changed 5 years ago by mf2k (Frank Schima)

Perhaps sub-ports can be made. So for example, create a new (sub-)port for py-qtpyside or maybe call it py-qtpy-pyside - which has too many "py"s for my liking.

comment:4 Changed 5 years ago by eborisch (Eric A. Borisch)

Since qtpy doesn't actually need any of these to be in place to be "compiled" and installed, perhaps we just remove all *qt* dependencies from qtpy, and have it note on install that it provides an interface layer, but one of x, y, or z needs to be installed to be of any use, and let ports that actually use qtpy decide for themselves (through variants, or supports) what underlying implementation (pyside2, pyqt4, etc.) is depended upon.

Edit: fixed s/pyside/qtpy/ typo

Last edited 5 years ago by eborisch (Eric A. Borisch) (previous) (diff)

comment:5 Changed 5 years ago by chrstphrchvz (Christopher Chavez)

Description: modified (diff)
Port: py-spyder py-spyder-devel removed

Never mind about having Spyder ports use PySide2; upstream has decided to not support it for the time being: https://github.com/spyder-ide/spyder/issues/6894.

If nothing using QtPy currently "needs"/"really should have" PySide2 as an alternative to PyQt5, then I don't mind this being closed or put off indefinitely/wishlisted. I intended this more as a suggestion in case it were trivial to add, but it sounds like that's definitely not the case.

comment:6 Changed 4 years ago by reneeotten (Renee Otten)

Resolution: fixed
Status: assignedclosed

In 8920b908f091903a01a79780bfc030d5ab4c6dd2/macports-ports (master):

py-qtpy: add py38 subport, remove variants

Ports that use py-qtpy should additionally declare a dependency on the
backend to use.

Check if any of the backends is installed; if not add a warning about
this in the notes and do not run the test-phase.

Closes: #57823

Note: See TracTickets for help on using tickets.