diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2020-12-24 16:25:09 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2020-12-24 16:25:09 +0100 |
commit | 809bf85426812ece19bf1f19dff63a13d85099d6 (patch) | |
tree | 6e1a7ccf9adc1a83fb50537879f584c9ff4ae55d /utils | |
parent | d85012b49b1d251cebb63ec1326bb946d0b5f6b8 (diff) | |
download | searxng-809bf85426812ece19bf1f19dff63a13d85099d6.tar.gz searxng-809bf85426812ece19bf1f19dff63a13d85099d6.zip |
[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: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/makefile.python | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/makefile.python b/utils/makefile.python index 0ae912b5e..eab9b20e5 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -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. |