kiwi0fruit / pyappshare

Cookbook for creating cross-platform desktop python applications in a moment. With shortcuts supporting virtual and Anaconda environments via https://github.com/kiwi0fruit/shortcutter
MIT License
7 stars 0 forks source link

PyQt GPL "infecting" even when using PySide backend #3

Closed kiwi0fruit closed 6 years ago

kiwi0fruit commented 6 years ago

There happened a useful conversation on Reddit about publishing python apps that depend on PySide and MIT/BSD wrappers around PySide/PyQt like qtpy/pyqtgraph/matplotlib. Backup of the discussion.

According to that conversation there are concerns that using qtpy/pyqtgraph/matplotlib in the propriate app even with PySide backend may lead to GPL violation. The problems came from two points:

After all the discussion on Reddit the best way to solve the problem seems to do that upstream: make sure that there is a reliable switch in the qtpy/pyqtgraph/matplotlib modules that effectively and reliably turns the app that uses them (app as a whole) to something like:

if False:
    import PyQt

Maybe such switch is already there - but this needs checking. It's also would be great to unify that interface among modules.

And also remove PyQt from their dependencies so that they do not auto-download PyQt (I guess most of them already behave this way).

UPD

Quote about PyQt deps that are in some MIT/BSD modules:

If it's not a bug then it's a missing (or unused) feature.

I'm not as familiar with conda's own feature set, but given that these are pip installable packages, the upstream packages shouldn't declare PyQt (or PySide) as requires, but as extra_requires, and then downstream can decide to use install_requires to ensure that the they've got the GPL or LGPL GUI code of their choice. Really no package maintainer should ever include GPL code in requires without their own code being expressly GPL licensed, and that being their clear intent. If upstream packages are correctly using extra_requires and an automatic download is still being triggered then something has incorrectly set PyQt as an explicit or implicit requirement, and there's the bug.

Again though an automatic download onto the end user machine without use is something that very likely should be fixed upstream, but most likely could pass muster as an unintentional at best infringement with no meaningful impact. It's the use that implicates the GPL. The one exception is when the incidental and unused download is then bundled into a distributed artifact (like a wheel or frozen exe), because now you're distributing the GPL'd code with your own.

kiwi0fruit commented 6 years ago

I opened issues:

kiwi0fruit commented 6 years ago

Last quote that fixes misunderstanding

but including that dependency does not implicate the GPL.

...

no copy of the PyQt source, so no distribution

...

the setup.py does make it so that pip will automatically download and install PyQt on your machine, if it's not already present. But that's fine; you -- and your downstream users -- could have just as easily manually installed it, and indeed Riverbank makes it available for you to download and install at any time... when pip installs it for you you're ultimately receiving Riverbank's own distribution of the source code, not someone else's, so the GPL still hasn't "infected" anything.

So having the PyQt dependency for package manager is fine because users actually download PyQt package that is provided to them not by app author but by Riverbank or Anaconda.