Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 809bf854 authored by Markus Heiser's avatar Markus Heiser
Browse files

[perf] pyenvinstall: reinstall only when requirements are change

Create a (PY_ENV)/requirements.sha256 file with sha256 sums of the
./requirements*.txt files and reinstall only if the sha256 sums change.

Suggested-by: @dalf / https://github.com/searx/searx/pull/2418#pullrequestreview-558426579


Signed-off-by: default avatarMarkus Heiser <markus.heiser@darmarit.de>
parent d85012b4
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -95,7 +95,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.