• Use of flit as a build-backend in pybuild

    From Scott Kitterman@21:1/5 to All on Mon Nov 29 20:40:01 2021
    The versions of pybuild in stable, testing, and unstable all support flit as a build-backend for packages built upstream using flit. You can tell if your package is built using flit if it has a pyproject.toml file and it contains a paragraph like:

    [build-system]
    requires = ["flit_core >=3.2.0,<4"]
    build-backend = "flit_core.buildapi"

    Of the packages I've looked at, they either have no setup.py at all or a very rudimentary generated setup.py. Although the generated setup.py will work, it's only going to provide limited Python metadata for the package. Under the hood, using flit provides a nicer package.

    To use the flit backend for pybuild all you should need to do is add flit to build-depends and drop whichever of python3-setuptools or python3-distutils
    you are using now. Flit will be autodetected (and you will see it mentioned
    in the build log).

    Flit 3.0 is the lowest version in Debian, so if the requires version is 3.0 or less, then an unversioned build-depends on flit is appropriate. For the example above it would be:

    flit >= 3.2.0

    There is one issue at present, currently if upstream provides optional depends in PEP 621 metadata (there is a [project.optional-dependencies] paragraph in the pyproject.toml) these optional dependencies are added to the binary
    depends through the python3:Depends expansion variable. I expect this to be fixed in the next dh-python upload. In the meantime this can be disabled by:

    override_dh_python3:
    dh_python3 --no-guessing-deps

    As I'm going through updating my packages, I'm finding flit use is much more common than I was expecting. You may be able to use this more than you thought. I certainly am.

    Scott K
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEE53Kb/76FQA/u7iOxeNfe+5rVmvEFAmGlLEwACgkQeNfe+5rV mvFm0w//ZksrrgS3L8tn5Dz3nCUL1JR1zNBEWFrv8ulbvslSHmGomijgOFLfOZET g2b5JqBlh6USe/XXfoq8WUiXURo7mH82sm4jjiOHmqMdSbE2VpijoGSsFU091mtQ r4w8DK5kvfeCDP3eAA5Q5zvSf5rYa4tpUUPn5Z7KftxJi0AktGTSlaxVe+P10KV+ Uo6gyYZhC22bxVIqw9+lqwa2IMn81/9h0AGXH/WEcuyVk73kRQ/AEeZee6ZxgsEs IJX7/o9RKx0Bdps7Bg1+o3CiCNNs8AfgcxwzVG79HSSbxwhzpjDv2l1HeQ5ue78d JQBkTYd7RT8XqKPBho7bvNZehw85mKiNTrlj6QN+auL0To2oHwxBOiivsKJ0KrJ7 HLBUt/C563gseq76no6lrBfMk/mw+N5Vyz3Nu7MITM0iFRvqd4jMF8/yUJsi7SdO 6TFbNpbF4UFj2TyoCD/IycSQJDPGOcMnx5icmjhCJWeHayIxu7/hSGxhz4kYuOck wLmcBpxcJhSBMw8KoxLcCQI7DPf5zTKDO58xRql8iwVc6vVxfbBxhulQf8FCpgDB HxmwgTXUVZGA7wWF42cF9+UWkUnoJIiIvKlTtT5ufj10J41AqZNYXMLd35i3iqSr R+ZsxGnHGBXZA9sIdRq21J+qSyioq0xviIZ2COHhio/aOjSsT04=
    =BDIn
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefano Rivera@21:1/5 to All on Mon Nov 29 22:40:01 2021
    Hi Scott (2021.11.29_19:38:52_+0000)
    The versions of pybuild in stable, testing, and unstable all support flit as a
    build-backend for packages built upstream using flit.

    While we're talking about this. Until recently, the flit plugin in
    pybuild didn't have the test-runner support that was available when
    using setuptools. That is now fixed, so if you were using a workaround
    to run the test manually, you can probably drop it now (for bookworm).

    SR

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

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