Matěj Laitl | 3 Oct 20:59 2010
Picon

Re: [Cython] Cython distutils does not recompile files if a pxd file changes.

On 3. 10. 2010 Vineet Jain wrote:
> Not a big deal, but thought I would just mention it. If a pxd file
> changes and you run setup.py build it will not rebuild the package.
> You have to change the corresponding pyx file for the module to be
> rebuilt.

+1

The reason behind this is that cython.Distutils' build_ext does it's own "is-
source-newer-than-target" checks. It doesn't parse pyx file for dependencies, 
but it relies on you specifying all dependencies in Extension source files 
declaration, e.g:

setup(... ext_modules(Extension('module', ['module.pyx', 'module.pxd', 
'dependency.pxd'])))

But I also find it suboptimal. Cython distutils can be changed to use cython 
compiler to do dependency mtime checking, I may post a patch in a couple
of days.

	Matěj
_______________________________________________
Cython-dev mailing list
Cython-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev
Robert Bradshaw | 5 Oct 06:33 2010

Re: [Cython] Cython distutils does not recompile files if a pxd file changes.

On Sun, Oct 3, 2010 at 11:59 AM, Matěj Laitl <matej <at> laitl.cz> wrote:
> On 3. 10. 2010 Vineet Jain wrote:
>> Not a big deal, but thought I would just mention it. If a pxd file
>> changes and you run setup.py build it will not rebuild the package.
>> You have to change the corresponding pyx file for the module to be
>> rebuilt.
>
> +1
>
> The reason behind this is that cython.Distutils' build_ext does it's own "is-
> source-newer-than-target" checks. It doesn't parse pyx file for dependencies,
> but it relies on you specifying all dependencies in Extension source files
> declaration, e.g:
>
> setup(... ext_modules(Extension('module', ['module.pyx', 'module.pxd',
> 'dependency.pxd'])))
>
> But I also find it suboptimal.

For sure, especially for a project like Sage. (We had to resort to
managing our dependancies manually...) This was one of the goals of
http://wiki.cython.org/enhancements/distutils_preprocessing .

> Cython distutils can be changed to use cython
> compiler to do dependency mtime checking, I may post a patch in a couple
> of days.

That would be really cool. Note that if you don't amortize this across
multiple files (by doing the dependency resolution for each one
separately) you may find that O(n^2) doesn't grow very nicely :).
(Continue reading)


Gmane