How to package a command line Python script

Rather than using setuptools non standard way of proceeding, it is possible to directly rely on distutils setup’s function, using the scripts argument, as stated here: http://docs.python.org/distutils/setupscript.html#installing-scripts

from distutils import setup
setup(
    ...,
    scripts=['path/to/your/script',],
    ...
)

It allows you to stay compatible a) with all python versions and b) not having to rely on a setuptools as an external dependency.

Leave a Comment