Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 602528 - dev-python/QtPy-1.2.1: use flag equality should constrain all installed backends
Summary: dev-python/QtPy-1.2.1: use flag equality should constrain all installed backends
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-13 09:53 UTC by Erik Quaeghebeur
Modified: 2017-09-28 12:22 UTC (History)
2 users (show)

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


Attachments
QtPy-1.3.1.ebuild (QtPy-1.3.1.ebuild,1.54 KB, text/plain)
2017-09-24 11:49 UTC, Michael Palimaka (kensington)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2016-12-13 09:53:09 UTC
In the ebuild for dev-python/QtPy-1.1.2, we find

    || (
            dev-python/PyQt5[${PYTHON_USEDEP},designer=,svg=,webkit=]
            dev-python/PyQt4[${PYTHON_USEDEP},designer=,svg=,webkit=]
            dev-python/pyside[${PYTHON_USEDEP},designer=,svg=,webkit=]
       )

Assume QtPy has the webkit use flag enabled, e.g., for spyder. When PyQt4 has webkit enabled, but PyQt5 does not (all else being equal), then this is fine by this ebuild. However, when then QtPy uses the PyQt5 backend, e.g., for spyder, then an exception is raised related to the missing webkit functionality.

So the constraints need to be modified so that if a backend is installed, then it should satisfy the use flag constraint. I do not know how this should be done. What I can think of is the following inelegant hack: add a use flag for each of the backends and then, e.g., for the PyQt5 backend, do

    !pyqt5? ( !dev-python/PyQt5 )
    pyqt5? ( dev-python/PyQt5[${PYTHON_USEDEP},designer=,svg=,webkit=] )

The first line makes sure that the use flag has actual meaning and the second enforces the use flags if PyQt5 is installed.
Comment 1 Erik Quaeghebeur 2017-08-30 08:17:55 UTC
Still valid for current ebuild in portage.
Comment 2 Michael Palimaka (kensington) gentoo-dev 2017-09-24 11:23:00 UTC
Since QtPy is so automatic, I'm not sure if there's any good way we can handle it.
Comment 3 Michael Palimaka (kensington) gentoo-dev 2017-09-24 11:31:57 UTC
We may need to introduce USE flags for each of the supported backends and move each dependency behind that USE flag and patch qtpy/__init__.py to only support the enabled backends.
Comment 4 Michael Palimaka (kensington) gentoo-dev 2017-09-24 11:49:59 UTC
Created attachment 496262 [details]
QtPy-1.3.1.ebuild

Here's an ebuild for the latest version of QtPy with my suggested changes. Testing would be greatly appreciated.
Comment 5 Erik Quaeghebeur 2017-09-27 14:20:05 UTC
(In reply to Michael Palimaka (kensington) from comment #4)
> Here's an ebuild for the latest version of QtPy with my suggested changes.
> Testing would be greatly appreciated.
It installed without problems. I quickly tested Spyder, the application I use that uses QtPy, and it seems to work without a hitch.

My use flags:

opengl pyqt5 svg webkit -designer -gui -pyqt4 -pyside -testlib PYTHON_TARGETS="python2_7 python3_4 -python3_5 -python3_6"
Comment 6 Michael Palimaka (kensington) gentoo-dev 2017-09-28 12:18:04 UTC
Thanks for the feedback, it's definitely appreciated.
Comment 7 Larry the Git Cow gentoo-dev 2017-09-28 12:22:06 UTC
The bug has been closed via the following commit(s):

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

commit 649ce73ba08a5fd8af802937b3b44fab8e9a4a82
Author:     Michael Palimaka <kensington@gentoo.org>
AuthorDate: 2017-09-28 12:21:39 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2017-09-28 12:21:56 +0000

    dev-python/QtPy: version bump 1.3.1
    
    Closes: https://bugs.gentoo.org/602528
    Closes: https://bugs.gentoo.org/611856
    Package-Manager: Portage-2.3.8, Repoman-2.3.3

 dev-python/QtPy/Manifest          |  1 +
 dev-python/QtPy/QtPy-1.3.1.ebuild | 55 +++++++++++++++++++++++++++++++++++++++
 dev-python/QtPy/metadata.xml      |  3 +++
 3 files changed, 59 insertions(+)