summaryrefslogtreecommitdiff
path: root/utils/makefile.python
diff options
context:
space:
mode:
Diffstat (limited to 'utils/makefile.python')
-rw-r--r--utils/makefile.python28
1 files changed, 14 insertions, 14 deletions
diff --git a/utils/makefile.python b/utils/makefile.python
index 12e3e1236..5d0837e00 100644
--- a/utils/makefile.python
+++ b/utils/makefile.python
@@ -75,7 +75,9 @@ msg-python-exe:
https://www.python.org or install it from your package\n\
manager. On debian based OS these requirements are\n\
installed by::\n\n\
- sudo -H apt-get install $(PYTHON)\n" | $(FMT)
+ sudo -H add-apt-repository ppa:deadsnakes/ppa\n\
+ sudo -H apt update\n\
+ sudo -H apt-get install $(PYTHON) $(PYTHON)-venv\n"
ifeq ($(shell which $(PYTHON) >/dev/null 2>&1; echo $$?), 1)
python-exe: msg-python-exe
@@ -95,7 +97,13 @@ quiet_cmd_pyinstall = INSTALL $2
# $2 path to folder with setup.py, this uses pip from pyenv (not OS!)
quiet_cmd_pyenvinstall = PYENV install $2
- cmd_pyenvinstall = $(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) install -e $2$(PY_SETUP_EXTRAS)
+ cmd_pyenvinstall = \
+ if ! cat $(PY_ENV)/requirements.sha256 2>/dev/null | sha256sum --check --status 2>/dev/null; then \
+ $(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) install -e $2$(PY_SETUP_EXTRAS) ;\
+ sha256sum requirements*.txt > $(PY_ENV)/requirements.sha256 ;\
+ else \
+ echo "PYENV $2 already installed"; \
+ fi
# Uninstall the package. Since pip does not uninstall the no longer needed
# depencies (something like autoremove) the depencies remain.
@@ -113,13 +121,15 @@ quiet_cmd_virtualenv = PYENV usage: $ source ./$@/bin/activate
cmd_virtualenv = \
if [ ! -d "./$(PY_ENV)" ];then \
$(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 \
echo "PYENV using virtualenv from $2"; \
fi
# $2 path to lint
quiet_cmd_pylint = LINT $@
- cmd_pylint = $(PY_ENV_BIN)/python -m pylint --rcfile $(PYLINT_RC) $2
+ cmd_pylint = $(PY_ENV_BIN)/python -m pylint -j 0 --rcfile $(PYLINT_RC) $2
quiet_cmd_pytest = TEST $@
cmd_pytest = $(PY_ENV_BIN)/python -m tox -vv
@@ -193,8 +203,6 @@ pyclean:
pyenv: $(PY_ENV)
$(PY_ENV): python-exe
$(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
pylint-exe: $(PY_ENV)
@@ -220,16 +228,8 @@ PHONY += pydebug
pydebug: $(PY_ENV)
DEBUG=$(DEBUG) $(PY_ENV_BIN)/pytest $(DEBUG) -v $(TEST_FOLDER)/$(TEST)
-# install / uninstall python objects into virtualenv (PYENV)
-pyenv-install: $(PY_ENV)
- @$(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) install -e .
- @echo "ACTIVATE $(call normpath,$(PY_ENV_ACT)) "
-
-pyenv-uninstall: $(PY_ENV)
- @$(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) uninstall --yes .
-
# runs python interpreter from ./local/py<N>/bin/python
-pyenv-python: pyenv-install
+pyenv-python: pyenvinstall
$(PY_ENV_BIN)/python -i
# With 'dependency_links=' setuptools supports dependencies on packages hosted