All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] python: pin setuptools below v60.0.0
@ 2022-01-21  0:52 John Snow
  2022-01-21 17:54 ` Beraldo Leal
  2022-01-21 19:15 ` Cleber Rosa
  0 siblings, 2 replies; 5+ messages in thread
From: John Snow @ 2022-01-21  0:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eduardo Habkost, John Snow, Beraldo Leal, Cleber Rosa

setuptools is a package that replaces the python stdlib 'distutils'. It
is generally installed by all venv-creating tools "by default". It isn't
actually needed at runtime for the qemu package, so our own setup.cfg
does not mention it as a dependency.

However, tox will create virtual environments that include it, and will
upgrade it to the very latest version. the 'venv' tool will also include
whichever version your host system happens to have.

Unfortunately, setuptools version 60.0.0 and above include a hack to
forcibly overwrite python's built-in distutils. The pylint tool that we
use to run code analysis checks on this package relies on distutils and
suffers regressions when setuptools >= 60.0.0 is present at all, see
https://github.com/PyCQA/pylint/issues/5704

Instruct tox and the 'check-dev' targets to avoid setuptools packages
that are too new, for now. Pipenv is unaffected, because setuptools 60
does not offer Python 3.6 support, and our pipenv config is pinned
against Python 3.6.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/Makefile  | 2 ++
 python/setup.cfg | 1 +
 2 files changed, 3 insertions(+)

diff --git a/python/Makefile b/python/Makefile
index 3334311362..949c472624 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -68,6 +68,8 @@ $(QEMU_VENV_DIR) $(QEMU_VENV_DIR)/bin/activate: setup.cfg
 		echo "ACTIVATE $(QEMU_VENV_DIR)";		\
 		. $(QEMU_VENV_DIR)/bin/activate;		\
 		echo "INSTALL qemu[devel] $(QEMU_VENV_DIR)";	\
+		pip install --disable-pip-version-check		\
+			"setuptools<60.0.0" 1>/dev/null;	\
 		make develop 1>/dev/null;			\
 	)
 	@touch $(QEMU_VENV_DIR)
diff --git a/python/setup.cfg b/python/setup.cfg
index 417e937839..aa238d8bc9 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -163,6 +163,7 @@ deps =
     .[devel]
     .[fuse]  # Workaround to trigger tox venv rebuild
     .[tui]   # Workaround to trigger tox venv rebuild
+    setuptools < 60  # Workaround, please see commit msg.
 commands =
     make check
 
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] python: pin setuptools below v60.0.0
  2022-01-21  0:52 [PATCH] python: pin setuptools below v60.0.0 John Snow
@ 2022-01-21 17:54 ` Beraldo Leal
  2022-01-21 17:57   ` John Snow
  2022-01-21 19:15 ` Cleber Rosa
  1 sibling, 1 reply; 5+ messages in thread
From: Beraldo Leal @ 2022-01-21 17:54 UTC (permalink / raw)
  To: John Snow; +Cc: Eduardo Habkost, qemu-devel, Cleber Rosa

On Thu, Jan 20, 2022 at 07:52:21PM -0500, John Snow wrote:
> setuptools is a package that replaces the python stdlib 'distutils'. It
> is generally installed by all venv-creating tools "by default". It isn't
> actually needed at runtime for the qemu package, so our own setup.cfg
> does not mention it as a dependency.
> 
> However, tox will create virtual environments that include it, and will
> upgrade it to the very latest version. the 'venv' tool will also include
> whichever version your host system happens to have.
> 
> Unfortunately, setuptools version 60.0.0 and above include a hack to
> forcibly overwrite python's built-in distutils. The pylint tool that we
> use to run code analysis checks on this package relies on distutils and
> suffers regressions when setuptools >= 60.0.0 is present at all, see
> https://github.com/PyCQA/pylint/issues/5704
> 
> Instruct tox and the 'check-dev' targets to avoid setuptools packages
> that are too new, for now. Pipenv is unaffected, because setuptools 60
> does not offer Python 3.6 support, and our pipenv config is pinned
> against Python 3.6.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  python/Makefile  | 2 ++
>  python/setup.cfg | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/python/Makefile b/python/Makefile
> index 3334311362..949c472624 100644
> --- a/python/Makefile
> +++ b/python/Makefile
> @@ -68,6 +68,8 @@ $(QEMU_VENV_DIR) $(QEMU_VENV_DIR)/bin/activate: setup.cfg
>  		echo "ACTIVATE $(QEMU_VENV_DIR)";		\
>  		. $(QEMU_VENV_DIR)/bin/activate;		\
>  		echo "INSTALL qemu[devel] $(QEMU_VENV_DIR)";	\
> +		pip install --disable-pip-version-check		\
> +			"setuptools<60.0.0" 1>/dev/null;	\
>  		make develop 1>/dev/null;			\
>  	)
>  	@touch $(QEMU_VENV_DIR)
> diff --git a/python/setup.cfg b/python/setup.cfg
> index 417e937839..aa238d8bc9 100644
> --- a/python/setup.cfg
> +++ b/python/setup.cfg
> @@ -163,6 +163,7 @@ deps =
>      .[devel]
>      .[fuse]  # Workaround to trigger tox venv rebuild
>      .[tui]   # Workaround to trigger tox venv rebuild
> +    setuptools < 60  # Workaround, please see commit msg.
>  commands =
>      make check
>  

Reviewed-by: Beraldo Leal <bleal@redhat.com>

--
Beraldo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] python: pin setuptools below v60.0.0
  2022-01-21 17:54 ` Beraldo Leal
@ 2022-01-21 17:57   ` John Snow
  0 siblings, 0 replies; 5+ messages in thread
From: John Snow @ 2022-01-21 17:57 UTC (permalink / raw)
  To: Beraldo Leal; +Cc: Eduardo Habkost, qemu-devel, Cleber Rosa

On Fri, Jan 21, 2022 at 12:54 PM Beraldo Leal <bleal@redhat.com> wrote:
>
> On Thu, Jan 20, 2022 at 07:52:21PM -0500, John Snow wrote:
> > setuptools is a package that replaces the python stdlib 'distutils'. It
> > is generally installed by all venv-creating tools "by default". It isn't
> > actually needed at runtime for the qemu package, so our own setup.cfg
> > does not mention it as a dependency.
> >
> > However, tox will create virtual environments that include it, and will
> > upgrade it to the very latest version. the 'venv' tool will also include
> > whichever version your host system happens to have.
> >
> > Unfortunately, setuptools version 60.0.0 and above include a hack to
> > forcibly overwrite python's built-in distutils. The pylint tool that we
> > use to run code analysis checks on this package relies on distutils and
> > suffers regressions when setuptools >= 60.0.0 is present at all, see
> > https://github.com/PyCQA/pylint/issues/5704
> >
> > Instruct tox and the 'check-dev' targets to avoid setuptools packages
> > that are too new, for now. Pipenv is unaffected, because setuptools 60
> > does not offer Python 3.6 support, and our pipenv config is pinned
> > against Python 3.6.
> >
> > Signed-off-by: John Snow <jsnow@redhat.com>
> > ---
> >  python/Makefile  | 2 ++
> >  python/setup.cfg | 1 +
> >  2 files changed, 3 insertions(+)
> >
> > diff --git a/python/Makefile b/python/Makefile
> > index 3334311362..949c472624 100644
> > --- a/python/Makefile
> > +++ b/python/Makefile
> > @@ -68,6 +68,8 @@ $(QEMU_VENV_DIR) $(QEMU_VENV_DIR)/bin/activate: setup.cfg
> >               echo "ACTIVATE $(QEMU_VENV_DIR)";               \
> >               . $(QEMU_VENV_DIR)/bin/activate;                \
> >               echo "INSTALL qemu[devel] $(QEMU_VENV_DIR)";    \
> > +             pip install --disable-pip-version-check         \
> > +                     "setuptools<60.0.0" 1>/dev/null;        \
> >               make develop 1>/dev/null;                       \
> >       )
> >       @touch $(QEMU_VENV_DIR)
> > diff --git a/python/setup.cfg b/python/setup.cfg
> > index 417e937839..aa238d8bc9 100644
> > --- a/python/setup.cfg
> > +++ b/python/setup.cfg
> > @@ -163,6 +163,7 @@ deps =
> >      .[devel]
> >      .[fuse]  # Workaround to trigger tox venv rebuild
> >      .[tui]   # Workaround to trigger tox venv rebuild
> > +    setuptools < 60  # Workaround, please see commit msg.
> >  commands =
> >      make check
> >
>
> Reviewed-by: Beraldo Leal <bleal@redhat.com>
>
> --
> Beraldo
>

Thanks a million. I'm staging this right away.

--js



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] python: pin setuptools below v60.0.0
  2022-01-21  0:52 [PATCH] python: pin setuptools below v60.0.0 John Snow
  2022-01-21 17:54 ` Beraldo Leal
