[Cython] 0.9.8.1.1 and .pxd files

Lisandro Dalcin dalcinl at gmail.com
Fri Aug 29 00:46:43 CEST 2008


On Thu, Aug 28, 2008 at 3:02 PM, Robert Bradshaw
<robertwb at math.washington.edu> wrote:
> On Thu, 28 Aug 2008, Jim Kleckner wrote:
>
>> Lisandro Dalcin wrote:
>>> On Thu, Aug 28, 2008 at 12:26 AM, Jay Parlar <parlar at gmail.com> wrote:
>>>>> On Wed, Aug 27, 2008 at 10:43 PM, Simon Burton <simon at arrowtheory.com> wrote:
>>>>>
>>>>> i went through something similar recently,
>>>>> and had to add include_dirs=["."] in my Extension definitions in setup.py
>>>> Brilliant, that seems to have done it! I still have to have my
>>>> symlinks, but it's a starting point.
>
> This seems to have caused lot of confusion, should "." be put in
> include_dirs by default?

Not sure, it seems adding '.' is not needed in this case (I believe
the problems some user have can be related to Cython 'include'
directives)

[dalcinl at trantor tmp]$ tree foo
foo
|-- __init__.pyx
|-- bar.pxd
`-- bar.pyx

[dalcinl at trantor tmp]$ cython foo/bar.pyx
[dalcinl at trantor tmp]$ tree foo/
foo/
|-- __init__.pyx
|-- bar.c
|-- bar.pxd
`-- bar.pyx

[dalcinl at trantor tmp]$ rm foo/bar.c
[dalcinl at trantor tmp]$ cython -w foo bar.pyx
[dalcinl at trantor tmp]$ tree foo
foo
|-- __init__.pyx
|-- bar.c
|-- bar.pxd
`-- bar.pyx


So all this just work regardeless of the working directory.


>
>>> Could you try to remove your hack? I mean, instead of having
>>> foo.bar.pxd inside 'foo' package directory, just use 'bar.pxd', in
>>> such a way yo have:
>>>
>>> $ tree foo/
>>> foo/
>>> |-- __init__.pyx
>>> |-- bar.pxd
>>> `-- bar.pyx
>>>
>>> This works just fine for me.
>>
>> Also, check out the wiki page:
>>  http://wiki.cython.org/PackageHierarchy
>> for some details.
>>
>> _______________________________________________
>> Cython-dev mailing list
>> Cython-dev at codespeak.net
>> http://codespeak.net/mailman/listinfo/cython-dev
>>
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev
>



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594


More information about the Cython-dev mailing list