Search code examples
pythonpython-2.7rpmdistutils

Python distutils exclude setup.py


My setup.py script is simple:

from distutils.core import setup
setup(name='my-awesome-app', 
    version='1.0', 
    scripts=['my-awesome-app.py'],
    )

And the file structure is:

my-awesome-app/
    my-awesome-app.py
    setup.py

In theory I am only including my-awesome-app.py in the distribution. In practice setup.py ends up in the RPM too.
I don't see a point of including setup.py there, is there a way to force distutils to leave this file out?
I am using python 2.7, I build my RPM by running python setup.py bdist_rpm.
Thanks for help :)


Solution

  • setup.py is required because when the package is installed in your environment, the following command is run:

    $ python setup.py install
    

    Running python setup.py bdist_rpm only creates a distribution package that you can give to others. setup.py is still required to do the installation.