[perf] virtualenv: install boilerplate only once

Install boilerplate packages (pip, wheel, setuptools and requirements.txt) only
once, when virtualenv is created.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2020-12-24 15:59:57 +01:00
parent 2fc2d17a27
commit d85012b49b

View File

@ -113,6 +113,8 @@ quiet_cmd_virtualenv = PYENV usage: $ source ./$@/bin/activate
cmd_virtualenv = \ cmd_virtualenv = \
if [ ! -d "./$(PY_ENV)" ];then \ if [ ! -d "./$(PY_ENV)" ];then \
$(PYTHON) -m venv $(VTENV_OPTS) $2; \ $(PYTHON) -m venv $(VTENV_OPTS) $2; \
$(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -U pip wheel setuptools; \
$(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -r requirements.txt; \
else \ else \
echo "PYENV using virtualenv from $2"; \ echo "PYENV using virtualenv from $2"; \
fi fi
@ -193,8 +195,6 @@ pyclean:
pyenv: $(PY_ENV) pyenv: $(PY_ENV)
$(PY_ENV): python-exe $(PY_ENV): python-exe
$(call cmd,virtualenv,$(PY_ENV)) $(call cmd,virtualenv,$(PY_ENV))
$(Q)$(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -U pip wheel pip setuptools
$(Q)$(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -r requirements.txt
PHONY += pylint-exe PHONY += pylint-exe
pylint-exe: $(PY_ENV) pylint-exe: $(PY_ENV)