[Pyrex] New Distutils implementation for Pyrex.
Billy G. Allie
bill.allie at defiant.mug.org
Fri Aug 3 22:58:16 CEST 2007
Robert Bradshaw wrote:
> On Aug 1, 2007, at 5:55 PM, Billy G. Allie wrote:
>
>
>> This implementation of Pyrex.Distutils will:
>> put the generated files (*.c, *.h, *.pxi) into the [build_temp]/
>> pyrex directory (unless the --inplace option is used).
>> add the following Pyrex specific command-line options:
>>
>
> I'm not sure I like this (especially for the default).
>
I know I don't like the generated files to be placed same directory as
the source code.
An additional parameter (perhaps 'pyrex-output-dir') could be added to
allow the output directory to be specified if the
[build_temp]/pyrex directory is not desired.
>
>> pyrex-include-dirs: a list of directories that Pyrex will search
>> for include files (the -I option of pyrexc)
>>
>
> This is only necessary in the above case, right?
>
No. For example, in the libpq extension module, I use two include (.pxd)
files [clibpq.pxd & pyCAPI.pxd]. The directory structure used for the
source code is:
Projects
pypgsql3
trunk
inlcude
pyPgSQL
with the .pxd files in the include directory and the pyrex source
[pyPgSQL.libpq.pyx] in the pyPgSQL directory. This has nothing to do
with where the generated files are placed..
>
>> pyrex-cplus: tells Pyrex to use the C++ compiler to compile the
>> generated file.
>>
>
> Is this not handled by the "language" parameter in the
> distutils.core.Extension used in setup.py
>
If Pyrex is not told to use the C++ compiler, it will generate a '.c'
file instead of a '.cpp' file.
>
>> pyrex-create-listing: tells Pyrex to place error messages in a
>> listing (.lis) file.
>>
>
> I'm not sure this should be an extra option--it can be accomplished
> easier by piping to a file (or something else for that manner).
>
Basically, the pyrex- options were added to allow the existing options
for the Pyrex compiler to be given in the setup.py file. The pyrex
compiler accepts an option to generate a listing file, so this option
exists.
> Currently in Cython one can do cross-directory imports (like in
> python--essential for a project with 100's of extension modules), and
> this doesn't look like it respects that.
>
The pyrex-include-dirs option only specifies additional directory to
search for include files (i.e. the -I option to pyrexc).
> - Rober
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.copyleft.no/pipermail/pyrex/attachments/20070803/da1c416f/attachment-0001.html
More information about the Pyrex
mailing list