Repository navigation
Qt5 v3 - #264
Qt5 v3#264
Conversation
Codecov Report
@@ Coverage Diff @@
## master #264 +/- ##
========================================
- Coverage 35.7% 33.2% -2.5%
========================================
Files 454 454
Lines 25343 25384 +41
Branches 3805 3818 +13
========================================
- Hits 9048 8429 -619
- Misses 15890 16577 +687
+ Partials 405 378 -27
Continue to review full report at Codecov.
|
|
For more api changes you can take inspiration from https://github.com/rwarren/qt_backport https://github.com/rwarren/qt_backport/blob/master/qt_backport/qt5_backport.py |
|
Thanks for PR @corranwebster . I really think this approach will involve less code and help in gradual move to Qt5. Addendum: The tests skipped due to segfaults do not segfault on my machine's distro supplied pyqt5, but only on the wheels on pypi, i suspect some compilation issue or so, though one segfault in traitsui table_editor was definitely buggy code: enthought/traitsui@ae05ee9 |
|
Qt5 tests are running, but failing with segfaults as noted by @pankajp. Suspicion should fall on the modal dialog testing code first. |
| try: | ||
| tk_object = plugin.load() | ||
| return tk_object | ||
| except ImportError as exc: |
There was a problem hiding this comment.
I think you could just change this to except ImportError as exception:
| try: | ||
| tk_object = plugin.load() | ||
| return tk_object | ||
| except ImportError as exc: |
There was a problem hiding this comment.
I think you could just change this line to except ImportError as exception:
|
I'm somewhat in favor for moving to something like |
|
I think a reasonable proposal (and what I suspect that @pankajp is working towards) is:
I think using QtPy is probably a good idea, but it may make sense to have a shim in Pyface ( |
This is not correct under Ubuntu 16.04 which I have been using for local testing, and more generally is not going to be correct on non-English systems. A better solution is needed, but not for this PR.
|
At this point the segfault is happening on Travis CI, but not the Ubuntu VM I've been using for testing, so it is getting hard to diagnose. I will branch here and play around to see what works. |
|
@corranwebster I'm happy with the approach of this PR (obviously). Once it is reviewed I think we should be able to get it merged without blocking on the segfaulting modal dialog tests imho because:
In a subsequent PR we can add something like |
Squashed merge of work to fix Qt5 tests. Currently get _occasional_ segfaults, but neither I or @pankajp can reproduce locally. * Disable potentially problematic tests on Qt5 to see what happens. * And disable some more. * Temporarily remove all non-qt5 tests to streamline work. * Disable only modal dialog tester tests. * Remove just 'open_and_wait' tests, leave 'open_and_run' tests. * Add back just one open_and_wait test. * Is click_button at fault, or is it open_and_wait? * Try explicit dialog close. * Fix tests, minor change to modal dialog tester. * Add back one confirmation dialog test. * Skip certain click-based tests on pyqt5. * Better test failure indicators when subwidget not found. * Message dialog is similarly suspect on pyqt5. * Missing import and bad skip message fixed. * Restore other tests, make qt5 tests allowed failures for now.
|
@pankajp I've merged in the test fixes branch, making the Qt5 tests "allowed failures" for now, since we still get occasional segfaults which can't be locally reproduced. Assuming CI runs successfully, do you think this is good to merge into master? |
pankajp
left a comment
There was a problem hiding this comment.
LGTM other than a few minor comments. Do the tests still occasionally fail even with the dialog tests skipped?
| break | ||
|
|
||
| # does our environment give us a preferred API? | ||
| qt_api = os.environ.get('QT_API') |
There was a problem hiding this comment.
This overwrites qt_api if some qt binding is already imported
|
|
||
| def setUp(self): | ||
| self.gui = GUI() | ||
| GuiTestAssistant.setUp(self) |
There was a problem hiding this comment.
Can super be used if GUITestAssistant was the first base class? I think mixin classes in Python have to be first base class to play nice with inheritance and super
There was a problem hiding this comment.
I prefer to do explicit call here, rather than super, because I found it surprising that TestCase didn't implement a trivial setUp and tearDown, so the explicit call flags the future readers of the code that something not usual is happening here.
| # XXX once pyqt5 is available in EDM, we will want it here | ||
| 'pyqt5': set(), | ||
| # XXX temporary workaround for bug in recent EDM wxpython build on OS X | ||
| 'wx': {'wxpython' if sys.platform != 'darwin' else 'wxpython==3.0.2.0-3'}, |
There was a problem hiding this comment.
I think this is fixed with latest wxpython
There was a problem hiding this comment.
No, this is an issue with the EPD/EDM build of wxpython-3.0.2.0-4 OS X which is still the current version being served. We can remove this if/when there is a 3.0.2.0-5 or higher build for OS X.
|
And yes, tests still segfault eg. https://travis-ci.org/enthought/pyface/jobs/214604026 I think there may be a problem with the
But I think that the problem is not with Qt5, but more with the testing infrastructure. |
|
Ok. LGTM. I'd have preferred letting pyside2 be if it doesn't harm, just in case someone wishes to try (pyside2 unofficial wheels are available on bintray). pyface could be yet another package pyside2 devs can test against |
|
The problem with Pyside2 was that it was first on the list and was not supported, so if it was installed it would be preferentially chosen and then fail (actually, it would try to use original Pyside). I also see we are back to getting occasional PyQt4 segfaults, but that is a known issue. |
|
Ok, let it be gone then. What about pyqt4 segfaults, i am not aware. Any pointers to issue/build failures? |
|
Yes, various Qt segfaults have been collected here: #251 A lot of them cleared up when we removed old-style signals and slots; I think we had situations where old-style and new style were being used together. I will merge this in a little bit. |
|
This is great! Over at hyperspy/hyperspy#1323 we're very excited for this, and it seems to be working well. |
This is another attempt at Qt5 compatibility. Following #256 we should have removed all old-style signals and slots, so at the object level, we have compatibility with Qt5. This PR takes a different approach to the previous PRs like #171 and is inspired by a comment by @pankajp there.
This PR tries to make the PyQt5 API compatible with PyQt4, so that code which depends on pyface.qt does not need to be modified. We may, at some future point, add a pyface.qt5 module or something similar which attempts forward compatibility instead of backwards compatibility.
To do: