python: Configure tox to skip missing interpreters
authorWainer dos Santos Moschetta <wainersm@redhat.com>
Wed, 30 Jun 2021 18:45:46 +0000 (15:45 -0300)
committerCleber Rosa <crosa@redhat.com>
Tue, 13 Jul 2021 19:44:16 +0000 (15:44 -0400)
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>
Message-Id: <20210630184546.456582-1-wainersm@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
.gitlab-ci.d/static_checks.yml
python/Makefile
python/setup.cfg

index b01f6ec231e8f349f2d0efe2efa64f71061930dc..96dbd9e310e4740fe5b5f6588960e6ac18073b9a 100644 (file)
@@ -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
index ac46ae33e7adbe1286d4d1c7dc33147dfac78117..fe27a3e12ee3a3136d3f3d7131b8b6418bf6c821 100644 (file)
@@ -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:
index 11f71d531204612bb3e01cf29e9676de843a3f78..14bab9028836a91e32c4361fb54c527567af7297 100644 (file)
@@ -121,6 +121,7 @@ multi_line_output=3
 
 [tox:tox]
 envlist = py36, py37, py38, py39, py310
+skip_missing_interpreters = true
 
 [testenv]
 allowlist_externals = make