[Stable-10.1.5 05/46] python: drop uses of pkg_resources

Michael Tokarev posted 46 patches 3 weeks, 6 days ago
[Stable-10.1.5 05/46] python: drop uses of pkg_resources
Posted by Michael Tokarev 3 weeks, 6 days 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>
(cherry picked from commit e44a26ba940214824b61976324058e73d9f41658)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/python/setup.py b/python/setup.py
index c5bc45919a..789fa39b0f 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.47.3
Re: [Stable-10.1.5 05/46] python: drop uses of pkg_resources
Posted by John Snow 3 weeks, 6 days ago
On Wed, Mar 11, 2026 at 11:05 AM Michael Tokarev <mjt@tls.msk.ru> 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.

Hiya mjt - that separate series mentioned in this commit has now also
been merged and you may wish to consider it for stable inclusion. It's
a four patch python PR that adds Python 3.14 testing support and drops
avocado and it makes the optional check-python-tox GitLab CI test
green again.

--js

>
> 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>
> (cherry picked from commit e44a26ba940214824b61976324058e73d9f41658)
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
>
> diff --git a/python/setup.py b/python/setup.py
> index c5bc45919a..789fa39b0f 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.47.3
>