[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Use of flit as a build-backend in pybuild



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

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: