diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2020-04-01 17:21:26 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2020-04-01 17:21:26 +0200 |
commit | 09a4062505a8d79451374139bab525457eeb28cd (patch) | |
tree | 28171e7941c3fb36d1da6561777d93ae56d10e98 /utils | |
parent | 31437d04e82ec9cde4209d881f6635ac39d92ac4 (diff) | |
download | searxng-09a4062505a8d79451374139bab525457eeb28cd.tar.gz searxng-09a4062505a8d79451374139bab525457eeb28cd.zip |
makefile.python: partial revert off 9b48ae47, adds py2 support back
revert "makefile.python: ... drop build support py2" to get back Py2 support.
TPy2 support need virtualenv installed by the OS.
BTW: log environment and python version in travis's install phase
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/makefile.python | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/utils/makefile.python b/utils/makefile.python index aaf21c115..590bbdb46 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -30,7 +30,7 @@ PYLINT_RC ?= .pylintrc TEST_FOLDER ?= ./tests TEST ?= . -VTENV_OPTS ?= +VTENV_OPTS = "--no-site-packages" PY_ENV = ./local/py$(PY) PY_ENV_BIN = $(PY_ENV)/bin PY_ENV_ACT = . $(PY_ENV_BIN)/activate @@ -41,6 +41,20 @@ ifeq ($(OS),Windows_NT) PY_ENV_ACT = $(PY_ENV_BIN)/activate endif +ifeq ($(PYTHON),python) + VIRTUALENV = virtualenv +else + VIRTUALENV = virtualenv --python=$(PYTHON) +endif + +ifeq ($(KBUILD_VERBOSE),1) + PIP_VERBOSE = + VIRTUALENV_VERBOSE = +else + PIP_VERBOSE = "-q" + VIRTUALENV_VERBOSE = "-q" +endif + python-help:: @echo 'makefile.python:' @echo ' pyenv | pyenv[un]install' @@ -108,16 +122,13 @@ quiet_cmd_pyenvuninstall = PYENV uninstall $2 cmd_pyenvuninstall = $(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) uninstall --yes $2 # $2 path to folder where virtualenv take place -# creating a virtualenv uses $(PYTHON) from the OS! quiet_cmd_virtualenv = PYENV usage: $ source ./$@/bin/activate cmd_virtualenv = \ - if [ ! -d "$(PY_ENV)" ];then \ - echo "PYENV create virtualenv $2"; \ - $(PYTHON) -m venv $(VTENV_OPTS) $2; \ + if [ ! -d "./$(PY_ENV)" ];then \ + $(VIRTUALENV) $(VIRTUALENV_VERBOSE) $(VTENV_OPTS) $2; \ else \ echo "PYENV using virtualenv from $2"; \ - fi; \ - echo "commands available at $(PY_ENV_BIN):"; ls $(PY_ENV_BIN) | $(FMT) ; + fi # $2 path to lint quiet_cmd_pylint = LINT $@ |