[Distutils] Adding a sub-command to the setup.py "build" and "develop" commands

Brian Sutherland brian at vanguardistas.net
Fri Mar 13 02:17:56 CET 2009


Hi,

I've just released a setuptools/distutils extension that makes the
process of compiling translations (i.e. .po -> .mo files) quite
automatic.

    http://pypi.python.org/pypi/van.potomo/

However, one major problem is that to modify the function of the
setup.py "build" and "develop" commands one needs to do this in the
setup.py:

    from setuptools import setup, find_packages
    from van.potomo import develop, build

    setup(
        name = "HelloWorld",
        cmdclass = {'build': build,
                    'develop': develop},
        setup_requires = ["van.potomo"],
        version = "0.1",
        packages = find_packages(),
        )

Meaning that you have to manually install van.potomo before tools like
buildout can run the setup.py to figure out the dependencies. Is there
any way to make that more automatic, especially so that buildout can
have a chance?

>From my experience with Debian, there's a "Build Dependencies" field in
the control file where one can specify such things. I'm kindof hoping
there's a setuptools equivalent?

I've searched for a while and most solutions involve monkey patching or
too much code in the setup.py.

-- 
Brian Sutherland


More information about the Distutils-SIG mailing list