views:

521

answers:

1

This is my current setup.py script. It works okay, but it installs tvnamer.py (the tool) as "tvnamer.py" into site-packages or somewhere similar..

Can I make setup.py install tvnamer.py as tvnamer, and/or is there a better way of installing command-line applications?

+10  A: 

Try the entry_points.console_scripts parameter in the setup() call. As described in the setuptools docs, this should do what I think you want.

To reproduce here:

setup(
    # other arguments here...
    entry_points = {
        'console_scripts': [
            'foo = package.module:func',
            'bar = othermodule:somefunc',
        ],
    }
)
Blair Conrad
When I try this with Python 2.6 and 3.1, I get a message `UserWarning: Unknown distribution option: 'entry_points'`. So I guess it's not supported in the `distutils` that comes with Python (2.6 and 3.1). So, is it okay to use this option if we want to distribute on PyPI?
Craig McQueen