[Distutils] bdist_deb in stdeb

Andrew Straw strawman at astraw.com
Wed Sep 30 07:14:35 CEST 2009

Gerry Reno wrote:
> Gerry Reno wrote:
>> Andrew Straw wrote:
>>> Gerry Reno wrote:
>>>> Ok, here's what happens if I DON'T use the option (shown with the old
>>>> code - same logic):
>>>> $ python setup.py bdist_deb
>>>> ...
>>>> running build_scripts
>>>> ...
>>>> if test "2.5" = "2.5" -o "2.5" = "2.4"; then \
>>>> export SVEMOPT="--single-version-externally-managed" ;
>>>> python2.5 -c "import
>>>> setuptools,sys;f='setup.py';sys.argv[0]=f;execfile(f,{'__file__':f,'__name__':'__main__'})"
>>>> install \
>>>> --no-compile ${SVEMOPT} \
>>>> ...
>>>> error: option --single-version-externally-managed not recognized
>>>> ...
>>>> <process stops on the error>
>>>> I can't explain it, but this is what happens. This is on Ubuntu Hardy
>>>> using python 2.5.2.
>>> I see. I think it's because you're subclassing
>>> distutils.command.install
>>> rather than setuptools.command.install for your install command.
>>> Another idea is that you could also detect whether setuptools is
>>> imported by doing something like "if 'setuptools' in sys.modules" and
>>> then subclassing the appropriate install command based on that. Then
>>> you
>>> wouldn't need to pass the --disable-single-version-externally-managed
>>> argument at all.
>>> -Andrew
>> Ok, a little guidance please. As I understand it if I import
>> setuptools into my app setup.py and I subclass my install from
>> setuptools.command.install, then I can also use the option
>> '--single-version-externally-managed' to make the install behave like
>> the distutils style install. Is that correct?
>> If this is true then what I would like to do is to force this option
>> on in the code. How can I do that? I know I can probably put it into
>> setup.cfg but I just think it would be better hardwired into the code.
> No one?
> Ok, I refactored my app install code and have it running with setuptools.
> Andrew, how can I generate the .deb package without the leading
> 'python-' in the name? Is this configurable?
Yes. The 'Package' option. Described in "Customizing the produced Debian
source package (config options)" in the README.rst.


More information about the Distutils-SIG mailing list