[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFS: pyfftw/0.9.2 [ITP Bug #728085] -- python wrapper for FFTW3



On 20.01.2014 11:07, Jerome Kieffer wrote:
> On Mon, 20 Jan 2014 08:46:48 +0000
> Ghislain Vaillant <ghisvail@gmail.com> wrote:
> 
>> On Mon, 2014-01-20 at 09:18 +0100, Jerome Kieffer wrote:
>>> On Sat, 18 Jan 2014 19:18:42 +0000
>>> Ghislain Vaillant <ghisvail@gmail.com> wrote:
>>>
>>>> i.e. to drop the distribution of the
>>>> Cython-generated c-files and to distribute the source of the sphinx
>>>> documentation and not a build of it which requires patching. 
>>>
>>> Hi Ghislain,
>>>
>>> I would highlight this is not an "upstream bug" as cython recommends to
>>> ship the C/C++ generated files (and optionally the pyx/pxd) to prevent
>>> the changes in the cython generated files (see the recent
>>> deprecectation of array of bint with cython 0.19.2).
>>>
>>
>> I didn't know that. I have always thought that whatever can be
>> auto-generated by the build system should not be shipped as part of a
>> source distribution.
>>
>> Is the intent of shipping the c-files just to freeze the version of
>> Cython then ? I'd be curious to read about it, can you provide a link
>> regarding this recommendation ?
> 
> http://docs.cython.org/src/reference/compilation.html#distributing-cython-modules
> 
> """
> It is strongly recommended that you distribute the generated .c files
> as well as your Cython sources, so that users can install your module
> without needing to have Cython available.
> 
> It is also recommended that Cython compilation not be enabled by
> default in the version you distribute. Even if the user has Cython
> installed, he/she probably doesn’t want to use it just to install your
> module. Also, the installed version may not be the same one you used,
> and may not compile your sources correctly. 
> """

This is not the debian way, if recythonizing does not work it must be
fixed else it is difficult to backport fixes and security updates.

> 
>> Is there be a way to generate both the Python 2 and Python 3 build of
>> the extension module from the Cython generated c-files only ?
> 
> In the case of Debian, it makes sense to re-generate the C code and request cython installed.
> One option it to have "distribution" specific build options. Fred provided a "--with-testimages" having one to enforce the cythonization at build time makes sense as well... but not by default.
> 

The usual upstream solution is to include the generated c files in
python setup.py sdist for the users but to regenerate them when they are
missing (e.g. git clones).
So often it is enough to delete all .c files to get everything rebuilt,
sometimes there is a cythonize setup.py target or a generate*py file.
If all is missing ask upstream to provide some way and in the mean time
just run cython on all pyx files you can find.
Running a testsuite during the build and having adt tests helps spotting
issues due to different cython versions.


Reply to: