Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #8946

Re: Derive package dependencies from Setuptools declarations

From Ben Finney <bignose@debian.org>
Newsgroups linux.debian.maint.python
Subject Re: Derive package dependencies from Setuptools declarations
Date 2016-10-18 00:00 +0200
Message-ID <sto6R-YG-11@gated-at.bofh.it> (permalink)
References <sspRn-3m5-1@gated-at.bofh.it> <stbt1-12r-47@gated-at.bofh.it> <stc5H-1vh-11@gated-at.bofh.it> <stcyJ-1Fs-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Piotr Ożarowski <piotr@debian.org> writes:

> this one worked perfectly fine for me (tested with dh_python2 1.20141111-2)
> so I assumed you pointed us to a wrong example

What do you mean by “worked perfectly”? Remember that the problem I'm
encountering is that the package builds successfully, but with
‘${python:Depends}’ containing none of the dependencies declared in the
Setuptools script.

The Setuptools script definitely sets ‘install_requires’ in the ‘setup’
call:

=====
$ dget -x https://mentors.debian.net/debian/pool/main/m/mullvad-client/mullvad-client_60+dfsg.1-1.dsc
dget: retrieving
https://mentors.debian.net/debian/pool/main/m/mullvad-client/mullvad-client_60+dfsg.1-1.dsc
[…]
dpkg-source: info: extracting mullvad-client in mullvad-client-60+dfsg.1
[…]

$ cd mullvad-client-60+dfsg.1/

$ python2 -c "
import setuptools
def report_install_requires(**kwargs):
    print(kwargs['install_requires'])
setuptools.setup = report_install_requires
import setup
"
['appdirs', 'ipaddr', 'netifaces', 'psutil', 'wxPython']

=====

So that should be what ‘dh-python’ needs to infer dependencies for the
‘${python:Depends}’, yes?

That's not what happens though:

=====
$ cat debian/control
[…]
Package: mullvad-client
Architecture: all
Depends:
    python-pkg-resources,
    python,
    openvpn,
    resolvconf,
    ${python:Depends},
    ${misc:Depends}
[…]

$ dpkg-buildpackage -A
[…]
dpkg-deb: building package 'mullvad-client' in '../mullvad-client_60+dfsg.1-1_all.deb'.
[…]

$ dpkg-deb --info ../mullvad-client_60+dfsg.1-1_all.deb
[…]
 Depends: python-pkg-resources, python, openvpn, resolvconf
[…]

=====

Note that the “Depends” field has replaced ‘${python:Depends}’ with
nothing, where I would expect all the corresponding packages to satisfy
‘install_requires’ from Setuptools.

So that's the problem: Setuptools gets packages named in
‘install_requires’, yet ‘dh_python2’ is not using that for Debian
package dependencies in the ‘${python:Depends}’ substitution.

Do you get different behaviour from building that package?

How am I meant to tell ‘dh_python2’ to replace the ‘${python:Depends}’
with what the upstream Setuptools script declares are its dependencies?

-- 
 \          “Generally speaking, the errors in religion are dangerous; |
  `\    those in philosophy only ridiculous.” —David Hume, _A Treatise |
_o__)                                           of Human Nature_, 1739 |
Ben Finney

Back to linux.debian.maint.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Derive package dependencies from Setuptools declarations Ben Finney <bignose@debian.org> - 2016-10-15 07:40 +0200
  Re: Derive package dependencies from Setuptools declarations Piotr Ożarowski <piotr@debian.org> - 2016-10-17 10:30 +0200
    Re: Derive package dependencies from Setuptools declarations Ben Finney <bignose@debian.org> - 2016-10-17 11:10 +0200
      Re: Derive package dependencies from Setuptools declarations Piotr Ożarowski <piotr@debian.org> - 2016-10-17 11:40 +0200
        Re: Derive package dependencies from Setuptools declarations Ben Finney <bignose@debian.org> - 2016-10-18 00:00 +0200

csiph-web