Discussion:
[Cython] Cython distutils does not recompile files if a pxd file changes.
Vineet Jain
2010-10-03 13:14:43 UTC
Permalink
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.

Vineet
Matěj Laitl
2010-10-03 18:59:21 UTC
Permalink
Post by Vineet Jain
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
Robert Bradshaw
2010-10-05 04:33:29 UTC
Permalink
Post by Matěj Laitl
Post by Vineet Jain
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
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 .
Post by Matěj Laitl
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 :).

- Robert

Loading...