Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-18 Thread Kurt Smith
On Wed, Jul 16, 2014 at 1:02 PM, Robert Bradshaw  wrote:
>
>
> Yes, this'd be nice to have. One difficulty with arrays is that they
> can't be returned by value, and so the ordinary from_py_function
> mechanism (which gets called recursively) would need to be adapted.
> (Allowing to_py_function to be optinally be called by reference
> instead of by value could be nice as well from a performance
> standpoint.)
>

OK, thanks for the pointers.  I'll put some time on this over the weekend.
 Should I just make a PR when things are ready to review, or should I put
up an issue first?


>
> - Robert
> ___
> cython-devel mailing list
> cython-devel@python.org
> https://mail.python.org/mailman/listinfo/cython-devel
>
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-18 Thread Robert Bradshaw
On Fri, Jul 18, 2014 at 12:08 PM, Kurt Smith  wrote:
> On Wed, Jul 16, 2014 at 1:02 PM, Robert Bradshaw  wrote:
>>
>>
>> Yes, this'd be nice to have. One difficulty with arrays is that they
>> can't be returned by value, and so the ordinary from_py_function
>> mechanism (which gets called recursively) would need to be adapted.
>> (Allowing to_py_function to be optinally be called by reference
>> instead of by value could be nice as well from a performance
>> standpoint.)
>
>
> OK, thanks for the pointers.  I'll put some time on this over the weekend.
> Should I just make a PR when things are ready to review, or should I put up
> an issue first?

I think this thread is sufficient; looking forward to a pull request.

- Robert
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] License information on each individual files

2014-07-18 Thread Sturla Molden
Benjamin Lerman  wrote:

>  Would cython accept to add such a copyright header on its files?

You want to display the Apache licence in every single file, even those
with utility C code?

Can't you do this in your own copy of Cython? I am quite sure the license
allows you to modify the source files (almost) however you like.

What do you do with other Python projects which do not put copyright
notices everywhere?

Have you considered to get rid of the lawyer who makes these stupid
requests?

Just asking...


Sturla

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] License information on each individual files

2014-07-18 Thread Nathaniel Smith
On Fri, Jul 18, 2014 at 10:13 PM, Sturla Molden  wrote:
> Benjamin Lerman  wrote:
>
>>  Would cython accept to add such a copyright header on its files?
>
> You want to display the Apache licence in every single file, even those
> with utility C code?

It's annoying, but a pretty standard request. Debian once made me do
this for some package or another (forget which) before they would
distribute it, though obviously that rule is inconsistently applied.
Still, it's pretty trivial and has real-world consequences, so why
reject a patch like this?

-n

-- 
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http://vorpus.org
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] License information on each individual files

2014-07-18 Thread Robert Bradshaw
On Fri, Jul 18, 2014 at 2:28 PM, Nathaniel Smith  wrote:

> On Fri, Jul 18, 2014 at 10:13 PM, Sturla Molden 
> wrote:
> > Benjamin Lerman  wrote:
> >
> >>  Would cython accept to add such a copyright header on its files?
> >
> > You want to display the Apache licence in every single file, even those
> > with utility C code?
>
> It's annoying, but a pretty standard request. Debian once made me do
> this for some package or another (forget which) before they would
> distribute it, though obviously that rule is inconsistently applied.
> Still, it's pretty trivial and has real-world consequences, so why
> reject a patch like this?


Debian currently distributes Cython without these headers.

I am curious why a licence in a top level directory that explicitly states
it applies to everything in that directory is not sufficiently clear. What
about auto-generated files? What about binary blobs? All 1000+ test files?

http://www.apache.org/dev/apply-license.html#copy-per-file

- Robert
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] License information on each individual files

2014-07-18 Thread Nathaniel Smith
On Fri, Jul 18, 2014 at 10:53 PM, Robert Bradshaw 
wrote:

> On Fri, Jul 18, 2014 at 2:28 PM, Nathaniel Smith  wrote:
>
>> On Fri, Jul 18, 2014 at 10:13 PM, Sturla Molden 
>> wrote:
>> > Benjamin Lerman  wrote:
>> >
>> >>  Would cython accept to add such a copyright header on its files?
>> >
>> > You want to display the Apache licence in every single file, even those
>> > with utility C code?
>>
>> It's annoying, but a pretty standard request. Debian once made me do
>> this for some package or another (forget which) before they would
>> distribute it, though obviously that rule is inconsistently applied.
>> Still, it's pretty trivial and has real-world consequences, so why
>> reject a patch like this?
>
>
> Debian currently distributes Cython without these headers.
>

Yes, they're inconsistent, as I noted.


>
> I am curious why a licence in a top level directory that explicitly states
> it applies to everything in that directory is not sufficiently clear. What
> about auto-generated files? What about binary blobs? All 1000+ test files?
>
> http://www.apache.org/dev/apply-license.html#copy-per-file
>

