3

enter image description here

I have developed a python script that makes use of a package hosted in PyPI. My code basically imports this package and uses some of its functions, together with some more functionality I developed. Now I want to distribute my script together with a requirements.txt file, so other people can use it, let's say commercially or through a permissive license such as MIT. The catch is: the package I'm importing has a GNU GPL 2 license.

The question basically is: even if I am not distributing or modifying the GNU GPL package in any way, am I forced to apply the GNU GPL license to my script, because of the dependency?

Note again that the software I will distribute is just the script and the list of dependencies I developed, so no GNU GPL software is included in my distribution. However, the final user does need to install the GNU GPL software as a requisite to run my script.

I have gone through the whole text of the license, and also through quite a few questions around here, but can't still find a clear-cut answer.

albarji
  • 141
  • 5
  • Not exactly. Certainly, in that question the python library is dynamically linked to a C/C++ extension, which in a way is similar to how I am importing another package. However the key difference here is in how my software is distributed: it does not include the package under GNU GPL, though I require the user to install it as a requirement to run my software. – albarji Mar 09 '23 at 08:56
  • 2
    How your software is distributed is actually not of any influence on your licensing obligations. – Bart van Ingen Schenau Mar 09 '23 at 08:59
  • Right, but it seems to me that many terms in the GNU GPL license apply only if the licensed software is distributed, be it as a copy, as a modification, or as part of a larger software. Given the setting I described, the GNU GPL licensed software is not being distributed as part of my software; it is a requirement that the user must provide. – albarji Mar 09 '23 at 09:51
  • 1
    No, it applies if the original work or any derivative work thereof is distributed. The contention here, with which I agree, is that your simple linking of the library to your work makes your work a derivative of the library, in copyright terms. – MadHatter Mar 09 '23 at 11:57

1 Answers1

3

even if I am not distributing or modifying the GNU GPL package in any way, am I forced to apply the GNU GPL license to my script, because of the dependency?

Yes.

The GPL license is built around the idea that if any part of the program that gets executed by the end-user has the GPL license, then the program as a whole must be under the GPL license and the source code of all parts must be at least under a GPL-compatible open-source license. This is irrespective of how the various parts get distributed and from how many sources the end-user needs to collect the parts.

The simple fact that your code contains an import statement for the GPL library and makes function calls to the library is enough to conclude that your code is a derived work, as copyright law calls it, and that you need to comply with the terms of the GPL license under which you received that library. Those terms include the requirement to use the same GPL license for your code.

Bart van Ingen Schenau
  • 29,549
  • 3
  • 46
  • 83
  • The import statement could import a different package/module with the same name which isn't GPL'd. How does that work? – Peter Wood Nov 10 '23 at 13:07