Python – How to deal with imported modules in GPL

gplpython

I wish to release a non-commercial python application under GPL3 in both source and (PyInstaller) executable form. I'm struggling to find a consistent answer to the problem of imported modules.

Can I just put the usual GPL headers on my source files, include the GPL in COPYING and leave it at that?

Or do I have to collect together all the licences and source code (both python and, e.g. C/C++ dependencies) for everything that I import and include these in my distribution? I'm assuming that I don't, but reading the GPL3 licence suggests* that I do. Surely I don't have to ship the source for Qt, PyQt4, Numpy, Scipy, Matplotlib, Gdal etc. etc. in my distribution?

I also want to distribute a windows binary because the end users are unlikely to use the software if they have to run from source. This will package and re-distribute python and all the shared library dependancies. What are my legal obligations here with GPL? Are the imports 'Major Components' and therefore do not need to have the source distributed?


Section 1, Source code:

… The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code…

Best Answer

You asked:

Can I just put the usual GPL headers on my source files, include the GPL in COPYING and leave it at that?

Yes, that's fine.

Or do I have to collect together all the licences and source code (both python and, e.g. C/C++ dependencies) for everything that I import and include these in my distribution?

No, because they won't be released as their previous license


To be a little less cryptic about that.

So long as the incorporated projects have GPL compatible licenses, when you include the modules within your program, you are effectively re-licensing those modules as GPL'd modules. That's why you don't have to1 worry about including their previous license state.

As far as distributing the code - The GPL doesn't require you to distribute the code along with the binary. It only requires you to make the code available for distribution. That's an important nuance to keep in mind.

Given that your project is going to subsume other projects, I would encourage you to make available for distribution the source code of the projects that you incorporated into your application.


How all of the re-licensing works is a little complicated. Have a look at an earlier answer of mine to understand how the GPL and copyleft apply to compatibly licensed projects that are incorporated into another.

The shortest summary from my earlier answer is the FSF quote explaining how it works.

It means that the other license and the GNU GPL are compatible; you can combine code released under the other license with code released under the GNU GPL in one larger program.

1 You really, really do need to make sure that their current license is a GPL compatible license though. You are not legally allowed to incorporate a non-compatiblely licensed project within your GPL application. You would need to look at possibly the LGPL or AGPL instead.

Related Topic