[SciPy-dev] Restructuring of Chaco/Kiva/FreeType into SciPy

Pearu Peterson pearu at cens.ioc.ee
Wed Dec 18 18:10:59 EST 2002


On Wed, 18 Dec 2002, David C. Morrill wrote:

> > I suggest keeping only one setup script, 'setup_xxx.py', per module.
> 
> Could you elaborate a little more on this please?

Sure. Currently some SciPy modules still have both setup.py and
setup_xxx.py files and since both contain more or less the same
information, it adds extra maintenance burden. So, the intention is to
get rid of one of these setup files.
 
Scipy assumes that its submodules have setup files in the form
setup_xxx.py, where xxx is module name, containing a function
``configuration(..)`` with the following template

from misc_util import get_path, default_config_dict
def configuration(parent_package=''):
    package = 'xxx'
    local_path = get_path(__name__)
    config = default_config_dict(package,parent_package)
    ...
    return config

To build/install Scipy modules as stand-alone modules, it is enough to
append the following hook to setup_xxx.py files:

if __name__ == '__main__':    
    from scipy_distutils.core import setup
    setup(**configuration())

and so separate setup.py files would be then redundant. For examples see
various scipy modules.

Note that we still don't have a good policy how to specify
dependencies. Two possible solutions are implemented in weave and f2py
setup scripts but they may not be optimal (in the sense of simplicity
and robustness). Any other ideas are welcome.

Pearu




More information about the SciPy-Dev mailing list