[Distutils] Separate source and build folders

Michael Jones m.pricejones at gmail.com
Thu Oct 16 19:25:24 CEST 2008


Hi,

I've got a directory structure that looks like:
./setup.py
./src
./src/dn

where dn is a package containing my code. My setup.py looks like this:

-------
from setuptools import setup, find_packages

setup(
    name = "dnpkg",
    version = "0.1.7",
    packages = ['dn', 'dn.pkg', 'dn.pkg.interface'],
    package_dir = { "": "src"},

    namespace_packages = ['dn'],

    install_requires = ['SQLAlchemy>=0.4.2p3'],

    entry_points = {
        'console_scripts': [
            'dnpkg.test = dn.pkg.interface.commandline:main',
            'dnpkg.testweb = dn.pkg.interface.web:cgi',
            ]
        },

    package_data = {
        'dn.pkg' : [
            'templates/user/*.mako',
            'templates/show/*.mako',
            'templates/project/*.mako',
            'templates/*.mako'
            ],
        }
)
-------

As indicated I have two console scripts. This setup works fine the
console scripts are installed as desired. However I would like to have
a separate build directory so the layout matches my other (non-python)
projects. So I created a build directory, put my setup.py in there and
so I have:
./build
./build/setup.py
./src
./src/dn

And I changed the package_dir line in setup.py to "../src" instead of
"src". Now it appears ok, running "python2.5 setup.py bdist_egg" in
the build directory does much the same as in the old directory
structure. But when I do an install, I no longer get the lines:
Installing dnpkg.test script to <path>
Installing dnpkg.testweb script to <path>

and the scripts don't appear where they should. What am I missing?
I've been reading the docs but can't figure out where I'm going wrong.

Any help would be much appreciated,
Michael


More information about the Distutils-SIG mailing list