#5470: [needs review] Update Cython entry in Developer's Guide
---------------------------+------------------------------------------------
Reporter: cswiercz | Owner: cswiercz
Type: defect | Status: new
Priority: minor | Milestone: sage-3.4.1
Component: documentation | Keywords: documentation, cython
---------------------------+------------------------------------------------
Description changed by cswiercz:
Old description:
> The current description for adding a new Cython module is outdated:
>
> http://www.sagemath.org/doc/prog/node29.html
> {{{
> 3. Create a .pyx file in the Sage library and add a listing for it to the
> variable
> ext_modules in the file SAGE_ROOT/devel/sage/setup.py. For example, the
> file
> SAGE_ROOT/devel/sage/sage/graphs/chrompoly.pyx has lines
>
> Extension('sage.graphs.chrompoly',
> ['sage/graphs/chrompoly.pyx']
> ), \
>
> in setup.py. Also, the module - in this example sage.graphs.chrompoly -
> needs to be
> added to the packages list in setup.py . Then type sage -b to build Sage
> with the new
> code.
> }}}
>
> This documentation needs to account for the separate {{{module_list.py}}}
> file.
New description:
The current description for adding a new Cython module is outdated:
http://www.sagemath.org/doc/prog/node29.html
{{{
3. Create a .pyx file in the Sage library and add a listing for it to the
variable
ext_modules in the file SAGE_ROOT/devel/sage/setup.py. For example, the
file
SAGE_ROOT/devel/sage/sage/graphs/chrompoly.pyx has lines
Extension('sage.graphs.chrompoly',
['sage/graphs/chrompoly.pyx']
), \
in setup.py. Also, the module - in this example sage.graphs.chrompoly -
needs to be
added to the packages list in setup.py . Then type sage -b to build Sage
with the new
code.
}}}
Here is a fix. However, it looks like
{{{SAGE_ROOT/devel/sage/doc/en/developer/coding_in_other.rst}}} isn't
under any version control. Therefore, I'll just post a replacement
docstring here. Hopefully, someone can help me include it in the
appropriate file.
{{{
#. Create a .pyx file and add it to the Sage library.
#. First, add a listing for the Cython extension to the variable
``ext_modules`` in the file
``SAGE_ROOT/devel/sage/module_list.py``. See the
``distutils.extension.Extension`` class for more information on
creating
a new Cython extension.
#. Then, add the module name to the ``packages`` list in the file
``SAGE_ROOT/devel/sage/setup.py``.
#. Run ``sage -b`` to rebuild Sage with the new code.
For example, the file
``SAGE_ROOT/devel/sage/sage/graphs/chrompoly.pyx``
has the lines
::
Extension('sage.graphs.chompoly',
sources = ['sage/graphs/chrompoly.pyx']),
in ``module_list.py``. In addition, ``sage.graphs`` is included in the
packages list under the Distutils section of ``setup.py``.
}}}
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5470#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---