[Distutils] trouble making egg...

Phillip J. Eby pje at telecommunity.com
Sun Aug 12 23:46:13 CEST 2007

At 09:59 PM 8/12/2007 +0100, Chris Withers wrote:
>Hi All,
>I've always built my python packages as a folder, with a __init__.py,
>any other python bits and then the miscellany (readme.txt, etc) in the
>same folder.
>For distributions, I've historically tarred up the folder and put it up
>to download with installation instructions to just untar somewhere on
>the python path.
>However, I'd now like to distribute one of my products as an egg, and so
>thought I'd use setuptools to build the source distros as well.
>The package is mailinglogger and you can see the svn trunk here:
>The setup.py there is wrong in that the egg is builds only contains the
>'tests' subpackage and none of the other modules, and no mailinglogger
>package to boot.
>Given the component.xml in there, I'm pretty sure I need to add a
>zip_safe=True, but what else do I need to do to get setup.py to
>correctly build an egg and a source distro?

Short answer: move the package and any data files that should be 
included to a mailinglogger/ subdirectory.

Alternative answer: use package_dir={'mailinglogger':'.'} and 
manually list the packages (since find_packages() doesn't support 
package_dir).  Downside to this approach is that "setup.py test" and 
"setup.py develop" will not work correctly -- for you or anyone else 
who wants to work on your package in source form.

More information about the Distutils-SIG mailing list