[Cython] License information on each individual files

Stefan Behnel stefan_ml at behnel.de
Sat Jul 19 08:39:36 CEST 2014


Sturla Molden, 19.07.2014 00:36:
> Robert Bradshaw wrote:
>> It's not just the initial patch; I'm primarily worried about the
>> maintenance burden
> 
> And also, will it break utility code and binary blobs? It might not even be
> safe to put it in every file.
> 
> And when put in files with utility C code, will it be included in the
> generated .c file and taint this file with a notification about Cython's
> Apache license?

Well, on the technical side, stuff at the beginning of a utility code file
should just be ignored, up to the first header line (starting with a
sequence of at least 5 comment characters). Some of them already contain
leading comments anyway.

On the legal side, the licensing state of the generated code does not
change by copying the license description from the global license file into
each code file, because the global license already applies to the complete
code base anyway (unless stated otherwise).

However, what *is* the licensing state of the generated code? Strictly
speaking, the code generated by Cython, all parts of which are embedded in
Cython's own source code, could be considered a "derivative work" by some.
The Apache license states this regarding "redistribution of derivative works":


"""
   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, [does not apply].

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.
"""

There was an official statement of the core devs back in 2007 that the
generated code is free of restrictions, but it was based on the Python
License at the time and I also don't think it's expressed in the code base
anywhere.

http://thread.gmane.org/gmane.comp.python.cython.devel/117

http://article.gmane.org/gmane.comp.python.cython.devel/122

>From my side, that statement definitely still applies. I really don't want
to have anything to say on what users do with the code generated from their
own source code. I do not even consider the generated code a "derivative
work" myself, but IANAL...

Anyway, as far as I understand it, the worst case is that people who ship
Cython generated code have to add a copy of the Apache License to their
package as well as any attribution notices we ship. That's annoying, but
not really the end of the world.

Also, utility code files could be exempt from the license explicitly by
stating so (although they'd then need another license to allow for safe
contributions to them). AFAICT, there were some twenty people or so who
ever contributed to the Cython/Utility directory and less than ten people
who ever changed or added a notable amount of code in them. That might be
worth it, given that it's difficult enough to argue that the rest of the
generated code, which gets created (and substantially modified along the
way) from tiny snippets in another code base (so tiny that none of them
could ever be considered a protectable piece of work by itself) falls under
any "derivative work" licensing terms at all. And any substantial (i.e.
protectable) portion of these snippets was written by one of seven people
or so.

Therefore, adding the license header explicitly to all files that really
fall under that license, and exclude the utility code files while doing so,
actually sounds like a good idea.


Stefan



More information about the cython-devel mailing list