Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #15007

Bug#1034588: lintian: provide a check for Build-Depends: python3-setuptools-scm for python packages using setuptools_scm

Path csiph.com!fu-berlin.de!bofh.it!news.nic.it!robomod
From Drew Parsons <dparsons@debian.org>
Newsgroups linux.debian.bugs.dist, linux.debian.maint.python
Subject Bug#1034588: lintian: provide a check for Build-Depends: python3-setuptools-scm for python packages using setuptools_scm
Date Wed, 19 Apr 2023 02:40:01 +0200
Message-ID <Gm41z-2Y2p-1@gated-at.bofh.it> (permalink)
X-Mailbox-Line From debian-bugs-dist-request@lists.debian.org Wed Apr 19 00:39:13 2023
Old-Return-Path <debbugs@buxtehude.debian.org>
X-Spam-Flag NO
X-Spam-Score -4.2
Reply-To Drew Parsons <dparsons@debian.org>, 1034588@bugs.debian.org
Resent-To debian-bugs-dist@lists.debian.org
Resent-Cc debian-python@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>
X-Debian-Pr-Message report 1034588
X-Debian-Pr-Package lintian
X-Debian-Pr-Source lintian
Content-Type text/plain; charset="us-ascii"
MIME-Version 1.0
Content-Transfer-Encoding 7bit
X-Mailer reportbug 11.6.0
X-Debian-Message from BTS
X-Mailing-List <debian-bugs-dist@lists.debian.org> archive/latest/1768329
List-ID <debian-bugs-dist.lists.debian.org>
List-URL <https://lists.debian.org/debian-bugs-dist/>
Approved robomod@news.nic.it
Lines 49
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Wed, 19 Apr 2023 02:01:12 +0200
X-Original-Message-ID <168186247235.11801.17517257372210384139.reportbug@sandy>
Xref csiph.com linux.debian.bugs.dist:1144356 linux.debian.maint.python:15007

Cross-posted to 2 groups.

Show key headers only | View raw


Package: lintian
Version: 2.116.3
Severity: normal
X-Debbugs-Cc: debian-python@lists.debian.org

The current recommended way for packaging python packages (upstream)
is to provide a pyproject.toml file and build with setuptools
(python3-setuptools).  Debian python package building activates this
build method with
  Build-Depends: dh-python, pybuild-plugin-pyproject

There are a number of different ways in which python packages maintain
their version (within the package, not the debian version). One of
these methods is setuptools_scm, https://github.com/pypa/setuptools_scm/

setuptools_scm is activated by including a [tool.setuptools_scm]
section in the package's pyproject.toml file.

setuptools_scm often operates by overwriting any existing version.py
file that might be present in the source tarball, and in some cases
this generates very weird version numbers based on local git tags.

That behaviour can be annoying for debian packaging, but
setuptools_scm has provided a mechanism to make life easier for
package distribution systems. If the environment variable
SETUPTOOLS_SCM_PRETEND_VERSION is set, then setuptools_scm does not
overwrite the existing version file. This mechanism is documented
upstream at https://github.com/pypa/setuptools_scm/

pybuild is smart enough to know about SETUPTOOLS_SCM_PRETEND_VERSION
(see /usr/share/perl5/Debian/Debhelper/Buildsystem/pybuild.pm)
But it only processes this if python3-setuptools-scm has been included
in Build-Depends (more precisely, l.130
  if ((grep /python3-(setuptools-scm|hatch-vcs)/, @deps)

This behaviour is not obvious, so it's a good opportunity for lintian
to help debian python packages, by suggesting to add
  Build-Depends: python3-setuptools-scm 
when needed, if it's not already used.

The condition could be

1) debian/control has Build-Depends: dh-python, pybuild-plugin-pyproject
2) source has pyproject.toml containing [tool.setuptools_scm]
3) debian/control does not have Build-Depends: python3-setuptools-scm
 [3b) and debian/rules does not set SETUPTOOLS_SCM_PRETEND_VERSION manually]
then
  emit warning (or error) suggesting to add
    Build-Depends: python3-setuptools-scm

Back to linux.debian.maint.python | Previous | Next | Find similar | Unroll thread


Thread

Bug#1034588: lintian: provide a check for Build-Depends: python3-setuptools-scm for python packages using setuptools_scm Drew Parsons <dparsons@debian.org> - 2023-04-19 02:40 +0200

csiph-web