3

I'm in a situation a bit similar to this one, but more precisely I developed a Python package with multiple modules. Some of them have dependencies under GPL, therefore "infecting" this specific submodule to be under the GPL. However it is possible to specify a different license in each module, so I can put specific license files into each folder.

Now my setup.py would have e.g. two modules:

# Extract of setup.py
setup(
    name="mypkg",
    packages=["moduleGPL", "moduleBSD"],
    classifiers=[
        "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
        "License :: OSI Approved :: BSD License"
    ]
    # additional setup parameters
)
  1. Is this formulation allowed? GPL is incompatible with BSD, but the GPL module can be interpreted as optional in my use case, so I believe this would be legit.
  2. Does the setup.py acts as a declaration of licensing? Because if not it's more convenient and I can declare the licenses explicitly in the README without trouble.

P.S.: I'm anyway releasing my package as open source for non commercial use, so it does not have much practical consequences, however I feel frustrated to be "obliged" to put restrictions on my code reuse, simply because of import statements... (realised that too late, I know)

  • People who put their code under GPL might feel frustrated that other people could build on their work for commercial endevour without giving back their changes under the same terms. Thus they chose GPL which requires that their code and things built on it remains free and available for all usages... – planetmaker Jan 7 at 12:00
3

IANAL. Short answer: Yes, you need to use GPL, too.

Longer answer: There is a reason we have the GPL (which wants to enforce that any derivatives of this software use the same license) and the LGPL which allows the software be used as library by other projects not under the GPL.

In python a module is the equivalent of a library. So you will need to use the GPL for your product, if you include modules under GPL. You will have no such restriction for modules under LGPL or BSD-like licenses.

EDIT to add: According to the FAQ for the GPL there is no way around to distributing the GPL module and your programme as completely separate packages which communicate "at arms length" at least: Linking statically or dynamically makes the whole product a derivative of the library, thus GPL is required (which could well be the intention of the license choice of the library).

  • Hmm, alright. What if I make the GPL'd dependency entirely optional? For example, simply saying don't use my moduleGPL if you don't want to comply to the GPL terms. It seems to me that it would be equivalent to distributing moduleGPL as a standalone package. I want to avoid that for convenience reasons (development is simpler with a single git repo, etc). – PlasmaBinturong Jan 7 at 12:53
  • IMHO that doesn't break the argument: if you use it as library, thus as included module, the GPL has to apply to the programme calling it as module, if you ship it as such. See also the GPL FAQ: gnu.org/licenses/gpl-faq.en.html#GPLStaticVsDynamic , gnu.org/licenses/gpl-faq.en.html#LinkingWithGPL . Usually a module in python is not perceived as separate programme where a combination in a bundle would be allowed. – planetmaker Jan 7 at 13:24
  • There's a good summary here of when it might be permissible: fluendo.com/en/blog/post/gpl-vs-lgpl – planetmaker Jan 7 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.