All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [RFC PATCH] python/setup.py: Drop version checking via pkg_resources
Date: Wed, 11 Feb 2026 16:15:22 +0000	[thread overview]
Message-ID: <aYyrGiqBeD1EcHp-@redhat.com> (raw)
In-Reply-To: <20260211161154.740256-1-thuth@redhat.com>

On Wed, Feb 11, 2026 at 05:11:54PM +0100, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
> 
> pkg_resources has been dropped from setuptools v82.0 and newer,
> so our setup.py script is currently failing there, breaking our CI.
> To fix it, switch to a direct version check instead.
> While we're at it, also bump the minimum version of setuptools
> to v44 now since that is the minimum that might still be in use
> on the distros we care about according to:
>  https://repology.org/project/python%3Asetuptools/versions
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  No clue whether that version check is fine with all versions of
>  setuptools, thus I marked the patch as RFC. At least it survives
>  the CI:
>  https://gitlab.com/thuth/qemu/-/pipelines/2319359396
> 
>  python/setup.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

This works so:

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


but the other option discussed on IRC was to remove the
existing version check entirely on the basis that all our
supported platforms will have sufficient version by default
and we don't need to spend time checking for the benefit of
unsupported platforms.

> 
> diff --git a/python/setup.py b/python/setup.py
> index c5bc45919a4..ae242ac95ac 100755
> --- a/python/setup.py
> +++ b/python/setup.py
> @@ -7,7 +7,6 @@
>  import setuptools
>  from setuptools.command import bdist_egg
>  import sys
> -import pkg_resources
>  
>  
>  class bdist_egg_guard(bdist_egg.bdist_egg):
> @@ -30,8 +29,8 @@ def main():
>      QEMU tooling installer
>      """
>  
> -    # https://medium.com/@daveshawley/safely-using-setup-cfg-for-metadata-1babbe54c108
> -    pkg_resources.require('setuptools>=39.2')
> +    if int(setuptools.__version__.split('.')[0]) < 44:
> +        raise ModuleNotFoundError('version of setuptools is too old')
>  
>      setuptools.setup(cmdclass={'bdist_egg': bdist_egg_guard})
>  
> -- 
> 2.53.0
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



      reply	other threads:[~2026-02-11 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 16:11 [RFC PATCH] python/setup.py: Drop version checking via pkg_resources Thomas Huth
2026-02-11 16:15 ` Daniel P. Berrangé [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYyrGiqBeD1EcHp-@redhat.com \
    --to=berrange@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.