Closed mottosso closed 5 years ago
Oh, and it also removes the need for PyQt5 to exist on PYTHONPATH, which can complicate this scenario:
In the above case, one would need to append Python 3's site-packages to the PYTHONPATH of the given host, which would give Python 2 access to its modules. The "proper" was of handling this is to not install PyQt5 in site-packages, but elsewhere, e.g. /special/pyqt5/path
such that only that path could be added to PYTHONPATH.
Now you don't need to do that either.
Edit: No, sorry, it's more specific than that. For the above to be a problem, the host cannot have access to any Qt binding. In the above case, Maya would be able to import pyblish_qml
because it's got PySide2 available. It'd be a problem only in hosts that don't have that, like Blender.
Very cool stuff! Can't review it properly atm.
Would make it much easier to package and have consistent behaviour through all apps.
Taking this for a spin in production.
This PR removes the Qt dependency from a host, such that only the external Python process requires it.
Before, Qt was imported regardless of host, to try and show a splash screen, install an event filter and listen on the application quit signal. Now that only happens if Qt is available.
The Qt import mechanism itself was moved into a closed scope, such that it leaves mock-functions available for hosts that lack access to Qt. The result is no loss in functionality, and no need for PyQt5 to exist from a given host. Now all you need is love. And Python.