[Distutils] Data files with setuptools

P.J. Eby pje at telecommunity.com
Sun Jul 26 04:03:08 CEST 2009


At 01:20 PM 7/25/2009 -0400, Adeel Ahmad Khan wrote:
>I am having some trouble including data files in the egg installed by
>setuptools.  I've listed the data files in MANIFEST.in and set
>include_package_data = True.
>
>     % ls
>     LICENSE             README          ez_setup.py     timed.py
>     MANIFEST.in cmdapp.py       setup.py
>
>     % cat setup.py
>     from ez_setup import use_setuptools
>     use_setuptools()
>     from setuptools import setup
>
>     setup(
>       # ...
>       py_modules=['timed', 'cmdapp'],
>       entry_points={'console_scripts': ['timed = timed:main']},
>       include_package_data=True,
>       install_requires=['PyYAML'],
>       zip_safe=False,
>     )
>
>     % cat MANIFEST.in
>     include *.py
>     include README
>     include LICENSE
>
>Why isn't README there?  What do I need to do to include it?

The README is not "package data" because it's not inside a 
package.  You can't install package data in a project that only 
includes modules.  In any case, there's no point in shipping 
documentation inside an egg, because only your project's *code* will 
be able to read it, not humans.  Human-readable documentation only 
belongs in a source distribution.

Note that, in general, you do not need to distribute eggs for your 
project.  The egg format is intended for plugins and other situations 
that require pre-built, ready-to-execute binaries.  pip, buildout, 
and easy_install can all build their own eggs on the target system in 
most cases, so the only benefit to distributing eggs is if you have, 
say, a C extension module and want to provide pre-compiled versions 
for Mac OS and Windows.  (And for Windows, you can build a 
bdist_wininst .exe instead; easy_install at least will still be able 
to use it, and you'll make Paul Moore happy. ;-)  (That's an inside 
joke, don't worry if you don't know who Paul is.))



More information about the Distutils-SIG mailing list