On Mar 31, 2009, at 8:20 AM, Nicolas Dumazet wrote:

> 2009/4/1 Nicolas Dumazet <[email protected]>:
>> I looked at ways to avoid the extra setup.py work, it seems  
>> there's no
>> "easy way" here.
>> I thought about extending the distutils build command to build the c
>> files before the module build, but it's definitely not simple: if the
>> C files are correctly generated, one would need to register the C
>> extensions on the fly, once the build process has already started;  
>> and
>> I'm not sure that this is possible.
>> And yes, if it is not possible, one would need to write a complex
>> build system handling the whole compilation chain.
>
> Or... the setup.py behavior could be modified:
> When --no-cython-compile is not provided, if the system is not able to
> generate the .c, it bails out, spitting out an error, instead of
> trying to back out "intelligently" to the pure python implementation
> by itself.
>
> This would make the setup.py implementation much more simple:
> * If --no-cython-compile is here, there's almost nothing to do.
> * If it's not here, add the dependences on the C extensions, extend
> the build_ext distutils command to generate the C files before
> building the cython module, (this is actually easy to do) and...
> voilĂ ! Just exit with an error if you can't generate the C files,
> suggest to try --no-cython-compile instead.

I'm -1 on this idea, because it complicates auto-installation of  
packages (for example, if Cython is downloaded via a package manager,  
especially as a dependance to something else). Regarding Scons, it's  
a nice build system, but I'd rather not make it a dependancy for  
Cython (especially as our build needs really aren't super complicated).

Note also that the implict Cython dependancies (i.e. cimports) are  
not handled by this patch either. Perhaps in our case a simple "if  
the .c files are present and all newer than the .pyx files, skip the  
cythonization step."

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to