Patch of docs for distutils build of pure Python module

7 views
Skip to first unread message

Ian Bell

unread,
Apr 28, 2012, 9:07:54 PM4/28/12
to cython...@googlegroups.com
All,

I have pasted here a patch of docs/src/userguide/source_files_and_compilation.rst to include a setup.py using .PY+.PXD.  I couldn't do a diff from the root of the repo since I can't download the whole repo since I am on a very strict bandwidth diet here in New Zealand :(

Regards,
Ian

84,89d83
< Pure Python File with Augmenting PXD
< =====================================
< If you have a .py file called example.py and an augmenting .pxd file called
< example.pxd, a distutils file that would build this simple example to the file
< example.pyd on Windows or example.so on other platforms would be given by the
< following setup.py::
91,106d84
<     from distutils.core import setup,Extension
<     from Cython.Distutils import build_ext
<
<     #Note: the name of the module MUST be the same as the name of the pure Python file
<     ext_modules = [Extension("example", ["example.py"])]
<
<     setup(
<         cmdclass = {'build_ext': build_ext},
<         ext_modules = ext_modules
<     )
<    
< Then at the console run::
<
<     python setup.py build_ext
<
< to build the extension
Reply all
Reply to author
Forward
0 new messages