PR: Define Qt/binding versions at top level, fix warnings if versions not found, and fix test dir on CIs#292
PR: Define Qt/binding versions at top level, fix warnings if versions not found, and fix test dir on CIs#292CAM-Gerlach merged 2 commits intospyder-ide:masterfrom CAM-Gerlach:fix-version-check-error
Conversation
|
Okay, I figured out what's going on. Since QtPy doesn't use the recommended |
|
@dalthviz @ccordoba12 if either of you could look this over and merge this if there's nothing serious going on, so that tests are passing on |
ccordoba12
left a comment
There was a problem hiding this comment.
Looks good to me, thanks @CAM-Gerlach!
|
Thanks @ccordoba12 ! |
Followup to merging PR #289 to
masterfollowing a very weird and unexpected check failure on Win 10 + PyQt 5.9 + conda + Python 3.6; see CI logs.Seems like there's some weird behavior on this very specific CI run, where the tests pass, but when we run the command to save the path for the test coverage, which imports QtPy a second time in a new instance of the same interpreter,
QT_VERSIONis not defined, which must mean that all theifblocks either didn't trigger or had anImportErrorand QtPy fell back to using PyQt5. I could understand if PyQt 5.9 didn't define those top-level constants (since the source repo is not public, I tried to check beforehand but couldn't), but the fact that it worked without error the first time for the tests leads me to believe that it must either have been something with setting the env variables that triggered the different behavior on the second, or there's something else I'm not accounting for going on.EDIT: It was the latter, the second Python command was run without
-Iwhich resulted in shadowing due to the hack I used to avoid problems due to the non-src directory layout. See below for full details.While this PR fixes the proximate error and ensures that the top-level constants are always at least defined, I want to see if I can reproduce this locally in the same env, as it may indicate an underlying issue.Done, see below.So, this PR implements three levels of fixes to the related issues discovered here:
QT_VERSIONis defined first before acting on it (like all the others)Noneat the top of the file, which avoids them being undefined if no Qt API is found and also reduces duplication and verbosity