@ 2022-01-21 19:15 ` Cleber Rosa
  2022-01-21 21:03   ` John Snow
  1 sibling, 1 reply; 5+ messages in thread
From: Cleber Rosa @ 2022-01-21 19:15 UTC (permalink / raw)
  To: John Snow; +Cc: Eduardo Habkost, Cleber Rosa, qemu-devel, Beraldo Leal


John Snow <jsnow@redhat.com> writes:

> setuptools is a package that replaces the python stdlib 'distutils'. It
> is generally installed by all venv-creating tools "by default". It isn't
> actually needed at runtime for the qemu package, so our own setup.cfg
> does not mention it as a dependency.
>
> However, tox will create virtual environments that include it, and will
> upgrade it to the very latest version. the 'venv' tool will also include
> whichever version your host system happens to have.
>
> Unfortunately, setuptools version 60.0.0 and above include a hack to
> forcibly overwrite python's built-in distutils. The pylint tool that we
> use to run code analysis checks on this package relies on distutils and
> suffers regressions when setuptools >= 60.0.0 is present at all, see
> https://github.com/PyCQA/pylint/issues/5704
>
> Instruct tox and the 'check-dev' targets to avoid setuptools packages
> that are too new, for now. Pipenv is unaffected, because setuptools 60
> does not offer Python 3.6 support, and our pipenv config is pinned
> against Python 3.6.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  python/Makefile  | 2 ++
>  python/setup.cfg | 1 +
>  2 files changed, 3 insertions(+)
>

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] python: pin setuptools below v60.0.0
  2022-01-21 19:15 ` Cleber Rosa
@ 2022-01-21 21:03   ` John Snow
  0 siblings, 0 replies; 5+ messages in thread
From: John Snow @ 2022-01-21 21:03 UTC (permalink / raw)
  To: Cleber Rosa; +Cc: Eduardo Habkost, qemu-devel, Beraldo Leal

On Fri, Jan 21, 2022 at 2:15 PM Cleber Rosa <crosa@redhat.com> wrote:
>
>
> John Snow <jsnow@redhat.com> writes:
>
> > setuptools is a package that replaces the python stdlib 'distutils'. It
> > is generally installed by all venv-creating tools "by default". It isn't
> > actually needed at runtime for the qemu package, so our own setup.cfg
> > does not mention it as a dependency.
> >
> > However, tox will create virtual environments that include it, and will
> > upgrade it to the very latest version. the 'venv' tool will also include
> > whichever version your host system happens to have.
> >
> > Unfortunately, setuptools version 60.0.0 and above include a hack to
> > forcibly overwrite python's built-in distutils. The pylint tool that we
> > use to run code analysis checks on this package relies on distutils and
> > suffers regressions when setuptools >= 60.0.0 is present at all, see
> > https://github.com/PyCQA/pylint/issues/5704
> >
> > Instruct tox and the 'check-dev' targets to avoid setuptools packages
> > that are too new, for now. Pipenv is unaffected, because setuptools 60
> > does not offer Python 3.6 support, and our pipenv config is pinned
> > against Python 3.6.
> >
> > Signed-off-by: John Snow <jsnow@redhat.com>
> > ---
> >  python/Makefile  | 2 ++
> >  python/setup.cfg | 1 +
> >  2 files changed, 3 insertions(+)
> >
>
> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> Tested-by: Cleber Rosa <crosa@redhat.com>
>

Infinite gratitude. I've staged this patch and will send a PR shortly
(Assuming I can determine that the failures I'm seeing on GitLab right
now are not my fault.)

Thanks,
--js



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-21 21:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21  0:52 [PATCH] python: pin setuptools below v60.0.0 John Snow
2022-01-21 17:54 ` Beraldo Leal
2022-01-21 17:57   ` John Snow
2022-01-21 19:15 ` Cleber Rosa
2022-01-21 21:03   ` John Snow

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.