<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=us-ascii" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Stefan Behnel wrote:
<blockquote cite="mid46B1952D.9050405@behnel.de" type="cite">
  <pre wrap="">Billy G. Allie wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I am re-implementing my PostgreSQL interface (pyPgSQL) using Pyrex to
implement an extension for the libpq C-API.  When using the supplied
build_ext, I notices that I had to have the .pxd files in the same
directory as the source .pyx file.  Also, the generated c source file
was placed in the same directory as the Pyrex source.  I also could not
specify Pyrex options to create a listing file, etc.  I wanted to have
the .pxd files in an separate include directory and I also did not want
to clean up the generated files from the Pyrex source directory.  To
correct these (minor) annoyances, I've implesmentd a new version of
buld_ext.py and created a version of core.py and extension.py.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Hi,

is this an independent implementation or is it based on the old one? If the
latter, could you provide a patch against Cython and submit it at the Cython
bug tracker? If it's new, could you still provide a single-file patch that
includes the new files? We use Mercurial as version control system (meta data
is in the source distribution), so an "hg export" would be greatly appreciated.

<a class="moz-txt-link-freetext" href="https://bugs.launchpad.net/cython">https://bugs.launchpad.net/cython</a>

<a class="moz-txt-link-freetext" href="http://www.cython.org">http://www.cython.org</a>
  </pre>
</blockquote>
It's independent.&nbsp; What I did was modified the Python 2.4.x distutils
to add the pyrex support, then created created diffs of the changes.&nbsp; I
then created the core.py, build_ext.py, and extension.py files to
incorporate the changes in a manner that did not require changes to the
original distutils files.<br>
<blockquote cite="mid46B1952D.9050405@behnel.de" type="cite">
  <pre wrap=""></pre>
  <blockquote type="cite">
    <pre wrap="">This implementation of Pyrex.Distutils will:

   1. put the generated files (*.c, *.h, *.pxi) into the
      [build_temp]/pyrex directory (unless the --inplace option is used).
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This might touch the generation of the public C API in Cython. It generates a
public .h file that should be part of the distribution. (Although Cython does
not currently include it automatically either...)
  </pre>
</blockquote>
I wonder if distutils can be made aware of that.&nbsp; I haven't used Cython
yet.&nbsp; When I do, I will look into it.<br>
<blockquote cite="mid46B1952D.9050405@behnel.de" type="cite">
  <pre wrap=""></pre>
  <blockquote type="cite">
    <pre wrap="">   2. add the following Pyrex specific command-line options:
          * pyrex-include-dirs: a list of directories that Pyrex will
            search for include files (the -I option of pyrexc)
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Don't distutils support something like this already?
  </pre>
</blockquote>
It has an include-dirs command line option that specifies the location
of any C headers to give the C compiler.&nbsp; My implementation will pass
the paths in the include-dirs option to Pyrex if the pyrex-include-dirs
options is not specified.&nbsp; By including pyrex-include-dirs you have the
option of putting all the Pyrex includes (.pxd files) in their own
directory, seperate from the C header files. (or the C and Pyrex header
files can be in a single directory, in which case you just specify the
include-dirs option).<br>
<blockquote cite="mid46B1952D.9050405@behnel.de" type="cite">
  <pre wrap="">
  </pre>
  <blockquote type="cite">
    <pre wrap="">          * pyrex-create-listing: tells Pyrex to place error messages in
            a listing (.lis) file.
I am also supplying a patch to Pyrex's Main.py that will place the
listing file in the same directory as the output file, instead of in the
same directory as the source file.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
What is this error listing used for?
  </pre>
</blockquote>
Any Pyrex (not C compiler) generated errors and warnings will go the
the listing file instead of to stderr when pyrex-create-listing is set
to 1.<br>
<blockquote cite="mid46B1952D.9050405@behnel.de" type="cite">
  <pre wrap="">
I'll look through your code for now to see if it matches with what Cython
currently does.

Thanks for the contribution.

Stefan


_______________________________________________
Pyrex mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pyrex@lists.copyleft.no">Pyrex@lists.copyleft.no</a>
<a class="moz-txt-link-freetext" href="http://lists.copyleft.no/mailman/listinfo/pyrex">http://lists.copyleft.no/mailman/listinfo/pyrex</a>
  </pre>
</blockquote>
<br>
</body>
</html>