-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing Qt.py with VFX Platform CY2018 #234
Testing Qt.py with VFX Platform CY2018 #234
Conversation
Tests errorsPython 2.7 error
Python 3.x error
|
__version__ = "2.0.0~alpha0"
__version_info__ = (2, 0, 0, "alpha", 0)
__build_date__ = '2017-08-25T22:36:31+00:00'
__build_commit_date__ = '2017-08-24T14:05:49+00:00'
__build_commit_hash__ = '117e0ff91275b4bc06dd5383f19e7028c5ef6ff8'
__build_commit_hash_described__ = '2.0.0.dev0-4859-g117e0ff9'
|
@mottosso so, now I need to do some checking in our tests whether a new PySide2 is used or an older one. I'm thinking we could add a new function to QtCompat which parses the import datetime
# Just example code...
def pyside2_commit_date():
try:
commit_date = PySide2.__build_commit_date__
datetime_object = datetime.strptime(
commit_date[: commit_date.rfind('+')], '%Y-%m-%dT%H:%M:%S'
)
except AttributeError:
# PySide2 version which doesn't have the attribute
datetime_object = None
return datetime_object In our tests, we could then do something like: import datetime
pyside2_commit_date = QtCompat.pyside2_commit_date()
if pyside2_commit_date is None:
# old version is being used
elif pyside2_commit_date <= SOME_DATE:
# pyside2 is older or equal to SOME_DATE
...
... Note: I just wrote this code without having run it. So, it's a bit like pseudo at this point. This way we can utilize date checks against PySide2 builds in tests, caveats – and make the tests code more grokable, I think. What do you think? |
I ended up not adding anything to I don't think I can put if conditions in the caveats code snippets and then also put a return value, can I? >>> if hasattr(Qt, '__build_commit_date__'):
... widget == button
True
>>> else:
... widget == button
False Anyway, I ended up adding Now, we're getting a lot of membership errors with Python 2.7. But all other platforms/combos are green/OK. However, if they were to run the membership tests, they would also fail. Not sure how we should proceed here... should we add more members to the |
Common member changes; topics for discussionThis PR is getting ready to be merged. But... We really haven't talked about how to deal with the fact that PySide2 seems to be picking up speed and is adding new members - and how Qt.py should reflect this change. BackgroundRight now, we have a script in place ( So how do we deal with a change of common members? Clarifying our decisions on this in the project goalsEither we just go with what's the latest and greatest and just include these new common members in Qt.py. Or we do something different. The drawbacks of going with the latest common bindings generated using the latest container is that those members are not available in older versions of PySide2 (which may exist in old versions of e.g. Maya, Nuke etc). This, to me seemingly new, behaviour is not completely clear in e.g. our project goals. I think it would be multiple orders of difficult to maintain a Qt.py which is somehow aware of where it is running and what limitations in terms of common members it may have. I think we should just go with the latest and greatest. This means slightly tweaking and clarifying this in the project goals, I think. Dealing with this in our membership testRight now, we have a test for members. In this test, I'm excluding members based on which container is running the test. This seems to me to be the most pragmatic way to make this test run. When new members are added to Qt.py, old containers would fail and we'd have to add the new members to a "skip list" in the membership test. Right now, this was the most maintainable approach I could come up with. Documenting the member changesI wouldn't call the "skip list" in the membership test a documentation of common members change ..but it kind of is, for us. I don't think this is worth dragging out from the darkness (of the tests) and into the light (of the main README.md) and present such changes there. Especially not since everyone is probably using different versions of PySide2 (without being able to pinpoint the exact version due to the lack of a version string). The need to update the Docker containers more frequentlyIt's likely that a user is running a later build of PySide2 than we have in our Docker test container, and that they believe a certain member needs to be added to Qt.py. We could potentially build a new Docker image and append this to the current set of test containers. But I'd say we postpone this issue onto the future for when (and if) it happens. I have great hopes that we won't have to update the test containers more often than once a year. @mottosso what do you think about all of this? |
They won't need any updates, so long as they are an accurate reflection of the versions set by VFX Reference Platform. Users using any other versions are on their own. At most, we'll need a new image each year. I think that should answer the remaining questions too? |
The problem lies with that PySide2 does not have a maintained version string (PySide2 built from any git commit from the "5.6" branch has version "2.0.0~alpha0") and the VFX Platform just specifies "PySide 2.0.x" which basically translates into any version (or commit) of PySide2.
That's everyone, including us. Everyone probably just use the latest source available at the time when they need to build PySide2. We chose to use a build around the time of SIGGRAPH. The VFX Platform could specify a git commit or a git commit date/hash, but they aren't doing that. This is why I posted my previous novel-like "topics for discussion"... |
To avoid getting too deep into complex discussions over theoretical scenarios, I've instead updated the README.md and DOCKER.md to attempt to explain the issue at hand. So, in case you understand what I'm trying to explain I think we are good :) but if you find the updated README (check the diff) hard to grok, then we probably need to clarify this further. @mottosso To sum it up, it would be great with a review of this PR and add the following to the next release notes:
I think we should then close #219 and consider releasing a non-beta version of Qt.py at PyPi and in Anaconda cloud. |
Since you are adding modules, it would also be useful to include QtCore.QStandardPaths in the next release. Thanks. |
@alby128 I don't see QtCore.QStandardPaths in either of the bindings/versions (Qt <=5.6). Which binding are you using where this is available and which version? Qt.py will only contain built in support for members available throughout all bindings. You can modify this behavior and add members yourself using QtSiteConfig.py. Please refer to the main README for more information. |
QStandardPaths has been introduced in Qt 5 as (partial) replacement for (some features of) QDesktopServices. See the first paragraph here: http://doc.qt.io/qt-5.6/whatsnew50.html . So it is not available on PySide1.x and PyQt4. However, it is available on PyQt5 (see here) and on PySide2 (I checked in a version that I just built from sources and in the conda binaries). I do not know what is your policy for modules that are only available on Qt >= 5.6. Thanks for the tip on how to add a member. |
@alby128 thanks for clarifying. We want Qt.py to support members which exist throughout all the bindings so that software built with Qt.py has greater chances running regardless of binding. We're know this limits the Qt library compatibility but this is also one of the reasons we built Qt.py to begin with; to support both Qt4 and Qt5 bindings (but only members which exists in both). Of course, your request is not uncommon and that's why we also enabled the possibility to add your own members in case you need to break out of "total compatibility". I hope this works for you (QtSiteConfig.py) as we don't want to add these specific members to Qt.py as they do not exist throughout all the bindings. |
Hey @fredrikaverpil, should we merge this? |
@mottosso yes, we should be fine merging this. Two changes were made to the original CY2018 which isn't part of this docker build:
I'll try to cover those as soon as I can, but in the meanwhile we're fine merging this as-is. |
I'm re-running the latest checks and when done, feel free to merge! |
All tests OK - merge away! PS. I noticed that Qt4 (required for PySide, PyQt4) won't compile with the late CY2018 gcc version change (gcc 6.3.1). This means we'll have to manage two gcc versions for a CY2018-Update 1 image. But for now, let's merge this. |
How about bumping the version to 1.1.0b8 and planning for a 1.1.0 release on pip and anaconda cloud? |
Sounds like a good idea. 👍 |
This is a work in progress and is not ready to merge.
Blocking:
To do:
DOCKER.md
with CY2018 specification tableREADME.md