From a014fa0ccde01dbdbe314a45b176e932657b19e4 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 5 Feb 2020 15:26:57 +0100 Subject: upload-pypi: twine is needed to upload to PyPi 'make upload-pypi' To build & deploy packages on PyPi call make target: make upload-pypi - https://github.com/asciimoo/searx/issues/1829 Signed-off-by: Markus Heiser --- utils/makefile.python | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/makefile.python') diff --git a/utils/makefile.python b/utils/makefile.python index 4aa9d6b49..789cc4c90 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -192,7 +192,7 @@ quiet_cmd_pytest = TEST $@ # .. _installing: https://packaging.python.org/tutorials/installing-packages/ # quiet_cmd_pybuild = BUILD $@ - cmd_pybuild = $(PY_ENV_BIN)/$(PYTHON) setup.py \ + cmd_pybuild = $(PY_ENV_BIN)/python setup.py \ sdist -d $(PYDIST) \ bdist_wheel --bdist-dir $(PYBUILD) -d $(PYDIST) @@ -284,7 +284,7 @@ pyenv-python: pyenv-install # https://github.com/pypa/twine PHONY += upload-pypi -upload-pypi: pyclean pybuild +upload-pypi: pyclean pyenvinstall pybuild @$(PY_ENV_BIN)/twine upload $(PYDIST)/* .PHONY: $(PHONY) -- cgit v1.2.3 From 04ad648105a65a27a0654204a461775d178b49ce Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 8 Mar 2020 18:35:38 +0100 Subject: makefile.python: remove python2 support Signed-off-by: Markus Heiser --- utils/makefile.python | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'utils/makefile.python') 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 -- cgit v1.2.3 From 80f7b658047a3541697ef5ae1aae897817b3f43c Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 9 Mar 2020 01:37:26 +0100 Subject: searx.sh: add buildhost cmd, installs OS packages for builds Signed-off-by: Markus Heiser --- utils/makefile.python | 1 + 1 file changed, 1 insertion(+) (limited to 'utils/makefile.python') diff --git a/utils/makefile.python b/utils/makefile.python index f6aa4470a..f7e4315c1 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -204,6 +204,7 @@ pyclean: pyenv: $(PY_ENV) $(PY_ENV): python-exe $(call cmd,virtualenv,$(PY_ENV)) + @$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) -U wheel pip setuptools @$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) -r requirements.txt PHONY += pylint-exe -- cgit v1.2.3 From 86e79488aab3ff434c6682a9464ba2eee49158e9 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 15 Mar 2020 17:01:36 +0100 Subject: LXC: utils/makefile.lxc (inital) add /.lxcenv.mk to contaiiners Get LXC environment when building make targets. Signed-off-by: Markus Heiser --- utils/makefile.python | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'utils/makefile.python') diff --git a/utils/makefile.python b/utils/makefile.python index f7e4315c1..bd7d0d14e 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -5,11 +5,12 @@ PYOBJECTS ?= SITE_PYTHON ?=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))site-python export PYTHONPATH := $(SITE_PYTHON):$$PYTHONPATH +export PY_ENV PYDIST PYBUILD # folder where the python distribution takes place -PYDIST ?= ./py_dist +PYDIST = ./dist$(LXC_ENV_FOLDER) # folder where the python intermediate build files take place -PYBUILD ?= ./py_build +PYBUILD = ./build$(LXC_ENV_FOLDER) # python version to use PY ?=3 PYTHON ?= python$(PY) @@ -27,7 +28,7 @@ TEST_FOLDER ?= ./tests TEST ?= . VTENV_OPTS ?= -PY_ENV = ./local/py$(PY) +PY_ENV = ./local$(LXC_ENV_FOLDER)/py$(PY) PY_ENV_BIN = $(PY_ENV)/bin PY_ENV_ACT = . $(PY_ENV_BIN)/activate @@ -45,7 +46,7 @@ python-help:: @echo ' pylint - run pylint *linting*' @echo ' pytest - run *tox* test on python objects' @echo ' pydebug - run tests within a PDB debug session' - @echo ' pybuild - build python packages' + @echo ' pybuild - build python packages ($(PYDIST) $(PYBUILD))' @echo ' pyclean - clean intermediate python objects' @echo ' targets using system users environment:' @echo ' py[un]install - [un]install python objects in editable mode' @@ -169,7 +170,7 @@ quiet_cmd_pybuild = BUILD $@ quiet_cmd_pyclean = CLEAN $@ # remove 'build' folder since bdist_wheel does not care the --bdist-dir cmd_pyclean = \ - rm -rf $(PYDIST) $(PYBUILD) ./local ./.tox *.egg-info ;\ + rm -rf $(PYDIST) $(PYBUILD) $(PY_ENV) ./.tox *.egg-info ;\ find . -name '*.pyc' -exec rm -f {} + ;\ find . -name '*.pyo' -exec rm -f {} + ;\ find . -name __pycache__ -exec rm -rf {} + @@ -241,7 +242,7 @@ pyenv-uninstall: $(PY_ENV) # runs python interpreter from ./local/py/bin/python pyenv-python: pyenv-install - cd ./local; ../$(PY_ENV_BIN)/python -i + $(PY_ENV_BIN)/python -i # With 'dependency_links=' setuptools supports dependencies on packages hosted # on other reposetories then PyPi, see "Packages Not On PyPI" [1]. The big -- cgit v1.2.3 From baf1ffd1fa4923f3bd105f0d8daac4a9527bdc50 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 23 Mar 2020 18:05:46 +0100 Subject: LXC: set LXC_ENV_FOLDER=lxc/$(shell hostname)/ Signed-off-by: Markus Heiser --- utils/makefile.python | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'utils/makefile.python') diff --git a/utils/makefile.python b/utils/makefile.python index bd7d0d14e..1660468f5 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -8,9 +8,9 @@ export PYTHONPATH := $(SITE_PYTHON):$$PYTHONPATH export PY_ENV PYDIST PYBUILD # folder where the python distribution takes place -PYDIST = ./dist$(LXC_ENV_FOLDER) +PYDIST = ./$(LXC_ENV_FOLDER)dist # folder where the python intermediate build files take place -PYBUILD = ./build$(LXC_ENV_FOLDER) +PYBUILD = ./$(LXC_ENV_FOLDER)build # python version to use PY ?=3 PYTHON ?= python$(PY) @@ -28,7 +28,7 @@ TEST_FOLDER ?= ./tests TEST ?= . VTENV_OPTS ?= -PY_ENV = ./local$(LXC_ENV_FOLDER)/py$(PY) +PY_ENV = ./$(LXC_ENV_FOLDER)local/py$(PY) PY_ENV_BIN = $(PY_ENV)/bin PY_ENV_ACT = . $(PY_ENV_BIN)/activate -- cgit v1.2.3 From 5e2b161379420acd39e0474bb7f59545df7e1f3a Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 29 Mar 2020 16:46:07 +0200 Subject: Makefile: marginal fix Signed-off-by: Markus Heiser --- utils/makefile.python | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'utils/makefile.python') diff --git a/utils/makefile.python b/utils/makefile.python index 1660468f5..fddcb223f 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -12,9 +12,9 @@ PYDIST = ./$(LXC_ENV_FOLDER)dist # folder where the python intermediate build files take place PYBUILD = ./$(LXC_ENV_FOLDER)build # python version to use -PY ?=3 -PYTHON ?= python$(PY) -PIP ?= pip$(PY) +PY =3 +PYTHON = python$(PY) +PIP = pip$(PY) PIP_INST ?= --user # https://www.python.org/dev/peps/pep-0508/#extras -- cgit v1.2.3 From 6007bd7fc898bed7bdcd565f3f21aecdd86b6b83 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 1 Apr 2020 10:59:51 +0200 Subject: makefile.python: fix (old) typo Signed-off-by: Markus Heiser --- utils/makefile.python | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/makefile.python') diff --git a/utils/makefile.python b/utils/makefile.python index fddcb223f..b0f1c247a 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -123,7 +123,7 @@ quiet_cmd_pyenvuninstall = PYENV uninstall $2 # $2 path to folder where virtualenv take place quiet_cmd_virtualenv = PYENV usage: $ source ./$@/bin/activate cmd_virtualenv = \ - if [ ! -d "./$(PY_ENV)" ];then \ + if [ ! -d "$(PY_ENV)" ];then \ $(PYTHON) -m venv $(VTENV_OPTS) $2; \ else \ echo "PYENV using virtualenv from $2"; \ -- cgit v1.2.3 From 3bbcfe6ab3513315f2491160355ea671726d5b69 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 1 Apr 2020 11:57:48 +0200 Subject: travis: make travis build more verbose Signed-off-by: Markus Heiser --- utils/makefile.python | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'utils/makefile.python') diff --git a/utils/makefile.python b/utils/makefile.python index b0f1c247a..2e488bf2b 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -124,10 +124,12 @@ quiet_cmd_pyenvuninstall = PYENV uninstall $2 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; \ else \ echo "PYENV using virtualenv from $2"; \ - fi + fi; \ + echo "commands available at $(PY_ENV_BIN):"; ls $(PY_ENV_BIN) | $(FMT) ; # $2 path to lint quiet_cmd_pylint = LINT $@ @@ -205,8 +207,8 @@ pyclean: pyenv: $(PY_ENV) $(PY_ENV): python-exe $(call cmd,virtualenv,$(PY_ENV)) - @$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) -U wheel pip setuptools - @$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) -r requirements.txt + $(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 pylint-exe: $(PY_ENV) -- cgit v1.2.3 From f32b4fceddf698f6a33c42a866ca21c6cc202841 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 2 Apr 2020 20:27:44 +0200 Subject: LXC: add virtualenv to LXC_BASE_PACKAGES Commit 09a40625 adds virtualenv dependency. BTW remove deprecated --no-site-packages. Not having access to global site-packages is now the default behavior. Signed-off-by: Markus Heiser --- utils/makefile.python | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/makefile.python') diff --git a/utils/makefile.python b/utils/makefile.python index 49944442e..df16acbbf 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -30,7 +30,6 @@ PYLINT_RC ?= .pylintrc TEST_FOLDER ?= ./tests TEST ?= . -VTENV_OPTS = "--no-site-packages" PY_ENV = ./$(LXC_ENV_FOLDER)local/py$(PY) PY_ENV_BIN = $(PY_ENV)/bin PY_ENV_ACT = . $(PY_ENV_BIN)/activate @@ -41,6 +40,7 @@ ifeq ($(OS),Windows_NT) PY_ENV_ACT = $(PY_ENV_BIN)/activate endif +VTENV_OPTS ?= ifeq ($(PYTHON),python) VIRTUALENV = virtualenv else -- cgit v1.2.3