PR: Change access of constants to scoped enum style for PyQt6#179
PR: Change access of constants to scoped enum style for PyQt6#179kumattau wants to merge 1 commit intospyder-ide:masterfrom
Conversation
At least, the changed code works with pyqt 5.9.7 of conda.
|
I'm sorry, this change does not work with Python 3.7 or before, but I don't know why... |
7a8af2c to
326c5a5
Compare
|
Don't worry @kumattau ! But yes, checking locally with Python 3.7/PyQt 5.9.2 on conda and pip seems like Not totally sure what to do, maybe we should update the tests to be run using the |
Before doing changes here, I think we should decide what to do about this problem on QtPy. This is something @dalthviz and I are discussing and we'd prefer to preserve the way to access enums in PyQt5 to not break current apps (although that's something we'd like to discuss with the rest of the community on issue spyder-ide/qtpy#233). If we all agree on that, then this PR wouldn't be necessary, I think. |
I'm fine with moving our tests to conda-forge. |
|
@dalthviz, @ccordoba12, thank you for comment.
This problem seems to be caused by that sip-4.19.8 in conda Python 3.6 and 3.7 environment is too old to support scoped enum. sip seems to support scoped enum in version 4.19.9 or later. In short, PyQt 5.9 is ready for scoped enum but requires sip 4.19.9 or later for it. In conda, sip-4.19.13 package is available but the package cannot installed in Python 3.6 or 3.7 environment for the package dependency. All packages are installed from conda: Overwrite installation of Sip from source:
Should I withdraw PR at the moment until the policy is decided ? |
No, let's wait until we decide what to do about this issue in QtPy. |
|
NB, seems like we decided to have QtPy promote scoped to unscoped enums in PyQt6 for compatibility purposes, in spyder-ide/qtpy#271 |
|
Hi @CAM-Gerlach Thank you for info. |
This PR is for changing access of constants to scoped enum style for PyQt6.
(I used spyder-ide/qtpy#233 (comment) 's tools to change)
As spyder-ide/qtpy#233 (comment) says
in the case of PyQt 5.9.2 provided by the latest conda,
the constants contained in qtawesome can be accessed via scoped enums.
I think this PR can be merged if support of qtawesome is enough with PyQt 5.9.2 or later.
I tested scoped enums using https://gist.github.com/kumattau/fa9e75b4cea6ec3722d9960f5a3996c9.