From 04ad648105a65a27a0654204a461775d178b49ce Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 8 Mar 2020 18:35:38 +0100 Subject: [PATCH] makefile.python: remove python2 support Signed-off-by: Markus Heiser --- docs/dev/quickstart.rst | 2 +- utils/makefile.python | 36 +++--------------------------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/docs/dev/quickstart.rst b/docs/dev/quickstart.rst index e40772b3b..0fb22d934 100644 --- a/docs/dev/quickstart.rst +++ b/docs/dev/quickstart.rst @@ -27,7 +27,7 @@ searx-ve virtualenv and install the required packages using ``manage.sh``. cd ~/myprojects git clone https://github.com/asciimoo/searx.git cd searx - virtualenv searx-ve + python3 -m venv searx-ve . ./searx-ve/bin/activate ./manage.sh update_dev_packages diff --git a/utils/makefile.python b/utils/makefile.python index 789cc4c90..f6aa4470a 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -26,7 +26,7 @@ PYLINT_RC ?= .pylintrc TEST_FOLDER ?= ./tests TEST ?= . -VTENV_OPTS = "--no-site-packages" +VTENV_OPTS ?= PY_ENV = ./local/py$(PY) PY_ENV_BIN = $(PY_ENV)/bin PY_ENV_ACT = . $(PY_ENV_BIN)/activate @@ -37,20 +37,6 @@ 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' @@ -110,22 +96,6 @@ pip-exe: @: endif -PHONY += msg-virtualenv-exe virtualenv-exe -msg-virtualenv-exe: - @echo "\n virtualenv is required\n\n\ - Make sure you have an updated virtualenv installed, grab it from\n\ - https://virtualenv.pypa.io/en/stable/installation/ or install it\n\ - via pip by::\n\n\ - pip install --user https://github.com/pypa/virtualenv/tarball/master\n" | $(FMT) - -ifeq ($(shell which virtualenv >/dev/null 2>&1; echo $$?), 1) -virtualenv-exe: msg-virtualenv-exe - $(error The 'virtualenv' command was not found) -else -virtualenv-exe: - @: -endif - # ------------------------------------------------------------------------------ # commands # ------------------------------------------------------------------------------ @@ -153,7 +123,7 @@ quiet_cmd_pyenvuninstall = PYENV uninstall $2 quiet_cmd_virtualenv = PYENV usage: $ source ./$@/bin/activate cmd_virtualenv = \ if [ ! -d "./$(PY_ENV)" ];then \ - $(VIRTUALENV) $(VIRTUALENV_VERBOSE) $(VTENV_OPTS) $2; \ + $(PYTHON) -m venv $(VTENV_OPTS) $2; \ else \ echo "PYENV using virtualenv from $2"; \ fi @@ -232,7 +202,7 @@ pyclean: # to build *local* environment, python and virtualenv from the OS is needed! pyenv: $(PY_ENV) -$(PY_ENV): virtualenv-exe python-exe +$(PY_ENV): python-exe $(call cmd,virtualenv,$(PY_ENV)) @$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) -r requirements.txt