[Distutils] "Out of source" bdist_egg, missing metadata

Augusto Destrero destrero at imavis.com
Thu May 27 13:08:08 CEST 2010


Hi, sorry if this email arrives twice. Now I'm registered to this list, so I 
can check that the email is delivered. :)

I've a question on setuptools egg creation. I've a directory structure like 
this:

python_libs/
|---- setup_foo
|     |---- setup.py
|---- src
|     |---- foo
|     |     |---- __init__.py
|     |     |---- foo_module.py
|     |---- bar
|     |     |---- __init__.py
|     |     |---- bar_module.py
|     |---- common
|     |     |---- __init__.py
|     |     |---- common_module.py 

Basically I have a src directory containing three packages (foo, bar and 
common), and I have a setup_foo directory OUTSIDE src, where I want to build 
an egg containing foo and common packages, and NOT bar package.

In the setup_foo/setup.py script I have something like this:

# -*- coding: utf-8 -*-
from setuptools import setup, find_packages

src_dir = "../src"

setup(name='foo',
      version='0.1',
      description="foo and common packages",
      packages=find_packages(src_dir, exclude=['bar', 'bar.*']),
      package_dir={'': src_dir},
      zip_safe=False,
      install_requires=[
          'PasteDeploy',
      ],
      entry_points="""
      [paste.app_factory]
      foo_app = foo.foo_module:app_factory
      common_app = common.common_module:app_factory
      """,
      )

You can see that I have two entry points (in this case for use with 
PasteDeploy in a wsgi project).

If I build an egg with that file:

$ cd setup_foo/
$ python setup.py bdist_egg

I can find a foo.egg-info directory under src which contains all metadata:

$ ls src/foo.egg-info/
dependency_links.txt  entry_points.txt  not-zip-safe  PKG-INFO  requires.txt  
SOURCES.txt  top_level.txt

But in the egg created under setup_foo/dist I don't have those metadata:

$ cd setup_foo/dist/
$ unzip foo-0.1-py2.6.egg
$ ls EGG-INFO/
not-zip-safe  SOURCES.txt

And of course, after installing that egg with easy_install, PasteDeploy can't 
find the entry points.

Is this a setuptools bug or I'm doing something wrong? I use setuptools 0.6.10 
distributed in Ubuntu Lucid.

Thank you in advance for your help, and excuse me for the lenghty email! 

-- 
Augusto Destrero


More information about the Distutils-SIG mailing list