qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] python: Configure tox to skip missing interpreters
@ 2021-06-30 18:45 Wainer dos Santos Moschetta
  2021-06-30 20:59 ` Willian Rampazzo
  0 siblings, 1 reply; 3+ messages in thread
From: Wainer dos Santos Moschetta @ 2021-06-30 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth, ehabkost, alex.bennee, f4bug, willianr, crosa, jsnow

Currently tox tests against the installed interpreters, however if any
supported interpreter is absent then it will return fail. It seems not
reasonable to expect developers to have all supported interpreters
installed on their systems. Luckily tox can be configured to skip
missing interpreters.

This changed the tox setup so that missing interpreters are skipped by
default. On the CI, however, we still want to enforce it tests
against all supported. This way on CI the
--skip-missing-interpreters=false option is passed to tox.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
---
Tested locally with `make check-tox` and where I only Python 3.6 and 3.9
installed.
Tested on CI: https://gitlab.com/wainersm/qemu/-/jobs/1390010988
Still on CI, but I deliberately removed Python 3.8: https://gitlab.com/wainersm/qemu/-/jobs/1390046531

 .gitlab-ci.d/static_checks.yml | 1 +
 python/Makefile                | 5 ++++-
 python/setup.cfg               | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.d/static_checks.yml b/.gitlab-ci.d/static_checks.yml
index b01f6ec231..96dbd9e310 100644
--- a/.gitlab-ci.d/static_checks.yml
+++ b/.gitlab-ci.d/static_checks.yml
@@ -43,6 +43,7 @@ check-python-tox:
     - make -C python check-tox
   variables:
     GIT_DEPTH: 1
+    QEMU_TOX_EXTRA_ARGS: --skip-missing-interpreters=false
   needs:
     job: python-container
   allow_failure: true
diff --git a/python/Makefile b/python/Makefile
index ac46ae33e7..fe27a3e12e 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -1,4 +1,5 @@
 QEMU_VENV_DIR=.dev-venv
+QEMU_TOX_EXTRA_ARGS ?=
 
 .PHONY: help
 help:
@@ -15,6 +16,8 @@ help:
 	@echo "    These tests use the newest dependencies."
 	@echo "    Requires: Python 3.6 - 3.10, and tox."
 	@echo "    Hint (Fedora): 'sudo dnf install python3-tox python3.10'"
+	@echo "    The variable QEMU_TOX_EXTRA_ARGS can be use to pass extra"
+	@echo "    arguments to tox".
 	@echo ""
 	@echo "make check-dev:"
 	@echo "    Run tests in a venv against your default python3 version."
@@ -87,7 +90,7 @@ check:
 
 .PHONY: check-tox
 check-tox:
-	@tox
+	@tox $(QEMU_TOX_EXTRA_ARGS)
 
 .PHONY: clean
 clean:
diff --git a/python/setup.cfg b/python/setup.cfg
index 11f71d5312..14bab90288 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -121,6 +121,7 @@ multi_line_output=3
 
 [tox:tox]
 envlist = py36, py37, py38, py39, py310
+skip_missing_interpreters = true
 
 [testenv]
 allowlist_externals = make
-- 
2.31.1



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

* Re: [PATCH] python: Configure tox to skip missing interpreters
  2021-06-30 18:45 [PATCH] python: Configure tox to skip missing interpreters Wainer dos Santos Moschetta
@ 2021-06-30 20:59 ` Willian Rampazzo
  2021-07-08  3:41   ` John Snow
  0 siblings, 1 reply; 3+ messages in thread
From: Willian Rampazzo @ 2021-06-30 20:59 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta
  Cc: Thomas Huth, Eduardo Habkost, Alex Bennée, qemu-devel,
	Philippe Mathieu-Daudé,
	Cleber Rosa Junior, John Snow

On Wed, Jun 30, 2021 at 3:46 PM Wainer dos Santos Moschetta
<wainersm@redhat.com> wrote:
>
> Currently tox tests against the installed interpreters, however if any
> supported interpreter is absent then it will return fail. It seems not
> reasonable to expect developers to have all supported interpreters
> installed on their systems. Luckily tox can be configured to skip
> missing interpreters.
>
> This changed the tox setup so that missing interpreters are skipped by
> default. On the CI, however, we still want to enforce it tests
> against all supported. This way on CI the
> --skip-missing-interpreters=false option is passed to tox.
>
> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> ---
> Tested locally with `make check-tox` and where I only Python 3.6 and 3.9
> installed.
> Tested on CI: https://gitlab.com/wainersm/qemu/-/jobs/1390010988
> Still on CI, but I deliberately removed Python 3.8: https://gitlab.com/wainersm/qemu/-/jobs/1390046531
>
>  .gitlab-ci.d/static_checks.yml | 1 +
>  python/Makefile                | 5 ++++-
>  python/setup.cfg               | 1 +
>  3 files changed, 6 insertions(+), 1 deletion(-)
>

Seems reasonable.

Reviewed-by: Willian Rampazzo <willianr@redhat.com>



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

* Re: [PATCH] python: Configure tox to skip missing interpreters
  2021-06-30 20:59 ` Willian Rampazzo
@ 2021-07-08  3:41   ` John Snow
  0 siblings, 0 replies; 3+ messages in thread
From: John Snow @ 2021-07-08  3:41 UTC (permalink / raw)
  To: Willian Rampazzo
  Cc: Thomas Huth, Eduardo Habkost, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Cleber Rosa Junior, Alex Bennée

[-- Attachment #1: Type: text/plain, Size: 1461 bytes --]

On Wed, Jun 30, 2021 at 5:00 PM Willian Rampazzo <wrampazz@redhat.com>
wrote:

> On Wed, Jun 30, 2021 at 3:46 PM Wainer dos Santos Moschetta
> <wainersm@redhat.com> wrote:
> >
> > Currently tox tests against the installed interpreters, however if any
> > supported interpreter is absent then it will return fail. It seems not
> > reasonable to expect developers to have all supported interpreters
> > installed on their systems. Luckily tox can be configured to skip
> > missing interpreters.
> >
> > This changed the tox setup so that missing interpreters are skipped by
> > default. On the CI, however, we still want to enforce it tests
> > against all supported. This way on CI the
> > --skip-missing-interpreters=false option is passed to tox.
> >
> > Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> > ---
> > Tested locally with `make check-tox` and where I only Python 3.6 and 3.9
> > installed.
> > Tested on CI: https://gitlab.com/wainersm/qemu/-/jobs/1390010988
> > Still on CI, but I deliberately removed Python 3.8:
> https://gitlab.com/wainersm/qemu/-/jobs/1390046531
> >
> >  .gitlab-ci.d/static_checks.yml | 1 +
> >  python/Makefile                | 5 ++++-
> >  python/setup.cfg               | 1 +
> >  3 files changed, 6 insertions(+), 1 deletion(-)
> >
>
> Seems reasonable.
>
> Reviewed-by: Willian Rampazzo <willianr@redhat.com>
>
>
Nice, I get to have my cake and eat it too :)

Reviewed-by: John Snow <jsnow@redhat.com>

[-- Attachment #2: Type: text/html, Size: 2442 bytes --]

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

end of thread, other threads:[~2021-07-08  3:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 18:45 [PATCH] python: Configure tox to skip missing interpreters Wainer dos Santos Moschetta
2021-06-30 20:59 ` Willian Rampazzo
2021-07-08  3:41   ` John Snow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).