Hi!

Sorry if this is an FAQ, but I haven't really found any discussion of  
it...

My problem is that I'm trying to compile Cython code written in pure  
Python mode using Distutils. And somehow, it seems to ignore the .pxd  
file... If I run

$ cython foo.py

the file foo.pxd in the same directory is evidently used. However, if  
I build an extension with either just foo.py or both foo.py and  
foo.pxd as sources, using Distutils, I get results that seem to  
indicate that the pxd isn't used.

I see there's some handling of .py files in  
Cython.Distutils.build_ext, but it seems a bit limited...

>             if ext == ".py":
>                 # FIXME: we might want to special case this some more
>                 ext = '.pyx'


BTW: I wouldn't mind naming my files .pyx, but it seems that this  
interferes with cython's interpretation of the file. (I.e., it's no  
longer treated as a "pure Python mode" file, and I get warnings of  
conflicts with the pxd file.)

Also, I've used the standard package_dir argument to setup() ... but  
because I've got all the Cython source files in there, the .py files  
get installed alongside the .so files. What's the recommended setup  
for this?

Basically, I'm using a setup.py quite similar to what I've been using  
with my .pyx files, where it has worked just fine, but now I can't get  
it to work -- and I'm just wondering if I'm missing some way of  
configuring it, or if I have to write the compilation code myself. (Or  
if, perhaps, this is a bug? If that's the case, I could look into  
writing a patch, I guess.)

Thanks,

- M

-- 
Magnus Lie Hetland
http://hetland.org


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

Reply via email to