From 375ed4d3fcf2679dfcd011c3441caa05e5b5c94a Mon Sep 17 00:00:00 2001 From: "Pradyun S. Gedam" Date: Fri, 19 May 2017 17:09:48 +0530 Subject: [PATCH 1/2] Switch default upgrade strategy to only-if-needed --- docs/user_guide.rst | 6 +++--- pip/commands/install.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/user_guide.rst b/docs/user_guide.rst index 6d5d9a1e355..daff8a3e2d6 100644 --- a/docs/user_guide.rst +++ b/docs/user_guide.rst @@ -486,9 +486,9 @@ strategies supported: the new parent requirements - ``only-if-needed``: upgrades a dependency only if it does not satisfy the new parent requirements - -Currently, the default strategy is ``eager``, which was the strategy prior to -the ``--upgrade-strategy`` option being added. + +The default strategy is ``only-if-needed``. This was changed in pip 10.0 due to +the breaking nature of ``eager`` when upgrading conflicting dependencies. As an historic note, an earlier "fix" for getting the ``only-if-needed`` behaviour was:: diff --git a/pip/commands/install.py b/pip/commands/install.py index 433400f0ff2..ac0e88a03eb 100644 --- a/pip/commands/install.py +++ b/pip/commands/install.py @@ -110,7 +110,7 @@ def __init__(self, *args, **kw): cmd_opts.add_option( '--upgrade-strategy', dest='upgrade_strategy', - default='eager', + default='only-if-needed', choices=['only-if-needed', 'eager'], help='Determines how dependency upgrading should be handled ' '(default: %(default)s). ' From 053218b991271d0d9e77dd56a85965bf21e33e40 Mon Sep 17 00:00:00 2001 From: "Pradyun S. Gedam" Date: Fri, 19 May 2017 19:40:59 +0530 Subject: [PATCH 2/2] :newspaper: --- news/4500.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/4500.feature diff --git a/news/4500.feature b/news/4500.feature new file mode 100644 index 00000000000..5157c0fa87c --- /dev/null +++ b/news/4500.feature @@ -0,0 +1 @@ +Switch the default upgrade strategy to be 'only-if-needed'