[Cython] Search paths for definition files
Sebastien Binet
seb.binet at gmail.com
Wed Jul 1 09:02:18 CEST 2009
hi,
On Tuesday 30 June 2009 23:43:00 Lisandro Dalcin wrote:
> On Tue, Jun 30, 2009 at 5:37 PM, Elliott
>
> Slaughter<elliottslaughter at gmail.com> wrote:
> > Hi,
> >
> > The manual states that "the Cython compiler searches for a file called
> > modulename.pxd along the search path for include files, as specified by
> > -I command line options" [1].
>
> A good thing about open source projects is that the best
> docummentation are the actual sources :-)
> http://hg.cython.org/cython-devel/file/tip/Cython/Distutils/extension.py
>
> Try this:
>
> from Cython.Distutils.extension import Extension
> ...
> Extension('foo', ['foo.pyx'], pyrex_include_dirs=['dir1', 'dir2', 'dir3'])
>
>
> Other way (not recommended, not portable for POSIX/Windows):
> add a setup.cfg file alongside your setup.py file, and write inside it
> (use ";" to separate on Windows):
I am a bit surprised by this non-portable behaviour.
is it a (stdlib) distutils overlook or a Cython.Distutils one ?
IIRC one can standardize on the POSIX syntax for path-separators and friends,
and have the posixpath module do the conversion for us:
>>> import posixpath
>>> assert posixpath.pathsep == ':'
>>> assert posixpath.sep == '/'
so always using the POSIX syntax in xyz.cfg files would be portable.
cheers,
sebastien.
--
#########################################
# Dr. Sebastien Binet
# Laboratoire de l'Accelerateur Lineaire
# Universite Paris-Sud XI
# Batiment 200
# 91898 Orsay
#########################################
More information about the Cython-dev
mailing list