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


Groups > linux.debian.maint.python > #13925 > unrolled thread

Bug#1005043: lintian: check that Python version numbers are not 0.0.0

Started byJulian Gilbey <jdg@debian.org>
First post2022-02-05 22:10 +0100
Last post2022-02-08 08:00 +0100
Articles 7 — 4 participants

Back to article view | Back to linux.debian.maint.python


Contents

  Bug#1005043: lintian: check that Python version numbers are not 0.0.0 Julian Gilbey <jdg@debian.org> - 2022-02-05 22:10 +0100
    Bug#1005043: lintian: check that Python version numbers are not 0.0.0 Julian Gilbey <jdg@debian.org> - 2022-02-06 13:30 +0100
      Bug#1005043: lintian: check that Python version numbers are not 0.0.0 Stefano Rivera <stefanor@debian.org> - 2022-02-06 18:00 +0100
        Bug#1005043: lintian: check that Python version numbers are not 0.0.0 Sandro Tosi <morph@debian.org> - 2022-02-06 21:40 +0100
        Bug#1005043: lintian: check that Python version numbers are not 0.0.0 Julian Gilbey <jdg@debian.org> - 2022-02-07 07:40 +0100
          Re: Bug#1005043: lintian: check that Python version numbers are not  0.0.0 Stefano Rivera <stefanor@debian.org> - 2022-02-08 01:30 +0100
            Re: Bug#1005043: lintian: check that Python version numbers are not  0.0.0 Julian Gilbey <julian@d-and-j.net> - 2022-02-08 08:00 +0100

#13925 — Bug#1005043: lintian: check that Python version numbers are not 0.0.0

FromJulian Gilbey <jdg@debian.org>
Date2022-02-05 22:10 +0100
SubjectBug#1005043: lintian: check that Python version numbers are not 0.0.0
Message-ID<DNAtH-Xe-1@gated-at.bofh.it>
Package: lintian
Version: 2.111.0
Severity: wishlist
X-Debbugs-Cc: debian-python@lists.debian.org

I just ran into several Python packages that install modules with
version number 0.0.0 because of some issue with their setup.py
scripts.  I just did the following on my testing system:

lz4cat /var/lib/apt/lists/deb.debian.org_debian_dists_testing_main_Contents-all.lz4 | grep 'usr/lib/python3/dist-packages/.*-0\.0\.0\..*-info/PKG-INFO' | wc -l
24

lz4cat /var/lib/apt/lists/deb.debian.org_debian_dists_testing_main_Contents-all.lz4 | grep 'usr/lib/python3/dist-packages/.*-0\.0\.0\..*-info ' | wc -l
6

So there are at least about 30 packages with this problem.

The test for this bug (and it should probably be recorded as an error,
not just a warning, as no Python package should have a version number
of 0.0.0) is simple: if the binary package contains has a file or
directory with the name as in the above regex, then the package has
this error.

Best wishes,

   Julian

[toc] | [next] | [standalone]


#13928

FromJulian Gilbey <jdg@debian.org>
Date2022-02-06 13:30 +0100
Message-ID<DNOQ1-1ha-3@gated-at.bofh.it>
In reply to#13925
On Sat, Feb 05, 2022 at 04:42:57PM -0500, Sandro Tosi wrote:
> > The test for this bug (and it should probably be recorded as an error,
> > not just a warning, as no Python package should have a version number
> > of 0.0.0)
> 
> what exactly is the problem that would make it an 'error'?

When a package uses pkg_resources to determine the version number of
some package, it is returned the wrong information.  This is certainly
a packaging error: the upstream package, as installed by pip,
announces "this is version 1.2.3" but the Debian package announces
"this is version 0.0.0".

In the couple of cases I've looked at so far, it is due to the
upstream version using use_scm_version in setup.py.  This works fine
for a version that is in a Git repository, but it doesn't work for
Debian packages, as the Git version lookup fails.  So this needs to be
patched.

Perhaps a better way would be for dh_python3 to handle this by
"teaching" use_scm_version to look at debian/changelog, as this would
save 30+ packages having to continually update a setup.py patch.

What do you think?

Best wishes,

   Julian

[toc] | [prev] | [next] | [standalone]


#13929

FromStefano Rivera <stefanor@debian.org>
Date2022-02-06 18:00 +0100
Message-ID<DNT3j-3JU-1@gated-at.bofh.it>
In reply to#13928
Hi Julian (2022.02.06_12:19:54_+0000)
> In the couple of cases I've looked at so far, it is due to the
> upstream version using use_scm_version in setup.py.  This works fine
> for a version that is in a Git repository, but it doesn't work for
> Debian packages, as the Git version lookup fails.  So this needs to be
> patched.

