On Tue, Jun 7, 2016 at 12:04 PM, Nathan Dunfield <nat...@dunfield.info> wrote: >> While this might work for simple projects, this won't work when you need >> the metadata that cythonize() adds. For example, anything using >> cysignals really must use cythonize(), it won't work otherwise. > > > Jeroen, > > As of Cython 0.22, it looks like the metadata you refer to is cached in the > Cython-generated C files: > > http://grokbase.com/t/python/cython-devel/152c310vvz/cython-cython-0-22-released > > Specifically, if you look at the top of a Cython-generated C file, there is > what looks to be a JSON string encoding the metadata. > > Of course, as Erik says one shouldn't have to mess with this all "by hand". > For example, setuptools could provide a "stub" version of cythonize that (a) > does nothing but load this metadata if the C files are up to date and > otherwise (b) attempts to import Cython and run the real cythonize...
I actually raised the point with Cython (either on the mailing list or on GH, I forget) a while back, that while the metadata is copied into the C sources, nothing actually uses that copy of the metadata. That is, for example, one of the things that goes in that metadata is attributes that should be passed to the Extension object used to build that file. cythonize() *only* looks in the .pyx sources for that metadata, and although it's copied into the C sources, there's nothing in Cython that makes use of the copy in the C sources. Of course, when it comes to shipping sources that doesn't help either because even if Cython did read the metadata out of the C sources you'd need Cython to do that. Instead, I think Cython should output a file that can easily be consumed by a setup.py for the purpose of building any Cythonized extension modules. This can be shipped along with the source distribution. I've never needed such a thing, and I suspect that anything cysignals things it needs it doesn't really. But something like that would be be a possibility. You shouldn't need the entire machinery of Cython just to link some sources properly. Erik -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.