That link is about sticking a copy of the apache license text in every
file, this is about having a few line header saying "This is part of
Cython, copyright Cython devs, released under Apache-2, see LICENSE.txt for
details".

I'm just saying, you can argue about how chromium's lawyers ought to think,
or you can just say "whatever, patches welcome" and merge it if it arrives.
Your time is yours to spend as you wish :-) I was also very annoyed
initially when asked to do this, so thought I'd share my experience in case
it was useful.

-n

-- 
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http://vorpus.org
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] License information on each individual files

2014-07-18 Thread Julian Taylor
On 19.07.2014 00:12, Nathaniel Smith wrote:
> On Fri, Jul 18, 2014 at 10:53 PM, Robert Bradshaw  > wrote:
> 
> On Fri, Jul 18, 2014 at 2:28 PM, Nathaniel Smith  > wrote:
> 
> On Fri, Jul 18, 2014 at 10:13 PM, Sturla Molden
> mailto:sturla.mol...@gmail.com>> wrote:
> > Benjamin Lerman mailto:q...@chromium.org>>
> wrote:
> >
> >>  Would cython accept to add such a copyright header on its files?
> >
> > You want to display the Apache licence in every single file,
> even those
> > with utility C code?
> 
> It's annoying, but a pretty standard request. Debian once made me do
> this for some package or another (forget which) before they would
> distribute it, though obviously that rule is inconsistently applied.
> Still, it's pretty trivial and has real-world consequences, so why
> reject a patch like this?
> 
> 
> Debian currently distributes Cython without these headers. 
> 
> 
> Yes, they're inconsistent, as I noted.
>  

It is inconsistent but still encouraged.
As a debian maintainer I much appreciate when the files all contain
copyright statements, it simplifies one of the most time consuming part
of packaging, making sure all the copyrights are in order.
Per file copyright headers allow automated tools to quickly classify a
source tree and make it easier to find the files that need more detailed
checking.


> 
> 
> I am curious why a licence in a top level directory that explicitly
> states it applies to everything in that directory is not
> sufficiently clear. What about auto-generated files? What about
> binary blobs? All 1000+ test files? 
> 
> http://www.apache.org/dev/apply-license.html#copy-per-file
> 
> 
> That link is about sticking a copy of the apache license text in every
> file, this is about having a few line header saying "This is part of
> Cython, copyright Cython devs, released under Apache-2, see LICENSE.txt
> for details".

Yes you only need to include a short header not the full license.
The recommended header is in the APPENDIX section:
http://www.apache.org/licenses/LICENSE-2.0
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] License information on each individual files

2014-07-18 Thread Robert Bradshaw
On Fri, Jul 18, 2014 at 3:12 PM, Nathaniel Smith  wrote:

> On Fri, Jul 18, 2014 at 10:53 PM, Robert Bradshaw 
> wrote:
>
>> On Fri, Jul 18, 2014 at 2:28 PM, Nathaniel Smith  wrote:
>>
>>> On Fri, Jul 18, 2014 at 10:13 PM, Sturla Molden 
>>> wrote:
>>> > Benjamin Lerman  wrote:
>>> >
>>> >>  Would cython accept to add such a copyright header on its files?
>>> >
>>> > You want to display the Apache licence in every single file, even those
>>> > with utility C code?
>>>
>>> It's annoying, but a pretty standard request. Debian once made me do
>>> this for some package or another (forget which) before they would
>>> distribute it, though obviously that rule is inconsistently applied.
>>> Still, it's pretty trivial and has real-world consequences, so why
>>> reject a patch like this?
>>
>>
>> Debian currently distributes Cython without these headers.
>>
>
> Yes, they're inconsistent, as I noted.
>
>
>>
>> I am curious why a licence in a top level directory that explicitly
>> states it applies to everything in that directory is not sufficiently
>> clear. What about auto-generated files? What about binary blobs? All 1000+
>> test files?
>>
>> http://www.apache.org/dev/apply-license.html#copy-per-file
>>
>
> That link is about sticking a copy of the apache license text in every
> file, this is about having a few line header saying "This is part of
> Cython, copyright Cython devs, released under Apache-2, see LICENSE.txt for
> details".
>
> I'm just saying, you can argue about how chromium's lawyers ought to
> think, or you can just say "whatever, patches welcome" and merge it if it
> arrives. Your time is yours to spend as you wish :-) I was also very
> annoyed initially when asked to do this, so thought I'd share my experience
> in case it was useful.
>

It's not just the initial patch; I'm primarily worried about the
maintenance burden. For example, either we require (and enforce) it on all
new files or you get into this inconsistent state where some files have a
statement and some don't, and it's unclear what the copyright implications
of this inconsistency is. And that's assuming we don't have to mess with
years, author lists, etc. (not clear what the request was).

There's plenty of precedent for not tagging every file (e.g. the linux
kernel).

- Robert
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] License information on each individual files

2014-07-18 Thread Sturla Molden
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?

Sturla

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] License information on each individual files

2014-07-18 Thread Stefan Behnel
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

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel