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


Groups > linux.debian.maint.python > #8941 > unrolled thread

Derive package dependencies from Setuptools declarations

Started byBen Finney <bignose@debian.org>
First post2016-10-15 07:40 +0200
Last post2016-10-18 00:00 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.debian.maint.python


Contents

  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

#8941 — Derive package dependencies from Setuptools declarations

FromBen Finney <bignose@debian.org>
Date2016-10-15 07:40 +0200
SubjectDerive package dependencies from Setuptools declarations
Message-ID<sspRn-3m5-1@gated-at.bofh.it>
Howdy all,

How can I convince ‘dh-python’ to derive package dependencies from the
Setuptools ‘install_requires’ declaration?

The Pip requirements tend to be tightly restrictive, because Pip is not
a distribution system but rather a deployment system. So those
requirements tend not to be good candidates for Debian's versioned
dependencies.

The Setuptools ‘install_requires’ declaration is a better candidate for
this, since it is metadata for the *distribution* (not deployment); this
better matches Debian's purposes for package dependencies.

See <URL:https://caremad.io/posts/2013/07/setup-vs-requirement/> for a
discussion of these complementary and different purposes.

How can I convince ‘dh-python’ to derive Debian package dependencies
from the Setuptools ‘install_requires’ declaration? For example,
<URL:https://mentors.debian.net/debian/pool/main/m/mullvad-client/mullvad-client_60+dfsg.1-1.dsc>
declares dependencies that ‘dh_python2’ does not detect; the resulting
binary has none of the Python dependent packages declared.

-- 
 \     “Capitalism has destroyed our belief in any effective power but |
  `\      that of self interest backed by force.” —George Bernard Shaw |
_o__)                                                                  |
Ben Finney

[toc] | [next] | [standalone]


#8943

FromPiotr Ożarowski <piotr@debian.org>
Date2016-10-17 10:30 +0200
Message-ID<stbt1-12r-47@gated-at.bofh.it>
In reply to#8941
[Ben Finney, 2016-10-15]
> How can I convince ‘dh-python’ to derive package dependencies from the
> Setuptools ‘install_requires’ declaration?

by dh-python you mean dh_python3, right?

> The Pip requirements tend to be tightly restrictive, because Pip is not
> a distribution system but rather a deployment system. So those
> requirements tend not to be good candidates for Debian's versioned
> dependencies.
> 
> The Setuptools ‘install_requires’ declaration is a better candidate for
> this, since it is metadata for the *distribution* (not deployment); this
> better matches Debian's purposes for package dependencies.
> 
> See <URL:https://caremad.io/posts/2013/07/setup-vs-requirement/> for a
> discussion of these complementary and different purposes.
> 
> How can I convince ‘dh-python’ to derive Debian package dependencies
> from the Setuptools ‘install_requires’ declaration? For example,

can you point me to a source package where dh_python3 *doesn't* do that
already?
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

[toc] | [prev] | [next] | [standalone]


#8944

FromBen Finney <bignose@debian.org>
Date2016-10-17 11:10 +0200
Message-ID<stc5H-1vh-11@gated-at.bofh.it>
In reply to#8943
Piotr Ożarowski <piotr@debian.org> writes:

> [Ben Finney, 2016-10-15]
> > How can I convince ‘dh-python’ to derive package dependencies from the
> > Setuptools ‘install_requires’ declaration?
>
> by dh-python you mean dh_python3, right?

In this case, ‘dh_python2’. Would you expect that to be different?

> > How can I convince ‘dh-python’ to derive Debian package dependencies
> > from the Setuptools ‘install_requires’ declaration? For example,
>
> can you point me to a source package where dh_python3 *doesn't* do that
> already?

I don't know why, but you snipped the sentence where I give an example:

Ben Finney wrote:

> How can I convince ‘dh-python’ to derive Debian package dependencies
> from the Setuptools ‘install_requires’ declaration? For example,
> <URL:https://mentors.debian.net/debian/pool/main/m/mullvad-client/mullvad-client_60+dfsg.1-1.dsc>
> declares dependencies that ‘dh_python2’ does not detect; the resulting
> binary has none of the Python dependent packages declared.

-- 
 \             “Dyslexia means never having to say that you're ysror.” |
  `\                                                        —anonymous |
_o__)                                                                  |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#8945

FromPiotr Ożarowski <piotr@debian.org>
Date2016-10-17 11:40 +0200
Message-ID<stcyJ-1Fs-3@gated-at.bofh.it>
In reply to#8944
[Ben Finney, 2016-10-17]
> I don't know why, but you snipped the sentence where I give an example:

Your mail suggested that there's a problem with dh-python in general and
not with one of your packages only...

> Ben Finney wrote:
> 
> > How can I convince ‘dh-python’ to derive Debian package dependencies
> > from the Setuptools ‘install_requires’ declaration? For example,
> > <URL:https://mentors.debian.net/debian/pool/main/m/mullvad-client/mullvad-client_60+dfsg.1-1.dsc>
> > declares dependencies that ‘dh_python2’ does not detect; the resulting
> > binary has none of the Python dependent packages declared.

after making it buildable (missing "r" in VCS-Browser field),
this one worked perfectly fine for me (tested with dh_python2 1.20141111-2)
so I assumed you pointed us to a wrong example
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

[toc] | [prev] | [next] | [standalone]


#8946

FromBen Finney <bignose@debian.org>
Date2016-10-18 00:00 +0200
Message-ID<sto6R-YG-11@gated-at.bofh.it>
In reply to#8945
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web