• Re: Python dependency when building

    From Soren Stoutner@21:1/5 to Preusse on Wed Apr 16 11:24:58 2025
    Copy: hille42@web.de (Hilmar Preusse)

    Hilmar,

    Can you please upload the repository to Salsa? That will make it
    easier to figure out what is going on.

    On Wednesday, April 16, 2025 5:07:46 AM Mountain Standard Time Hilmar Preusse wrote:
    Hi,

    I hope this question is easy to answer, maybe I'm on the wrong list.

    The lintian report for package asymptote-x11 says:

    E: asymptote-x11: python3-script-but-no-python3-dep python3 (does
    not satisfy python3:any | python3-minimal:any) [usr/share/asymptote/GUI/xasy.py] N:
    <snip>
    N:
    N: If you are using debhelper, adding ${python3:Depends} to the
    Depends field N: and ensuring dh_python3 is run during the build
    should take care of adding N: the correct dependency.
    N:

    The debian/control of the source package reads:

    Package: asymptote-x11
    Architecture: all
    Depends: ${misc:Depends},
    ${python3:Depends},
    asymptote (>= ${binary:Version}),
    <snip>

    and the d/rules uses the dh sequencer: dh $@ --with python3

    Looking at the build log I see that dh_python3 is called,
    nevertheless dpkg-gencontrol reports:

    dpkg-gencontrol: warning: Depends field of package asymptote-x11: substitution variable ${python3:Depends} used, but is not defined.

    The python related BD's of the source package are dh-python &
    python3. I replaced the "#!/usr/bin/env python3" shebang in the
    script by "#!/usr/bin/python3", but this did not solve the issue.

    What am I missing? Many thanks!

    Hilmar


    --
    Soren Stoutner
    soren@debian.org
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEJKVN2yNUZnlcqOI+wufLJ66wtgMFAmf/9foACgkQwufLJ66w tgP1jg//QhSoserM9IRohrvrHgZB0mVYouklzz+84PqxmuSwfFEAmvgLl9ALYZE9 j/BcnBkfMJnmmYfgRSgmD9sOcUT6OTUhJ7NPdFqXcAwF6HSBHHZRVQLvIl8fJGAS faVzRwjZJJYG7QPKmEPlp/Bg6T3ofFFwWg4XE6dGSxG5qsjahoI5/LkH1zT7pRnj xkAZE2XCt9vxzFjKQyFDqzoYoUTQaj8Ysao2TiN4eViVPKtedSgm435oqvntEr+u +7A8rQ0Ot5KOjpnwqdC6ky3jOp0BRSL7J0Q5p9Xv7Jkpoo1pflVjHLeG63IMUDXi I1BouQdpRGbhFZn/A+zj0WeFk/e+8WcIVIMuf7ANIFMDpVNJQdhNGlagg42Xu16o AB9plomj1/HHFAIanSrg2o9CAI52pH/apGGx5s9w2uCMP6SwSTwKItp1y2d6/ovp 80kBL9EvydHYsah9KcTAl6Wl5TUPNRGr3gbS/VwYego1H4VZaCAmBmZs5eWKP8qb bcDfAk2J2oJJ0MaSOOocIWg/x1+sVjaQFLYnq44MDuF0jVVhe0bL+goWAcoh2lTc iTTqhhk9bPVAhpdSzlcfp1MkFZfivipRyipvJ54KcBXzQfMuA0O5GXuLyA3rF97N zKi1kFs5nGFbaQXVfNb2Un3DUnwHgLUgeTO7zwq35JVAwnt6v1I=
    =/YFG
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeremy Sowden@21:1/5 to Hilmar Preusse on Wed Apr 16 22:10:01 2025
    --jUZEm7uvgPu+s/28
    Content-Type: text/plain; charset=utf-8; format=flowed
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable

    On 2025-04-16, at 14:07:46 +0200, Hilmar Preusse wrote:
    I hope this question is easy to answer, maybe I'm on the wrong list.

    The lintian report for package asymptote-x11 says:

    E: asymptote-x11: python3-script-but-no-python3-dep python3 (does not satisfy python3:any | python3-minimal:any) [usr/share/asymptote/GUI/xasy.py]
    N:
    <snip>
    N:
    N: If you are using debhelper, adding ${python3:Depends} to the Depends field
    N: and ensuring dh_python3 is run during the build should take care of adding
    N: the correct dependency.
    N:

    The debian/control of the source package reads:

    Package: asymptote-x11
    Architecture: all
    Depends: ${misc:Depends},
    ${python3:Depends},
    asymptote (>= ${binary:Version}),
    <snip>

    and the d/rules uses the dh sequencer: dh $@ --with python3

    Looking at the build log I see that dh_python3 is called, nevertheless dpkg-gencontrol reports:

    dpkg-gencontrol: warning: Depends field of package asymptote-x11: substitution
    variable ${python3:Depends} used, but is not defined.

    The python related BD's of the source package are dh-python & python3.
    I replaced the "#!/usr/bin/env python3" shebang in the script by "#!/usr/bin/python3", but this did not solve the issue.

    What am I missing? Many thanks!

    From the dh_python3 man-page:

    private dirs
    /usr/share/foo, /usr/share/games/foo, /usr/lib/foo and
    /usr/lib/games/foo private directories are scanned for Python
    files by default (where foo is bi‐ nary package name). If your
    package ships Python files in some other directory, add another
    dh_python3 call in debian/rules with directory name as an
    argument - you can use different set of options in this call. If
    you need to change options (f.e. a list of supported Python 3
    versions) for a private directory that is checked by default,
    invoke dh_python3 with --skip-private option and add another call
    with a path to this directory and new options.


    I've attached a patch.

    J.

    --jUZEm7uvgPu+s/28
    Content-Type: text/x-diff; charset=us-ascii
    Content-Disposition: attachment; filename="asymptote-dh_python3.patch" Content-Transfer-Encoding: quoted-printable

    diff --git a/debian/rules b/debian/rules
    index 0ce2ee396331..4387ffd436d4 100755
    --- a/debian/rules
    +++ b/debian/rules
    @@ -3,6 +3,8 @@
    # Avoid unneeded library dependencies reported by dpkg-shlibdeps.
    DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed
    DEB_BUILD_MAINT_OPTIONS := hardening=+all
    +
    +include /usr/share/dpkg/architecture.mk
    include /usr/share/dpkg/buildflags.mk
    include /usr/share/dpkg/pkg-info.mk

    @@ -40,6 +42,10 @@ override_dh_auto_install:
    #override_dh_auto_test:
    # : do nothing here, otherwise make tries to compile prc/test.cc

    +override_dh_python3:
    + dh_python3 -Nasymptote-x11
    + dh_python3 -pasymptote-x11 /usr/share/asymptote/GUI
    +
    override_dh_compress:
    dh_compress -X.pdf


    --jUZEm7uvgPu+s/28--

    -----BEGIN PGP SIGNATURE-----

    wsG7BAABCgBvBYJoAAyFCRAphqwKvfEEDUcUAAAAAAAeACBzYWx0QG5vdGF0aW9u cy5zZXF1b2lhLXBncC5vcmc8j6AsgWl3QDrE7PJFWI8Bo0Yea4ya1ai7luS/NsB9 RBYhBGwdtFNj70A3vVbVFymGrAq98QQNAABvKg/+KwAzdfzLB0+lnfN1vDz1D0vN fq2TPfQAC9RZZFmTmVeiumSY/Vm9uhpf3BOpEPm6u5etjRjRkXbqScOwfV9fMKDM jocmJMWlgE1NCwgt+MDHvpb9ouRb3yUJ0v0tYhFb+kyLvUez0P/2eWUa8W