• dh_python3: file in /usr/lib/python3.12/dist-packages ?

    From Carles Pina i Estany@21:1/5 to All on Sun Feb 25 00:14:46 2024
    Copy: stefanor@debian.org

    Hi,

    CCed Stefano, since I've found a commit that might be relevant that he
    wrote.

    Via salsa and with dh_python3:

    D: dh_python3 dh_python3:179: version: 6.20231223

    It generates a .deb file with a directory:

    /usr/lib/python3.12/dist-packages/ping3-4.0.4.dist-info/

    With two files there:
    -INSTALLER
    -top_level.txt

    Causing lintian to complain via:
    -----
    W: python3-ping3: python-module-in-wrong-location usr/lib/python3.12/dist-packages/ping3-4.0.4.dist-info -> usr/lib/python3/dist-packages/ping3-4.0.4.dist-info
    I: python3-ping3: package-contains-documentation-outside-usr-share-doc [usr/lib/python3.12/dist-packages/ping3-4.0.4.dist-info/top_level.txt]
    -----

    I think that this was supposed to be not happening via the next
    changelog: https://salsa.debian.org/python-team/tools/dh-python/-/blob/master/debian/changelog?ref_type=heads#L20

    fix: https://salsa.debian.org/python-team/tools/dh-python/-/commit/c4bfdac892371c7fc3c1cc6a4c28e21b2dd384d9

    I'm not familiar with dh_python3 internals at all.

    Has anyone had the same problem?

    Is it a bug in dh_python3, or should I do something else in the package
    that I'm packaging to avoid it? (this might be a red herring of
    something else that I've missed!).

    Thanks very much,

    --
    Carles Pina i Estany
    https://carles.pina.cat

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

    iQIzBAABCgAdFiEEth6/Zob9uGYomaJ+qAKIT2ClX4EFAmXahnYACgkQqAKIT2Cl X4FJIw/+Jw9eGBQxOtS5j4KOG+es1IaJ6llOQ5pJXkwMGXOOo90f6OFyKULCVKAT hPVleoDOTeVNfhqzDqkNQPVp28/zT/f+xkrN4GzDgEWuLxRxrKzh2Z2+1mTPU4zv QGmwQ1ZL5US18GX5nNQanwWCV/6wwLStzDtvTZ/DAKMiZYj/EF0jAQ/5kqe0S970 eBdOYIwL0OfHwNG2viN2xEvMCkU6wzx/UQs4fruCmRKUUWTK2AusOZSunF7C7mhf nZyCEMG9Zo+Tpb1kIGa+Rd3m2IboVvupLirVzZXINFPorlXl1Y9dhN1B3mqmK7h7 QTe6p6cxg2aC+x0FvkLiLS4H6qrdBcKjY2uERdkHOmXzpU5l/kH1rB3kn68SZvui rb7u1kjEubJsVQFfCex1fOhhkysBga+cp0oeWJTJ1O+hHRwt0T8NbxiLTGVC+a7M dfaoySOvRFfOOJIgPONAfJXnIudzTxg8LFPGe1QuX6Ym+/18YW6IjT0mq/xvFZwf OiQCQZgL8ZvS9K9RxB1fQT3g/KFDN+8V/TpKsYxZYIZEIz9gDfIpF3T78sHCXWgk xJjC7VYu735GTor793qImlKROvj0uCnBgHY17TV9m/zCVxnGQZZDcCKYlLL/loyo tufIT5k01P2NoJbIWMLl84Rf2CS9x83VIRwERB4lnrC7opy9P0M=
    =MC8C
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From stefanor@debian.org@21:1/5 to All on Sun Feb 25 02:40:01 2024
    Hi Carles (2024.02.25_00:14:46_+0000)
    It generates a .deb file with a directory:

    /usr/lib/python3.12/dist-packages/ping3-4.0.4.dist-info/

    With two files there:
    -INSTALLER
    -top_level.txt

    If there are files in /usr/lib/python3.*/dist-packages/ after running dh_python3, it means they differed between python 3.x versions.
    So to investigate, diff the files against the ones in /usr/lib/python3/dist-packages/ and see if you can spot why they are not matching.

    It's probably something non-reproducible in the package's build system.

    Stefano

    --
    Stefano Rivera
    http://tumbleweed.org.za/
    +1 415 683 3272

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Carles Pina i Estany@21:1/5 to stefanor@debian.org on Sun Feb 25 23:32:09 2024
    Hi,

    On 25 Feb 2024 at 01:35:41, stefanor@debian.org wrote:
    Hi Carles (2024.02.25_00:14:46_+0000)
    It generates a .deb file with a directory:

    /usr/lib/python3.12/dist-packages/ping3-4.0.4.dist-info/

    With two files there:
    -INSTALLER
    -top_level.txt

    If there are files in /usr/lib/python3.*/dist-packages/ after running dh_python3, it means they differed between python 3.x versions.

    yes...

    So to investigate, diff the files against the ones in /usr/lib/python3/dist-packages/ and see if you can spot why they are not matching.

    $ ls python3.12/dist-packages/ping3-4.0.4.dist-info/
    INSTALLER top_level.txt

    $ ls python3/dist-packages/ping3-4.0.4.dist-info/
    entry_points.txt INSTALLER METADATA top_level.txt WHEEL

    The file INSTALLER is the same:

    $ diff -u python3.12/dist-packages/ping3-4.0.4.dist-info/INSTALLER python3/dist-packages/ping3-4.0.4.dist-info/INSTALLER

    The file top_level.txt is different:

    $ diff -u python3.12/dist-packages/ping3-4.0.4.dist-info/top_level.txt python3/dist-packages/ping3-4.0.4.dist-info/top_level.txt
    --- python3.12/dist-packages/ping3-4.0.4.dist-info/top_level.txt 2023-11-06 22:53:00.000000000 +0000
    +++ python3/dist-packages/ping3-4.0.4.dist-info/top_level.txt 2023-11-06 22:53:00.000000000 +0000
    @@ -1,2 +1,3 @@
    +build
    debian
    ping3

    It's probably something non-reproducible in the package's build system.

    Will investigate and if relevant share the problem here. This is in
    salsa using the standard pipeline. Last time that I run the pipeline I
    didn't have this problem. It was months ago.

    If you have any ideas let me know, of course!

    Thanks!

    --
    Carles Pina i Estany
    https://carles.pina.cat

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

    iQIzBAABCgAdFiEEth6/Zob9uGYomaJ+qAKIT2ClX4EFAmXbzfkACgkQqAKIT2Cl X4E2eQ/+ItShoukgkDx2y8/8ob8qsKHCufTRkl7ZKF/ZikWSWDJ9EbuTc721if8y W8Z+tE97rVXa3eiOCF0SxHXi4nxjNTNMqYfW2MJZlIxDAeauHg1K1NwhXs2DrIIG NRkBU0xWxxSFDMvmu9qFetadNyToaNAbfksCOrc6d5pYcklJBATuQhWQMyWs9Rkf +7NNa7/mfkE/DaX8GEEnrVyJC04Ny6Uxr1LVjGUCYrGFjWdAilKpdm4tCRl9sb50 tgeYixKwEm/yYTEUhm8ujcS3Byw2wTJgc7xz
  • From Carles Pina i Estany@21:1/5 to Carles Pina i Estany on Mon Feb 26 00:00:48 2024
    Hi,

    During the "gbp buildpackage" (or "dpkg-buildpackage") I see in Salsa:

    python3.11 -m build --skip-dependency-check --no-isolation --wheel
    --outdir /builds/python-team/packages/python-ping3/debian/output/source_dir/.pybuild/cpython3_3.11
    [...]
    python3.12 -m build --skip-dependency-check --no-isolation --wheel --outdir /builds/python-team/packages/python-ping3/debian/output/source_dir/.pybuild/cpython3_3.12

    The first one includes, in top_level.txt:
    debian
    ping3

    And the second one:
    build
    debian
    ping3

    Where "ping3" is the expected module. "debian" is there because of the
    debian/ directory (I'm super sure, and AFAIK should not be there!) and
    "build" is there on the second time since, I guess, it exists at that
    time.

    So, even in the package in testing, it contains "debian" which is wrong:

    $ cat ./dist-packages/ping3-4.0.4.dist-info/top_level.txt
    debian
    ping3

    And in salsa it contains the difference, making it more obvious.

    The file top_level.txt generated by "python3 -m build" in upstream
    checkout does not contain "debian".

    In my system, I see[1] more packages that might have the same problem.

    So now, I guess that the question is:

    a) How to make "python3 -m build" to not include "debian" or "build"?

    b) What would be the best way to address this (if possible, via d/rules changes). I mean, besides post-processing the generated file which I
    guess that is possible, but not the best idea.

    [1]: Via carles@pinux:/usr/lib/python3$ find . -iname "top_level.txt" -exec grep -l ^debian$ {} \;


    On 25 Feb 2024 at 23:32:09, Carles Pina i Estany wrote:

    Hi,

    On 25 Feb 2024 at 01:35:41, stefanor@debian.org wrote:
    Hi Carles (2024.02.25_00:14:46_+0000)
    It generates a .deb file with a directory:

    /usr/lib/python3.12/dist-packages/ping3-4.0.4.dist-info/

    With two files there:
    -INSTALLER
    -top_level.txt

    If there are files in /usr/lib/python3.*/dist-packages/ after running dh_python3, it means they differed between python 3.x versions.

    yes...

    So to investigate, diff the files against the ones in /usr/lib/python3/dist-packages/ and see if you can spot why they are not matching.

    $ ls python3.12/dist-packages/ping3-4.0.4.dist-info/
    INSTALLER top_level.txt

    $ ls python3/dist-packages/ping3-4.0.4.dist-info/
    entry_points.txt INSTALLER METADATA top_level.txt WHEEL

    The file INSTALLER is the same:

    $ diff -u python3.12/dist-packages/ping3-4.0.4.dist-info/INSTALLER python3/dist-packages/ping3-4.0.4.dist-info/INSTALLER

    The file top_level.txt is different:

    $ diff -u python3.12/dist-packages/ping3-4.0.4.dist-info/top_level.txt python3/dist-packages/ping3-4.0.4.dist-info/top_level.txt
    --- python3.12/dist-packages/ping3-4.0.4.dist-info/top_level.txt 2023-11-06 22:53:00.000000000 +0000
    +++ python3/dist-packages/ping3-4.0.4.dist-info/top_level.txt 2023-11-06 22:53:00.000000000 +0000
    @@ -1,2 +1,3 @@
    +build
    debian
    ping3

    It's probably something non-reproducible in the package's build system.

    Will investigate and if relevant share the problem here. This is in
    salsa using the standard pipeline. Last time that I run the pipeline I
    didn't have this problem. It was months ago.

    If you have any ideas let me know, of course!

    Thanks!

    --
    Carles Pina i Estany
    https://carles.pina.cat


    --
    Carles Pina i Estany
    https://carles.pina.cat

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

    iQIzBAABCgAdFiEEth6/Zob9uGYomaJ+qAKIT2ClX4EFAmXb1LAACgkQqAKIT2Cl X4Fk3Q//dozRnCTRVKwkAZM5ZapA5AvYj1Gr7TZoA+xeKC8Hd2ZTUCMYvCcy38P/ 0gkwTOM9Pl9QUZRb5ggKotMj4hIj7ldnjhE/Hqq/lpq58hKrST5OH0I6pScUvZxq 62Iv8RZRjjuZsbkTYXOX2SfLNNsMuh1aiSp0NsMiTpDk5pNjT8jZiWsa+un64Jxq jQs+6Bu/r2DUBNLOxGvGpMlGVa3aKaCd5Zhyf02cLKa3+q5SiolGIRnTqobOAPs7 Sj29wOhuJPeHbRuGs3RwHqb1RG3L8dkIuyIOwAWZz47940+E9d6V0qw9dEsUkADE +nUYAnbI3Bn/hIMM5hPJr1LbTjMpIE6bGy8Q3JdWxyOO6Bt5XlMxf+MzfSsXJqgR wv5x0amHVUwRY2znBVjm/M5F5lsZoWaZaXueTRXBtNLqf/FownPo3jJdfSpZvT/Q kK+TbgGMblfM5tF/evFl6JkqB2QfZfirR2GUF7qNArkYwqaD/L9WLB0oSmatDNh/ zeo3VdUzlUHD03eUdTJX2XnnPavbNQQYaoxIQrBAGIWzJQlCr7EoQFcROtrz6eqa jmwwFcCkFqGY8hf/DTVW/ASNQiTbYSvnml5QnGD7YyKCTqcsJF8CFGHnnIk2PWtZ fKUxoj4oHhbZK38RCd5t1nCx1y+iGNIECJPBc+gZCWBrN+zDxHs=
    =6Hsv
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefano Rivera@21:1/5 to All on Tue Feb 27 18:00:01 2024
    Hi Carles (2024.02.26_00:00:48_+0000)
    The first one includes, in top_level.txt:
    debian
    ping3

    And the second one:
    build
    debian
    ping3

    Where "ping3" is the expected module. "debian" is there because of the debian/ directory (I'm super sure, and AFAIK should not be there!) and "build" is there on the second time since, I guess, it exists at that
    time.

    So, even in the package in testing, it contains "debian" which is wrong:

    Yeah, that's wrong. We tried to stop this from happening a while ago,
    but it doesn't appear to be working, here. https://github.com/pypa/setuptools/pull/4001

    I think you've hit the NOTE in https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#finding-simple-packages
    If you (or ideally upstream) set "namespaces = false"
    I think it'll behave correctly.

    BTW, I see this package has patches-applied in git, so gbp can't work
    with them. The team policy is to store patches-unapplied. You can work
    on the patches with git via gbp-pq.

    Stefano

    --
    Stefano Rivera
    http://tumbleweed.org.za/
    +1 415 683 3272

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)