Or export SETUPTOOLS_SCM_PRETEND_VERSION.
https://github.com/pypa/setuptools_scm#environment-variables

pybuild does this for you.

SR

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

[toc] | [prev] | [next] | [standalone]


#13930

FromSandro Tosi <morph@debian.org>
Date2022-02-06 21:40 +0100
Message-ID<DNWud-5SV-1@gated-at.bofh.it>
In reply to#13929
> Or export SETUPTOOLS_SCM_PRETEND_VERSION.
> https://github.com/pypa/setuptools_scm#environment-variables
>
> pybuild does this for you.

i dont remember the exact details, but sometimes that doesnt work:
even just building the source package (which runs dh clean, which
invokes setup.py clean) the build fails because "something something
SCM something".

It could be the specific package is doing things in a funky way but
that's my experience at least

-- 
Sandro "morph" Tosi
My website: http://sandrotosi.me/
Me at Debian: http://wiki.debian.org/SandroTosi
Twitter: https://twitter.com/sandrotosi

[toc] | [prev] | [next] | [standalone]


#13931

FromJulian Gilbey <jdg@debian.org>
Date2022-02-07 07:40 +0100
Message-ID<DO5Hb-79a-1@gated-at.bofh.it>
In reply to#13929
On Sun, Feb 06, 2022 at 04:46:53PM +0000, Stefano Rivera wrote:
> Hi Julian (2022.02.06_12:19:54_+0000)
> > In the couple of cases I've looked at so far, it is due to the
> > upstream version using use_scm_version in setup.py.  This works fine
> > for a version that is in a Git repository, but it doesn't work for
> > Debian packages, as the Git version lookup fails.  So this needs to be
> > patched.
> 
> Or export SETUPTOOLS_SCM_PRETEND_VERSION.
> https://github.com/pypa/setuptools_scm#environment-variables
> 
> pybuild does this for you.

Hi Stefano,

I'm a little confused by this.  Have a look at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005039 against
python3-iniconfig.  It has a very straightforward debian/rules, using
pybuild, and its setup.py script has "use_scm_version=True", but it
still produces a python package with version number 0.0.0.

I have tried this in an environment where I have
python3-setuptools-scm installed, by the way (even though the package
does not Build-Depends on it).  I'm using dh-python version 5.20220119

Best wishes,

   Julian

[toc] | [prev] | [next] | [standalone]


#13933 — Re: Bug#1005043: lintian: check that Python version numbers are not 0.0.0

FromStefano Rivera <stefanor@debian.org>
Date2022-02-08 01:30 +0100
SubjectRe: Bug#1005043: lintian: check that Python version numbers are not 0.0.0
Message-ID<DOmyl-hh6-1@gated-at.bofh.it>
In reply to#13931
Hi Julian (2022.02.07_06:26:38_+0000)
> I'm a little confused by this.  Have a look at
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005039 against
> python3-iniconfig.  It has a very straightforward debian/rules, using
> pybuild, and its setup.py script has "use_scm_version=True", but it
> still produces a python package with version number 0.0.0.
> 
> I have tried this in an environment where I have
> python3-setuptools-scm installed, by the way (even though the package
> does not Build-Depends on it).  I'm using dh-python version 5.20220119

That's the issue, it *needs* to Build-Depend on that (pybuild only
exports the PRETEND environment variable when there is a
Build-Dependency).

Committed a fix to git.

SR

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

[toc] | [prev] | [next] | [standalone]


#13934 — Re: Bug#1005043: lintian: check that Python version numbers are not 0.0.0

FromJulian Gilbey <julian@d-and-j.net>
Date2022-02-08 08:00 +0100
SubjectRe: Bug#1005043: lintian: check that Python version numbers are not 0.0.0
Message-ID<DOsDL-lie-3@gated-at.bofh.it>
In reply to#13933
On Tue, Feb 08, 2022 at 12:26:01AM +0000, Stefano Rivera wrote:
> Hi Julian (2022.02.07_06:26:38_+0000)
> > I'm a little confused by this.  Have a look at
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005039 against
> > python3-iniconfig.  It has a very straightforward debian/rules, using
> > pybuild, and its setup.py script has "use_scm_version=True", but it
> > still produces a python package with version number 0.0.0.
> > 
> > I have tried this in an environment where I have
> > python3-setuptools-scm installed, by the way (even though the package
> > does not Build-Depends on it).  I'm using dh-python version 5.20220119
> 
> That's the issue, it *needs* to Build-Depend on that (pybuild only
> exports the PRETEND environment variable when there is a
> Build-Dependency).
> 
> Committed a fix to git.

Ah, thanks Stefano!

Best wishes,

   Julian

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web