Skip to content
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

Implement Optional Submodules #185 #186

Merged
merged 14 commits into from
Mar 22, 2017

Conversation

mottosso
Copy link
Owner

@mottosso mottosso commented Mar 11, 2017

This implements #185, a loosening of the strictness in such a way that (1) still only PySide2 members are present, but (2) members are not required.

This should enable use in less than ideal environments, such as certain OSs that lack various submodules or submodule members, such as QtOpenGL, or applications that may or may not expose the entirety of a binding, such as the lack of QtHelp under Houdini.

The result should be software that is robust and reliable, with a Qt.py that is more forgiving where needed.

To test

# Via pip
$ pip install git+https://github.com/abstractfactory/Qt.py.git@implement185
$ python -c "import Qt"

# Via git
$ git clone https://github.com/abstractfactory/Qt.py.git
$ cd Qt
$ git checkout implement185
$ python -c "import Qt"

Or copy/paste this file.

Let me know what you think!

Sometimes, packages are updated natively on the OS, in this case Ubuntu. Now this member was discarded.
@tomwod
Copy link

tomwod commented Mar 13, 2017

working nicely for me with a mix of win7, maya2017,houdini16 & nuke9. thanks! (+ big thumbs up generally for the whole Qt.py project)

@mottosso
Copy link
Owner Author

That's great to hear @tomwod!

If all is as it should, you should find that Maya grants access to Qt.QtHelp, whereas Houdini 16 does not.

Can you confirm? I heard they patched that up in a recent nightly, so you may not catch it.

Qt.py Outdated

_setup("PySide", ["QtUiTools"])

Qt.__binding_version__ = __import__("PySide2").__version__
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey - i think this should be
Qt.binding_version = import("PySide").version

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed.

@tomwod
Copy link

tomwod commented Mar 13, 2017

yep, can confirm that maya imports Qt.QtHelp ok and H16.504.20 fails

i had a problem importing in a PySide only environment - think there might be a problem (my note above makes it work again for me)

@fredrikaverpil
Copy link
Collaborator

I'm running this beta on my 70000+ line Python app here now and so far so good. Will report any anomalies.

@mottosso
Copy link
Owner Author

I'm running this beta on my 70000+ line Python app here now and so far so good. Will report any anomalies.

That's encouraging, thanks for reporting back!

@fredrikaverpil
Copy link
Collaborator

fredrikaverpil commented Mar 16, 2017

Do you know if there's any way I can install this release from a setup.py's install_requires?

I'm having difficulties with testing this release as I cannot specify git+https://github.com/abstractfactory/Qt.py.git@implement185 as a dependency:

'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid require
ment, parse error at "'+https:/'"

I've got dev releases of a wheel here which now require this release, but it can't install it. This prohibits me from testing this release on e.g. a larger number of machines.

EDIT: Seems the only way to fix this is to make an actual PyPi release...

@mottosso
Copy link
Owner Author

Sorry, never done that. If it helps I can merge this, the master branch is in beta either way.

@fredrikaverpil
Copy link
Collaborator

Fine be me. Don't rush anything though, in case you're looking to receive more feedback first.

@mottosso
Copy link
Owner Author

Yeah, probably best to keep it unmerged for now. Can you find another way?

@fredrikaverpil
Copy link
Collaborator

Yeah. I'll manage :)

@fredrikaverpil
Copy link
Collaborator

fredrikaverpil commented Mar 17, 2017

I found something which differs from Qt.py 0.6.9 in Nuke 9.0v5:

>>> import Qt
>>> Qt.__binding__
# Result: 'PySide'
>>> from Qt import QtGui
>>> QtGui.QApplication.topLevelWidgets()
AttributeError: 'module' object has no attribute 'QApplication'

This works with Qt.py 0.6.9 but not with this release.

@mottosso
Copy link
Owner Author

It's a known issue, even by you. :)

#173

@fredrikaverpil
Copy link
Collaborator

Haha!
But okay, it was a mistake on my end either way. It should be QtWidgets.QApplication. So. Never mind! 😆

@mottosso
Copy link
Owner Author

Actually I misread your comment as a reference to qApp, now I see you were looking for QApplication in QtGui. That's the point of this new release, to eliminate the possibility of making this mistake.

@fredrikaverpil
Copy link
Collaborator

fredrikaverpil commented Mar 17, 2017

Actually, this was a great example of where Qt.py came to the rescue and made me aware of "bad code" which Qt.py 0.6.9 didn't find. That old QtGui code would not work with Nuke 11 (which I'm expecting to use Qt5).

@fredrikaverpil
Copy link
Collaborator

That's the point of this new release, to eliminate the possibility of making this mistake.

YES! Exactly. Love this release already. :)

@nebukadhezer
Copy link

As mentioned on Gitter this also fixes Problems under 3dsmax 2015 as there are also submodules missing.
Looking forward to see this released.

@mottosso
Copy link
Owner Author

Just released the previous release as a beta, and will merge and release this one shortly as well.

Usage

# Install stable version
$ pip install Qt.py

# Install beta, a.k.a. pre-release
$ pip install Qt.py --pre

# Upgrade from stable to beta
$ pip install Qt.py --pre -U

@mottosso mottosso merged commit 7193ed3 into mottosso:master Mar 22, 2017
@fredrikaverpil
Copy link
Collaborator

Excellent!

@mottosso mottosso deleted the implement185 branch March 24, 2017 08:29
@mottosso mottosso changed the title Implement #185 Implement Optional Submodules #185 May 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants