GPL and Python modules.

G

Grant Edwards

Let's say I use a GPL'd python module (e.g. something installed
in site-packages) in an application.

Let's also say I use py2exe to package and distribute said
application.

Is what I'm distributing a "derived work" of the GPL'd python?
Or is py2exe's packaging of the module's .pyc file and my
application code's .pyc files a "mere aggregation" so that I
only have to provide source code for the GPL'ed module and not
for my application code?

IOW, do I have to GPL my application code and distribute source
code for it?
 
P

Peter Otten

Grant said:
Let's say I use a GPL'd python module (e.g. something installed
in site-packages) in an application.

I'd say everything that uses a GPL'd module is derived work and must also be
GPL'd. It doesn't matter how you distribute it. If the module is under the
LGPL you could use it in a closed source app but must make available any
changes to the original module.

Peter
 
P

Phil Thompson

Let's say I use a GPL'd python module (e.g. something installed
in site-packages) in an application.

Let's also say I use py2exe to package and distribute said
application.

Is what I'm distributing a "derived work" of the GPL'd python?
Or is py2exe's packaging of the module's .pyc file and my
application code's .pyc files a "mere aggregation" so that I
only have to provide source code for the GPL'ed module and not
for my application code?

IOW, do I have to GPL my application code and distribute source
code for it?

I hate trying to answer questions like this (IANAL etc), but here goes...

If your code imports a GPL module then it is a derived work in the same
way that C code linked against a GPL library is a derived work. If you
want to distribute your code then you must use a GPL compatible license.
py2exe doesn't make any difference to what you can and cannot do.

Phil
 
G

Grant Edwards

I'd say everything that uses a GPL'd module is derived work
and must also be GPL'd. It doesn't matter how you distribute
it.

So my application code must be GPL'd even if I never distribute
the module? The mere act of inserting the line

"import someGPLdmodule"

Makes my _source_code_ a derived work, and therefore must be
GPL'd? That just doesn't sound right.
 
G

Gerhard Haering

So my application code must be GPL'd even if I never distribute
the module? The mere act of inserting the line

"import someGPLdmodule"

Makes my _source_code_ a derived work, and therefore must be
GPL'd? That just doesn't sound right.

The GPL only applies if you distribute your work (outside your
organization).

It would probably be a smart move to just *ask* the author of the
module if it's ok with him what you're planning to do. Only if the two
of you disagree, then you need to worry about the legal cra^w
questions.

Gerhard
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBfSI7dIO4ozGCH14RAlirAJ0VV6Cuzkphek7NXaLjcpYoBqx5ywCghaRI
10S1Sje3Zq6JCvSzZDRa2MY=
=dMQ9
-----END PGP SIGNATURE-----
 
G

Grant Edwards

The GPL only applies if you distribute your work (outside your
organization).

Yes, I realize that, and it has nothing to do with my question.
It would probably be a smart move to just *ask* the author of
the module if it's ok with him what you're planning to do.
Only if the two of you disagree, then you need to worry about
the legal questions.

I don't really want to have to come to individual agreements
with 5-10 different module authors. That's why "standard"
licenses were invented.
 
P

Peter Otten

Grant said:
I don't really want to have to come to individual agreements
with 5-10 different module authors.  That's why "standard"
licenses were invented.

Yes, and for an author to GPL a module is the standard way of saying use it
as you like in your program, but distribute your part of the work under the
same terms. Basically an embrace-and-extend antidote for code.

I think talking to an author and maybe offering a moderate fee if you want
terms more favourable to your purpose shouldn't be too much.

Otherwise you have to stick to modules with BSD/MIT/Python Licenses - not
that rare in Python land.

Peter
 
I

Istvan Albert

Grant Edwards wrote:

Makes my _source_code_ a derived work, and therefore must be
GPL'd? That just doesn't sound right.

Well doesn't your work derive some functionality
from the imported code? Does your code work without
the import?

People need to understand once and for all that
GPL is about "forcing" you to make your program
open source. Whether that sounds right
or wrong to you, whether you like it or hate it
is irrelevant.

Obviously no one like suddenly realize that they are
bound by GPL but everyone must keep this in mind
*before* choosing that path.

Istvan.
 
V

Ville Vainio

Grant> That just doesn't sound right.

That sentence pretty much summarizes the issue of GPL'd libraries. The
most practical approach is to rather post a question about "is there a
non-GPL'd version of <foo> around?"
 
M

marcus

Grant said:
Let's say I use a GPL'd python module (e.g. something installed
in site-packages) in an application.

Let's also say I use py2exe to package and distribute said
application.

Is what I'm distributing a "derived work" of the GPL'd python?
Or is py2exe's packaging of the module's .pyc file and my
application code's .pyc files a "mere aggregation" so that I
only have to provide source code for the GPL'ed module and not
for my application code?

IOW, do I have to GPL my application code and distribute source
code for it?
Just a thought..

Why don't you just GPL the whole lot? Headache over, and a warm fuzzy
feeling in its place.

If your work could be used to extend or wrap the module, it's possible
someone else may find it useful...

Notwithstanding, obviously, any considerations you might have that would
stop you, that's what I'd do - besides which, if you're benefiting from
GPL stuff, give something back.. go on, you know you want to.. :)

Like I said, just a thought.
 
G

Grant Edwards

I think talking to an author and maybe offering a moderate fee if you want
terms more favourable to your purpose shouldn't be too much.

Otherwise you have to stick to modules with BSD/MIT/Python Licenses

Or LGPL, which was intended for this specific situation.
 
G

Grant Edwards

Well doesn't your work derive some functionality
from the imported code?

Not until it's actually been imported. That doesn't happen
until runtime.
Does your code work without the import?

That depend's on your definition of "work".
 
G

Grant Edwards

Why don't you just GPL the whole lot? Headache over, and a
warm fuzzy feeling in its place.

I haven't said I won't. :) That said, providing a mechanism for
people to get the source does impose some overhead and cost.
And then there's the time/cost associated with supporting the
GPL'd source code _after_ you've provided somebody with it.
If your work could be used to extend or wrap the module,

It doesn't.
it's possible someone else may find it useful...

I doubt it, but you never know.
Notwithstanding, obviously, any considerations you might have
that would stop you, that's what I'd do - besides which, if
you're benefiting from GPL stuff, give something back..

I do try, though it isn't always accepted. The last set of
patches I submitted to gcc were declined. :(

You will find code by me in the socket and pyserial modules, in
gcc, binutils, gdb, fetchmail, rcs, mutt, and probably others
which I have forgotten.
go on, you know you want to.. :)

I also wrote a ladder diagram editor and a compiler
code-generator which are GPL'd.
 
I

Ian Bicking

Grant said:
I haven't said I won't. :) That said, providing a mechanism for
people to get the source does impose some overhead and cost.
And then there's the time/cost associated with supporting the
GPL'd source code _after_ you've provided somebody with it.

You don't have to provide any mechanism, nor provide any support. If
you are giving them .pyc files, just include the .py files as well. You
don't even have to GPL your code, you just have to abide by the GPL
(i.e., provide source); you could distribute your code under any
GPL-compatible license, such as a BSD-style license.

All the GPL asks is that you distribute the source with the program, and
allow that source to be modified and redistributed. Anything less is
against the spirit of the GPL, and as such against the spirit that the
original author had in mind when releasing that GPL code; you can try to
get around it, but even if it's legal it's not right. And it's probably
not legal, since intent *does* matter. If you don't think the GPL is
really the intent of the original author, then contact them; they may
very well be willing to relicense the code.

But as long as you don't mind people seeing, redistributing, and
modifying your source, then the GPL is not a problem, just a few extra
kilobytes in your distribution. Well, you are also supposed to note
somewhere that the source is available under the GPL -- so an extra line
in Help>About (or something like that) should be included.
 
G

Grant Edwards

You don't have to provide any mechanism, nor provide any
support. If you are giving them .pyc files, just include the
.py files as well.

I guess I could just tell py2exe to also include the .py files
in the install directory. There's still the problem of the
time/cost required to support them.
But as long as you don't mind people seeing, redistributing,
and modifying your source,

The problem is the time spent answering questions and helping
the people who have the source code.
 
I

Istvan Albert

Ian said:
don't even have to GPL your code, you just have to abide by the GPL
(i.e., provide source); you could distribute your code under any
GPL-compatible license, such as a BSD-style license.

No if you derive from GPL then you must release your program
as GPL and you may not release it with a "GPL compatible"
license.

Otherwise it would be to easy to circumvent it, just get a
GPL program, add a comment, call it something else
and re-release it as BSD.

From the GPL FAQ:

Q: If a library is released under the GPL (not the LGPL),
does that mean that any program which uses it has to be under the GPL?
A: Yes, because the program as it is actually run includes the library.

Istvan.
 
C

Charles Hixson

Peter said:
Grant Edwards wrote:




I'd say everything that uses a GPL'd module is derived work and must also be
GPL'd. It doesn't matter how you distribute it. If the module is under the
LGPL you could use it in a closed source app but must make available any
changes to the original module.

Peter
I don't think that's correct. If you distribute the source, then I
don't think that you need to GPL the code (and if you GPL the code, you
*must* distribute the source anyway...so....).

The thing is, the source, although it depends on the GPL code to execute
is not itself linked to the GPL code. It tells you (in the import
statement) that you'll need it, but that's a different matter. You
might just want to study how some part of it worked.

I doubt that this is much help to you though. Usually when people ask
such a question it's because they intend to distribute a closed source
version, and I don't think you can do that. (But don't take my advice
as a certainty. I'm quite biased in favor of the GPL.)
 
P

Peter Hansen

Grant said:
I guess I could just tell py2exe to also include the .py files
in the install directory. There's still the problem of the
time/cost required to support them.



The problem is the time spent answering questions and helping
the people who have the source code.

Whatever gave you the idea you are obligated to provide support?!

-Peter
 
G

Grant Edwards

I don't think that's correct. If you distribute the source, then I
don't think that you need to GPL the code (and if you GPL the code, you
*must* distribute the source anyway...so....).

The thing is, the source, although it depends on the GPL code to execute
is not itself linked to the GPL code.

This is equally true of a .pyc file that will require a GPL'd
module at runtime.
It tells you (in the import statement) that you'll need it,
but that's a different matter. You might just want to study
how some part of it worked.

I doubt that this is much help to you though. Usually when
people ask such a question it's because they intend to
distribute a closed source version, and I don't think you can
do that. (But don't take my advice as a certainty. I'm quite
biased in favor of the GPL.)

The simplest thing to do is to just tell py2exe to install the
source code as well -- until the questions about "why my
modified souce code doesn't work" start arriving.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top