diff --git a/defaults/main.yml b/defaults/main.yml index 8f41a49..c8b6e26 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -70,6 +70,7 @@ pip_timeout: 120 # Options for pip install pip_upgrade: true +pip_upgrade_strategy: "only-if-needed" # Default index for pip to use pip_default_index: https://pypi.python.org/simple diff --git a/releasenotes/notes/pip-control-upgrade-strategy-2807e228d529c389.yaml b/releasenotes/notes/pip-control-upgrade-strategy-2807e228d529c389.yaml new file mode 100644 index 0000000..c34d1e5 --- /dev/null +++ b/releasenotes/notes/pip-control-upgrade-strategy-2807e228d529c389.yaml @@ -0,0 +1,15 @@ +--- +features: + - | + The PIP upgrade strategy can now be controlled using the new + ``pip_install_strategy`` variable which can either be ``eager`` + if the deployers want to upgrade both the package and its dependencies or + ``only-if-needed`` if they want to only upgrade what's really necessary. + More information can be found on the `PIP user guide + `_ +upgrade: + - | + The default PIP stategy has been changed to ``only-of-needed`` in order to + minimize the amount of packages which are updated during installation. + Deployers can still override the default option using the ``pip_install_strategy`` + variable. diff --git a/templates/pip.conf.j2 b/templates/pip.conf.j2 index 30054ab..9b94138 100644 --- a/templates/pip.conf.j2 +++ b/templates/pip.conf.j2 @@ -14,6 +14,7 @@ trusted-host = [install] upgrade = {{ pip_upgrade }} +upgrade-strategy = {{ pip_upgrade_strategy }} pre = {{ pip_enable_pre_releases }} {% if pip_links | length > 0 %} find-links =