stdeb icon indicating copy to clipboard operation
stdeb copied to clipboard

Packages listed in `extras_require` not listed as dependencies in package.

Open sjlongland opened this issue 6 years ago • 4 comments

Hi, We've struck an issue with the pint package in that it needs an additional package funcsigs on Python 2.7. We use stdeb to build a Debian package for use in deployments but have found that now stdeb is producing a Debian package that misses this funcsigs package.

Reproducing using Docker (we use Docker within Bamboo CI to build upstream packages):

docker run --rm \
	       -v ${PWD}:/tmp/out \
	       -e BUILD_UID=$( id -u ) \
	       -e BUILD_GID=$( id -g ) \
	       debian:jessie bash -xec '
# Add backports
sed -ne "/jessie main$/ { s/jessie/jessie-backports/; p; }" \
	/etc/apt/sources.list >> /etc/apt/sources.list

# Install packages
apt-get update
apt-get install -y python-pip python-setuptools git \
	python-all dpkg-dev dh-python debhelper gosu

# Install stdeb
git clone --depth=1 https://github.com/astraw/stdeb.git /tmp/stdeb
cd /tmp/stdeb
python setup.py install

# Build pint
git clone --depth=1 https://github.com/hgrecco/pint.git /tmp/pint
cd /tmp/pint
chown -R ${BUILD_UID}:${BUILD_GID} .
gosu ${BUILD_UID}:${BUILD_GID} python setup.py \
	     --command-package=stdeb.command bdist_deb

# Clean up work directory
find deb_dist -mindepth 1 -maxdepth 1 -type d | xargs rm -fr

# Copy built packages
mv -v deb_dist/* /tmp/out/'

I get the following in the current working directory after running the above:

stuartl@vk4msl-ws /tmp/pint $ dpkg-deb --info python-pint_0.9~dev0-1_all.deb 
 new Debian package, version 2.0.
 size 103866 bytes: control archive=2790 bytes.
    1047 bytes,    29 lines      control              
    4847 bytes,    53 lines      md5sums              
     161 bytes,     9 lines   *  postinst             #!/bin/sh
     259 bytes,    14 lines   *  prerm                #!/bin/sh
 Package: python-pint
 Source: pint
 Version: 0.9~dev0-1
 Architecture: all
 Maintainer: Hernan E. Grecco <[email protected]>
 Installed-Size: 558
 Depends: python (>= 2.7), python (<< 2.8)
 Section: python
 Priority: optional
 Description: Physical quantities module
  Pint: makes units easy
…

Note that Depends lacks a reference to python-funcsigs (which is in backports).

sjlongland avatar Aug 07 '18 07:08 sjlongland

A work-around in this case is to do this:

    gosu ${BUILD_UID}:${BUILD_GID} \
        python setup.py \
            --command-package stdeb.command \
            sdist_dsc \
            --depends python-funcsigs \
            bdist_deb

sjlongland avatar Aug 07 '18 08:08 sjlongland

[Stuart Longland, 2018-08-07]

Hi, We've struck an issue with the pint package in that it needs an additional package funcsigs on Python 2.7. We use stdeb to build a Debian package for use in deployments but have found that now stdeb is producing a Debian package that misses this funcsigs package.

does it list funcsigs in foo.egg-info/requires.txt file installed into dist-packages? If so: dh_python2 would pick it up and generate correct Depends line

BTW (shameless plug), please try py2dsp¹

[¹] https://github.com/p1otr/pypi2deb

p1otr avatar Aug 07 '18 10:08 p1otr

I did it again this time preserving the work directory that stdeb creates…

RC=0 stuartl@rikishi /tmp/pint-0.9~dev0 $ cat Pint.egg-info/requires.txt 

[:python_version == "2.7"]
funcsigs

sjlongland avatar Aug 07 '18 11:08 sjlongland

[:python_version == "2.7"] funcsigs

ah, right, dh_python2 doesn't support environment markers¹, sorry (not stdeb's fault)

[¹] https://bugs.debian.org/815654

p1otr avatar Aug 07 '18 21:08 p1otr