astropy/astropy — pull request #41 by eteq (2011-11-02 10:03:08+00:00)
Title: Setup cleanup for C/Cython extensions

This pull request (in part motivated by @phn 's pull request https://github.com/astropy/astropy/pull/39/) does a variety of fixes and clarifications in setup.py, mostly dealing with C/Cython extensions. It also updates the docs to reflect this scheme.

Key features/questions:

* As before, the get_extensions function of ``setup_package.py`` files in a subpackage are used to return Extension objects.
* The package source files are also searched for .pyx files (Cython files), and if they are found and not present in the Extension objects, they are added as new Extensions with the default numpy c-imports included. This
will hopefully facilitate easy development of Cython extensions when needed simply by adding a ``.pyx`` file and importing its name from somewhere else.
* Cython is used as long as the source is not in "release" mode, and Cython is installed. Otherwise, it tries to install any .c file with the appropriate name in the same place as the .pyx file.
* even if they aren't building anything in C/Cython, subpackages can still install data files and package data files (although the latter may change depending on how the config subpackage is eventually decided).