diff mbox series

[2/4] check-venv: use recorded Python version

Message ID 20181109150710.31085-3-crosa@redhat.com
State New
Headers show
Series Record Python version and misc test/CI fixes | expand

Commit Message

Cleber Rosa Nov. 9, 2018, 3:07 p.m. UTC
The current approach works fine, but it runs Python on every make
command (even if it's not related to the venv usage).

This is just an optimization, and not a change of behavior.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/Makefile.include | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Eduardo Habkost Nov. 9, 2018, 9:27 p.m. UTC | #1
On Fri, Nov 09, 2018 at 10:07:08AM -0500, Cleber Rosa wrote:
> The current approach works fine, but it runs Python on every make
> command (even if it's not related to the venv usage).
> 
> This is just an optimization, and not a change of behavior.
> 
> Signed-off-by: Cleber Rosa <crosa@redhat.com>

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
diff mbox series

Patch

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 074eece558..c0a341c923 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -913,8 +913,7 @@  TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
 # information please refer to "avocado --help".
 AVOCADO_SHOW=none
 
-PYTHON3 = $(shell $(PYTHON) -c 'import sys; print(1 if sys.version_info >= (3, 0) else 0)')
-ifeq ($(PYTHON3), 1)
+ifneq ($(findstring v2,"v$(PYTHON_VERSION)"),v2)
 $(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
 	$(call quiet-command, \
             $(PYTHON) -m venv --system-site-packages $@, \