[Distutils] bdist_deb in stdeb

Andrew Straw strawman at astraw.com
Mon Sep 28 18:33:54 CEST 2009

Olof Bjarnason wrote:
> 2009/9/28 Gerry Reno <greno at verizon.net>:
>>> Just pass the arguments directly to sdist_dsc. It should be something
>>> like this:
>>> python setup.py sdist_dsc --ignore-single-version-externally-managed
>>> --ignore-install-requires bdist_deb
>> How's that going to work?  You have 'sdist_dsc' on the command line as well
>> as 'bdist_deb'.   'bdist_deb' also calls 'sdist_dsc' internally but this
>> time it would be without any arguments?  How can that work?
This is standard distutils command processing -- this has nothing to do
with stdeb per se. The reason I gave an example not involving stdeb
(which was snipped out by you in your quote above) is so that you can
try it yourself and explore further without thinking it's somehow an
stdeb issue. Specifically, you do not need to understand anything
specific to stdeb to understand how to pass multiple arguments to
sub-commands of a distutils command. (And if stdeb handles things
differently, it's a bug and I would appreciate hearing about it.)

For example, "build_ext" is a sub-command of "install" that get called
to build extension modules prior to installation. (Being a sub-command
is not strictly true in the sense that the install command doesn't list
build_ext in its sub_commands in distutils/commands/install.py, but it
acts as if it's true.) Likewise, "sdist_dsc" is a sub-command of
"bdist_deb". In all cases one, might want to pass arguments to the
sub-command before running a later command. distutils allows this.

>> OK I know I'm a noob on *nix distribution of python apps', but:
>> Would it be possible to extend setup.py with info for package dependency?
>> Then python setup.py sdist_deb would know what package dependencies it
>> needs to add to the resulting .deb file.
Read the README.rst that is shipped with stdeb, specifically the section
"Customizing the produced Debian source package (config options)". You
want the "Depends" field in the stdeb.cfg file. (This will presumably be
back online at the stdeb homepage at http://github.com/astraw/stdeb
also, once github's move to rackspace is complete.)

There is also some stuff to automatically attempt to find dependencies
based on the setuptools install_requires fields.


More information about the Distutils-SIG mailing list