@@ -469,35 +469,33 @@ Then, to install from local only, you'll be using :ref:`--find-links
469469$ pip install --no-index --find-links=DIR -r requirements.txt
470470
471471
472- "Only if needed" Recursive Upgrade
473- **********************************
472+ Upgrade Behaviour
473+ *****************
474474
475- ``pip install --upgrade `` is currently written to perform an eager recursive
476- upgrade, i.e. it upgrades all dependencies regardless of whether they still
477- satisfy the new parent requirements.
475+ ``pip install `` is currently performs a non- eager recursive upgrade, i.e.
476+ it upgrades dependencies only when they no longer satisfy the new parent
477+ requirements.
478478
479- E.g. supposing :
479+ As an example, consider this scenario :
480480
481+ * Only `SomePackage-1.0 ` and `AnotherPackage-1.0 ` are currently installed
482+ * `SomePackage-2.0 `, `AnotherPackage-2.0 ` are the latest versions available on PyPI.
481483* `SomePackage-1.0 ` requires `AnotherPackage>=1.0 `
482484* `SomePackage-2.0 ` requires `AnotherPackage>=1.0 ` and `OneMorePackage==1.0 `
483- * `SomePackage-1.0 ` and `AnotherPackage-1.0 ` are currently installed
484- * `SomePackage-2.0 ` and `AnotherPackage-2.0 ` are the latest versions available on PyPI.
485-
486- Running ``pip install --upgrade SomePackage `` would upgrade `SomePackage ` *and *
487- `AnotherPackage ` despite `AnotherPackage ` already being satisfied.
488485
489- pip doesn't currently have an option to do an "only if needed" recursive
490- upgrade, but you can achieve it using these 2 steps::
486+ Running ``pip install SomePackage `` would:
487+ * install `OneMorePackage-1.0 ` and `SomePackage-2.0 `
488+ * do not install/upgrade `AnotherPackage ` as it satisfies existing requirements
491489
492- pip install --upgrade --no-deps SomePackage
493- pip install SomePackage
490+ pip doesn't currently have an option to do an upgrade package(s) and
491+ dependencies to latest version. This can currently only be achieved by
492+ explicitly listing all the dependencies of the package(s) as command line
493+ arguments or in a requirements file.
494494
495- The first line will upgrade `SomePackage `, but not dependencies like
496- `AnotherPackage `. The 2nd line will fill in new dependencies like
497- `OneMorePackage `.
498-
499- See :issue: `59 ` for a plan of making "only if needed" recursive the default
500- behavior for a new ``pip upgrade `` command.
495+ See :issue: `59 ` for discussion related to this behaviour. An ``upgrade-all ``
496+ command has been proposed, with the intent of using it in virtual environments
497+ as an alternative to the earlier behaviour (before pip 9.0) of eager upgrading,
498+ upgrading dependencies to the latest version.
501499
502500
503501User Installs
@@ -565,21 +563,13 @@ From within a real python, where ``SomePackage`` *is* installed globally, but is
565563
566564 $ pip install --user SomePackage
567565 [...]
568- Requirement already satisfied (use --upgrade to upgrade)
569-
570- $ pip install --user --upgrade SomePackage
571- [...]
572566 Successfully installed SomePackage
573567
574568
575569From within a real python, where ``SomePackage `` *is * installed globally, and is the latest version::
576570
577571 $ pip install --user SomePackage
578572 [...]
579- Requirement already satisfied (use --upgrade to upgrade)
580-
581- $ pip install --user --upgrade SomePackage
582- [...]
583573 Requirement already up-to-date: SomePackage
584574
585575 # force the install
@@ -657,7 +647,7 @@ You can then install from the archive like this::
657647
658648 $ tempdir=$(mktemp -d /tmp/wheelhouse-XXXXX)
659649 $ (cd $tempdir; tar -xvf /path/to/bundled.tar.bz2)
660- $ pip install --force-reinstall --ignore-installed --upgrade -- no-index --no-deps $tempdir/*
650+ $ pip install --force-reinstall --ignore-installed --no-index --no-deps $tempdir/*
661651
662652Note that compiled packages are typically OS- and architecture-specific, so
663653these archives are not necessarily portable across machines.
0 commit comments