[PULL v2 14/14] python: drop uses of pkg_resources

Thomas Huth posted 14 patches 1 month, 4 weeks ago
Only 1 patches received!
[PULL v2 14/14] python: drop uses of pkg_resources
Posted by Thomas Huth 1 month, 4 weeks ago
From: John Snow <jsnow@redhat.com>

pkg_resources has been fully dropped from modern pip/setuptools
distributions and we should phase out its use. This patch is enough to,
by itself, repair most GitLab CI tests upstream; with the exception of
tox tests which are still making use of avocado - which will be dropped
in a separate series to restore functionality there.

Signed-off-by: John Snow <jsnow@redhat.com>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20260211195804.135144-3-jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 python/setup.py | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/python/setup.py b/python/setup.py
index c5bc45919a4..789fa39b0ff 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,9 +29,6 @@ def main():
     QEMU tooling installer
     """
 
-    # https://medium.com/@daveshawley/safely-using-setup-cfg-for-metadata-1babbe54c108
-    pkg_resources.require('setuptools>=39.2')
-
     setuptools.setup(cmdclass={'bdist_egg': bdist_egg_guard})
 
 
-- 
2.53.0
Re: [PULL v2 14/14] python: drop uses of pkg_resources
Posted by Thomas Huth 1 month, 3 weeks ago
On 12/02/2026 12.40, Thomas Huth wrote:
> From: John Snow <jsnow@redhat.com>
> 
> pkg_resources has been fully dropped from modern pip/setuptools
> distributions and we should phase out its use. This patch is enough to,
> by itself, repair most GitLab CI tests upstream; with the exception of
> tox tests which are still making use of avocado - which will be dropped
> in a separate series to restore functionality there.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Message-ID: <20260211195804.135144-3-jsnow@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   python/setup.py | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/python/setup.py b/python/setup.py
> index c5bc45919a4..789fa39b0ff 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,9 +29,6 @@ def main():
>       QEMU tooling installer
>       """
>   
> -    # https://medium.com/@daveshawley/safely-using-setup-cfg-for-metadata-1babbe54c108
> -    pkg_resources.require('setuptools>=39.2')
> -
>       setuptools.setup(cmdclass={'bdist_egg': bdist_egg_guard})
>   
>   

I think this should also be applied to the stable branches (now on CC:).

  Thomas
  • [PULL v2 14/14] python: drop uses of pkg_resources