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

Re: dpkg-buildpackage vs sbuild with python packaging



On Wed, Jun 11, 2025 at 05:44:07PM +0200, PICCA Frederic-Emmanuel wrote:
> > However, it seems the upstream build actually depends on setuptools-scm now,
> > they (you? :)) don't use any other way to tell the build system about
> > the data files - the *.png images, the *.rst documentation, etc..
> > This... may be a problem if the package is not built out of a Git checkout
> > with Git itself present... and Debian packages are usually expected to be
> > built out of a plain extracted source archive, no `.git/`, no anything.
> 
> I am just contributing to the project, specifficaly I try to add a proper pyproject.toml file.
> 
> > I'd suggest making some changes upstream, like listing the data files yourself:
> >  https://setuptools.pypa.io/en/latest/userguide/datafiles.html
> > 
> > (or, of course, switching away from setuptools, but any build system you choose
> > may still need to be configured to include the data files along with your
> > Python module sources, although some of them do this by default for most files)
> 
> setuptools is not the right tool in order to build Python projects ?

It's not that it is not the right tool, but it has accumulated a lot of
history over the years, there are a lot of things that it has to do to
maintain compatibility with older projects that were written for older
setuptools versions. Occassionally they do make incompatible changes, and there is
much wailing and gnashing of teeth, but IMHO that's not really a bad thing :)

Some newer build systems, like hatchling or flit, are more streamlined
(that's another way to say "opinionated") - they do not let you do
everything you can do with setuptools and setuptools plugins, but they
handle the most common cases with a minimal amount of configuration.

Sorry, I may have phrased my original sentence a bit too strongly -
I am NOT saying that you should migrate away from setuptools, but
I personally have found hatchling much easier to configure for simple projects.

G'luck,
Peter

-- 
Peter Pentchev  roam@ringlet.net roam@debian.org peter@morpheusly.com
PGP key:        https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13

Attachment: signature.asc
Description: PGP signature


Reply to: