GPL and Python modules.

Discussion in 'Python' started by Grant Edwards, Oct 25, 2004.

  1. 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?

    --
    Grant Edwards grante Yow! SHHHH!! I hear SIX
    at TATTOOED TRUCK-DRIVERS
    visi.com tossing ENGINE BLOCKS into
    empty OIL DRUMS...
     
    Grant Edwards, Oct 25, 2004
    #1
    1. Advertising

  2. Grant Edwards

    Peter Otten Guest

    Grant Edwards wrote:

    > 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
     
    Peter Otten, Oct 25, 2004
    #2
    1. Advertising

  3. > 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
     
    Phil Thompson, Oct 25, 2004
    #3
  4. On 2004-10-25, Peter Otten <> wrote:
    > Grant Edwards wrote:
    >
    >> 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.


    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.

    > 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.


    --
    Grant Edwards grante Yow! TAILFINS!!...click...
    at
    visi.com
     
    Grant Edwards, Oct 25, 2004
    #4
  5. On Mon, Oct 25, 2004 at 03:46:31PM +0000, Grant Edwards wrote:
    > On 2004-10-25, Peter Otten <> wrote:
    > > Grant Edwards wrote:
    > >
    > >> 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.

    >
    > 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-----
     
    Gerhard Haering, Oct 25, 2004
    #5
  6. On 2004-10-25, Gerhard Haering <> wrote:

    >> >> 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.

    >>
    >> So my application code must be GPL'd even if I never distribute
    >> the module? The mere act of inserting the line=20
    >>
    >> "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).


    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.

    --
    Grant Edwards grante Yow! Didn't I buy a 1951
    at Packard from you last March
    visi.com in Cairo?
     
    Grant Edwards, Oct 25, 2004
    #6
  7. Grant Edwards

    Peter Otten Guest

    Grant Edwards wrote:

    > 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
     
    Peter Otten, Oct 25, 2004
    #7
  8. 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.
     
    Istvan Albert, Oct 25, 2004
    #8
  9. Grant Edwards

    Ville Vainio Guest

    >>>>> "Grant" == Grant Edwards <> writes:

    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?"

    --
    Ville Vainio http://tinyurl.com/2prnb
     
    Ville Vainio, Oct 25, 2004
    #9
  10. Grant Edwards

    Guest

    Grant Edwards wrote:

    >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.
     
    , Oct 25, 2004
    #10
  11. On 2004-10-25, Peter Otten <> wrote:

    > 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.

    > - not that rare in Python land.


    --
    Grant Edwards grante Yow! I am having FUN... I
    at wonder if it's NET FUN or
    visi.com GROSS FUN?
     
    Grant Edwards, Oct 25, 2004
    #11
  12. On 2004-10-25, Istvan Albert <> 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?


    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".

    --
    Grant Edwards grante Yow! If I had a Q-TIP, I
    at could prevent th' collapse
    visi.com of NEGOTIATIONS!!
     
    Grant Edwards, Oct 25, 2004
    #12
  13. On 2004-10-25, <> wrote:

    >>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?


    > 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.

    --
    Grant Edwards grante Yow! I always liked FLAG
    at DAY!!
    visi.com
     
    Grant Edwards, Oct 25, 2004
    #13
  14. Grant Edwards

    Ian Bicking Guest

    Grant Edwards wrote:
    >>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.


    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.

    --
    Ian Bicking / / http://blog.ianbicking.org
     
    Ian Bicking, Oct 25, 2004
    #14
  15. Grant Edwards wrote:

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


    Executes the tasks it is designed to do.

    Istvan.
     
    Istvan Albert, Oct 25, 2004
    #15
  16. On 2004-10-25, Ian Bicking <> wrote:

    >>>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.

    >
    > 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.

    --
    Grant Edwards grante Yow! I brought my BOWLING
    at BALL -- and some DRUGS!!
    visi.com
     
    Grant Edwards, Oct 25, 2004
    #16
  17. Ian Bicking wrote:

    > 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.
     
    Istvan Albert, Oct 25, 2004
    #17
  18. Peter Otten wrote:

    >Grant Edwards wrote:
    >
    >
    >
    >>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
    >
    >
    >

    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.)
     
    Charles Hixson, Oct 25, 2004
    #18
  19. Grant Edwards

    Peter Hansen Guest

    Grant Edwards wrote:
    > 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.


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

    -Peter
     
    Peter Hansen, Oct 25, 2004
    #19
  20. On 2004-10-25, Charles Hixson <> wrote:

    >>>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.

    >
    > 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.

    --
    Grant Edwards grante Yow! Now that we're
    at in LOVE, you can BUY
    visi.com this GOLDFISH for a 48%
    DISCOUNT.
     
    Grant Edwards, Oct 25, 2004
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Sparks

    Re: GPL and Python modules.

    Michael Sparks, Oct 25, 2004, in forum: Python
    Replies:
    2
    Views:
    371
    Leif K-Brooks
    Oct 25, 2004
  2. Tim Churches

    RE: GPL and Python modules.

    Tim Churches, Oct 26, 2004, in forum: Python
    Replies:
    2
    Views:
    355
    Scott Robinson
    Dec 16, 2004
  3. John Hunter

    python and gpl

    John Hunter, Jan 31, 2005, in forum: Python
    Replies:
    5
    Views:
    416
    Steve Holden
    Jan 31, 2005
  4. Tim Churches

    Re: python and gpl

    Tim Churches, Jan 31, 2005, in forum: Python
    Replies:
    2
    Views:
    314
  5. Tim Churches
    Replies:
    5
    Views:
    423
    Tim Churches
    Feb 4, 2005
Loading...

Share This Page