Skip to content

Commit 75f6832

Browse files
committed
Update user guide to change resolver default
In pip 20.3, the new resolver will be the default. Therefore, this commit updates user docs to change instructions for testing, migration, etc. Towards #8937.
1 parent ea74bd3 commit 75f6832

File tree

7 files changed

+83
-69
lines changed

7 files changed

+83
-69
lines changed

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ We release updates regularly, with a new version every 3 months. Find more detai
1919
* `Release notes`_
2020
* `Release process`_
2121

22-
In 2020, we're working on improvements to the heart of pip. Please `learn more and take our survey`_ to help us do it right.
22+
In pip 20.3, we're making a big improvement to the heart of pip. Please `learn more`_ and `take our survey`_ to help us do it right.
2323

2424
If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:
2525

@@ -48,7 +48,8 @@ rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.
4848
.. _Release process: https://pip.pypa.io/en/latest/development/release-process/
4949
.. _GitHub page: https://github.com/pypa/pip
5050
.. _Development documentation: https://pip.pypa.io/en/latest/development
51-
.. _learn more and take our survey: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
51+
.. _learn more: https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020
52+
.. _take our survey: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
5253
.. _Issue tracking: https://github.com/pypa/pip/issues
5354
.. _Discourse channel: https://discuss.python.org/c/packaging
5455
.. _Development mailing list: https://mail.python.org/mailman3/lists/distutils-sig.python.org/

docs/html/development/architecture/anatomy.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ Within ``src/``:
9797

9898
* ``pep425tags.py`` -- getting refactored into packaging.tags (a library on PyPI) which is external to pip (but vendored by pip). :pep:`425` tags: turns out lots of people want this! Compatibility tags for built distributions -> e.g., platform, Python version, etc.
9999
* ``pyproject.py`` -- ``pyproject.toml`` is a new standard (:pep:`518` and :pep:`517`). This file reads pyproject.toml and passes that info elsewhere. The rest of the processing happens in a different file. All the handling for 517 and 518 is in a different file.
100-
* ``req/`` *[*\ **A DIRECTORY THAT NEEDS REFACTORING. A LOT**\ *\ …… Remember Step 3? Dependency resolution etc.? This is that step! Each file represents … have the entire flow of installing & uninstalling, getting info about packages…. Some files here are more than 1,000 lines long! (used to be longer?!) Refactor will deeply improve developer experience.]*
101-
* ``resolve.py`` -- This is where the current dependency resolution algorithm sits. Pradyun is `improving the pip dependency resolver`_. Pradyun will get rid of this file and replace it with a directory called “resolution”. (this work is in git master…. There is further work that is going to be in a branch soon)
100+
* ``req/`` *[*\ **A DIRECTORY THAT NEEDS REFACTORING. A LOT**\ *\ …… Remember Step 3? Dependency resolution etc.? This is that step! Each file represents … have the entire flow of installing & uninstalling, getting info about packages…. Some files here are more than 1,000 lines long! (used to be longer?!) Refactor will deeply improve developer experience. Also, we're `improving the pip dependency resolver`_ in 2020 so a bunch of this is changing.]*
102101
* ``utils/`` *[everything that is not “operationally” pip ….. Misc functions and files get dumped. There’s some organization here. There’s a models.py here which needs refactoring. Deprecation.py is useful, as are other things, but some things do not belong here. There ought to be some GitHub issues for refactoring some things here. Maybe a few issues with checkbox lists.]*
103102
* ``vcs/`` *[stands for Version Control System. Where pip handles all version control stuff -- one of the ``pip install`` arguments you can use is a version control link. Are any of these commands vendored? No, via subprocesses. For performance, it makes sense (we think) to do this instead of pygitlib2 or similar -- and has to be pure Python, can’t include C libraries, because you can’t include compiled C stuff, because you might not have it for the platform you are running on.]*
104103

docs/html/development/architecture/upgrade-options.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ When installing packages, pip chooses a distribution file, and installs it in
66
the user's environment. There are many choices involved in deciding which file
77
to install, and these are controlled by a variety of options.
88

9+
.. note::
10+
11+
This section of the documentation needs to be updated per
12+
:ref:`Resolver changes 2020`.
913

1014
Controlling what gets installed
1115
===============================

docs/html/development/release-process.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ their merits.
6565
``pip._internal.utils.deprecation.deprecated``. The function is not a part of
6666
pip's public API.
6767

68+
.. _`Python 2 Support`:
69+
6870
Python 2 Support
6971
----------------
7072

docs/html/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Please take a look at our documentation for how to install and use pip:
1717
ux_research_design
1818
news
1919

20-
In 2020, we're working on improvements to the heart of pip: :ref:`Resolver changes 2020`. Please `learn more and take our survey`_ to help us do it right, and `join our user experience surveys pool`_.
20+
In pip 20.3, we're making a big improvement to the heart of pip: :ref:`Resolver changes 2020`. Please `learn more and take our survey`_ to help us do it right, and `join our user experience surveys pool`_.
2121

2222
If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:
2323

docs/html/user_guide.rst

Lines changed: 71 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,18 @@ In practice, there are 4 common uses of Requirements files:
197197
py -m pip freeze > requirements.txt
198198
py -m pip install -r requirements.txt
199199
200-
2. Requirements files are used to force pip to properly resolve dependencies.
201-
As it is now, pip `doesn't have true dependency resolution
202-
<https://github.com/pypa/pip/issues/988>`_, but instead simply uses the first
203-
specification it finds for a project. E.g. if ``pkg1`` requires
204-
``pkg3>=1.0`` and ``pkg2`` requires ``pkg3>=1.0,<=2.0``, and if ``pkg1`` is
205-
resolved first, pip will only use ``pkg3>=1.0``, and could easily end up
206-
installing a version of ``pkg3`` that conflicts with the needs of ``pkg2``.
207-
To solve this problem, you can place ``pkg3>=1.0,<=2.0`` (i.e. the correct
208-
specification) into your requirements file directly along with the other top
209-
level requirements. Like so::
200+
2. Requirements files are used to force pip to properly resolve
201+
dependencies. In versions of pip prior to 20.3, pip `doesn't have
202+
true dependency resolution
203+
<https://github.com/pypa/pip/issues/988>`_, but instead simply uses
204+
the first specification it finds for a project. E.g. if ``pkg1``
205+
requires ``pkg3>=1.0`` and ``pkg2`` requires ``pkg3>=1.0,<=2.0``,
206+
and if ``pkg1`` is resolved first, pip will only use ``pkg3>=1.0``,
207+
and could easily end up installing a version of ``pkg3`` that
208+
conflicts with the needs of ``pkg2``. To solve this problem for
209+
pip 20.2 and previous, you can place ``pkg3>=1.0,<=2.0`` (i.e. the
210+
correct specification) into your requirements file directly along
211+
with the other top level requirements. Like so::
210212

211213
pkg1
212214
pkg2
@@ -1095,6 +1097,8 @@ archives are built with identical packages.
10951097
to use such a package, see :ref:`Controlling
10961098
setup_requires<controlling-setup-requires>`.
10971099

1100+
.. _`Fixing conflicting dependencies`:
1101+
10981102
Fixing conflicting dependencies
10991103
===============================
11001104

@@ -1103,8 +1107,10 @@ pip users who encounter an error where pip cannot install their
11031107
specified packages due to conflicting dependencies (a
11041108
``ResolutionImpossible`` error).
11051109

1106-
This documentation is specific to the new resolver, which you can use
1107-
with the flag ``--use-feature=2020-resolver``.
1110+
This documentation is specific to the new resolver, which is the
1111+
default behavior in pip 20.3 and later. If you are using pip 20.2, you
1112+
can invoke the new resolver by using the flag
1113+
``--use-feature=2020-resolver``.
11081114

11091115
Understanding your error message
11101116
--------------------------------
@@ -1376,17 +1382,20 @@ of ability. Some examples that you could consider include:
13761382

13771383
.. _`Resolver changes 2020`:
13781384

1379-
Changes to the pip dependency resolver in 20.2 (2020)
1385+
Changes to the pip dependency resolver in 20.3 (2020)
13801386
=====================================================
13811387

1382-
pip 20.1 included an alpha version of the new resolver (hidden behind
1383-
an optional ``--unstable-feature=resolver`` flag). pip 20.2 removes
1384-
that flag, and includes a robust beta of the new resolver (hidden
1385-
behind an optional ``--use-feature=2020-resolver`` flag) that we
1386-
encourage you to test. We will continue to improve the pip dependency
1387-
resolver in response to testers' feedback. Please give us feedback
1388-
through the `resolver testing survey`_. This will help us prepare to
1389-
release pip 20.3, with the new resolver on by default, in October.
1388+
pip 20.3 has a new dependency resolver, on by default. (pip 20.1 and
1389+
20.2 included pre-release versions of the new dependency resolver,
1390+
hidden behind optional user flags.) Read below for a migration guide,
1391+
how to invoke the legacy resolver, and the deprecation timeline. We
1392+
also made a `two-minute video explanation`_ you can watch.
1393+
1394+
We will continue to improve the pip dependency resolver in response to
1395+
testers' feedback. Please give us feedback through the `resolver
1396+
testing survey`_.
1397+
1398+
.. _`Migration guide for 2020 resolver changes`:
13901399

13911400
Watch out for
13921401
-------------
@@ -1442,28 +1451,20 @@ We are also changing our support for :ref:`Constraints Files`:
14421451
* Constraints cannot have extras (see :issue:`6628`)
14431452

14441453

1445-
How to test
1446-
-----------
1454+
How to upgrade and migrate
1455+
--------------------------
14471456

1448-
1. **Install pip 20.2** with ``python -m pip install --upgrade pip``.
1457+
1. **Install pip 20.3** with ``python -m pip install --upgrade pip``.
14491458

14501459
2. **Validate your current environment** by running ``pip check``. This
14511460
will report if you have any inconsistencies in your set of installed
14521461
packages. Having a clean installation will make it much less likely
1453-
that you will hit issues when the new resolver is released (and may
1462+
that you will hit issues with the new resolver (and may
14541463
address hidden problems in your current environment!). If you run
14551464
``pip check`` and run into stuff you can’t figure out, please `ask
14561465
for help in our issue tracker or chat <https://pip.pypa.io/>`__.
14571466

1458-
3. **Test the new version of pip** (see below). To test the new
1459-
resolver, use the ``--use-feature=2020-resolver`` flag, as in:
1460-
1461-
``pip install example --use-feature=2020-resolver``
1462-
1463-
The more feedback we can get, the more we can make sure that the
1464-
final release is solid. (Only try the new resolver **in a
1465-
non-production environment**, though - it isn't ready for you to
1466-
rely on in production!)
1467+
3. **Test the new version of pip**.
14671468

14681469
While we have tried to make sure that pip’s test suite covers as
14691470
many cases as we can, we are very aware that there are people using
@@ -1478,45 +1479,45 @@ How to test
14781479
- using ``pip install --force-reinstall`` to check whether
14791480
it does what you think it should
14801481
- using constraints files
1482+
- the "Setups to test with special attention" and "Examples to try" below
14811483

14821484
- If you have a build pipeline that depends on pip installing your
14831485
dependencies for you, check that the new resolver does what you
14841486
need.
14851487

1486-
- If you'd like pip to default to using the new resolver, run ``pip
1487-
config set global.use-feature 2020-resolver`` (for more on that
1488-
and the alternate ``PIP_USE_FEATURE`` environment variable
1489-
option, see `issue 8661`_).
1490-
14911488
- Run your project’s CI (test suite, build process, etc.) using the
14921489
new resolver, and let us know of any issues.
14931490
- If you have encountered resolver issues with pip in the past,
1494-
check whether the new resolver fixes them. Also, let us know if
1495-
the new resolver has issues with any workarounds you put in to
1496-
address the current resolver’s limitations. We’ll need to ensure
1497-
that people can transition off such workarounds smoothly.
1491+
check whether the new resolver fixes them, and read :ref:`Fixing
1492+
conflicting dependencies`. Also, let us know if the new resolver
1493+
has issues with any workarounds you put in to address the
1494+
current resolver’s limitations. We’ll need to ensure that people
1495+
can transition off such workarounds smoothly.
14981496
- If you develop or support a tool that wraps pip or uses it to
14991497
deliver part of your functionality, please test your integration
1500-
with pip 20.2.
1498+
with pip 20.3.
15011499

1502-
4. **Please report bugs** through the `resolver testing survey`_.
1500+
4. **Temporarily use the old resolver when necessary.** If you run
1501+
into resolution errors and need a workaround while you're fixing
1502+
their root causes, you can choose the old resolver behavior
1503+
using the flag ``--use-deprecated=legacy-resolver``.
15031504

1504-
Setups we might need more testing on
1505-
------------------------------------
1505+
Per our :ref:`Python 2 Support` policy, pip 20.3 users who are
1506+
using Python 2 and who have trouble with the new resolver can
1507+
choose to switch to the old resolver behavior using the flag
1508+
``--use-deprecated=legacy-resolver``. Python 2 users should
1509+
upgrade to Python 3 as soon as possible, since in pip 21.0 in
1510+
January 2021, pip will drop support for Python 2 altogether.
15061511

1507-
* Windows, including Windows Subsystem for Linux (WSL)
1512+
5. **Please report bugs** through the `resolver testing survey`_.
15081513

1509-
* Macintosh
15101514

1511-
* Debian, Fedora, Red Hat, CentOS, Mint, Arch, Raspbian, Gentoo
1512-
1513-
* non-Latin localized filesystems and OSes, such as Japanese, Chinese, and Korean, and right-to-left such as Hebrew, Urdu, and Arabic
1514-
1515-
* Multi-user installations
1515+
Setups to test with special attention
1516+
-------------------------------------
15161517

15171518
* Requirements files with 100+ packages
15181519

1519-
* An installation workflow that involves multiple requirements files
1520+
* Installation workflows that involve multiple requirements files
15201521

15211522
* Requirements files that include hashes (:ref:`hash-checking mode`)
15221523
or pinned dependencies (perhaps as output from ``pip-compile`` within
@@ -1530,12 +1531,6 @@ Setups we might need more testing on
15301531

15311532
* Installing from source code held in local directories
15321533

1533-
* Using the most recent versions of Python 3.6, 3.7, 3.8, and 3.9
1534-
1535-
* PyPy
1536-
1537-
* Customized terminals (where you have modified how error messages and standard output display)
1538-
15391534
Examples to try
15401535
^^^^^^^^^^^^^^^
15411536

@@ -1580,15 +1575,26 @@ Specific things we'd love to get feedback on:
15801575

15811576
Please let us know through the `resolver testing survey`_.
15821577

1578+
.. _`Deprecation timeline for 2020 resolver changes`:
1579+
15831580
Deprecation timeline
15841581
--------------------
15851582

15861583
We plan for the resolver changeover to proceed as follows, using
15871584
:ref:`Feature Flags` and following our :ref:`Release Cadence`:
15881585

1589-
* pip 20.2: a beta of the new resolver is available, opt-in, using
1590-
the flag ``--use-feature=2020-resolver``. pip defaults to
1591-
legacy behavior.
1586+
* pip 20.1: an alpha version of the new resolver was available,
1587+
opt-in, using the optional flag
1588+
``--unstable-feature=resolver``. pip defaulted to legacy
1589+
behavior.
1590+
1591+
* pip 20.2: a beta of the new resolver was available, opt-in, using
1592+
the flag ``--use-feature=2020-resolver``. pip defaulted to legacy
1593+
behavior. Users of pip 20.2 who want pip to default to using the
1594+
new resolver can run ``pip config set global.use-feature
1595+
2020-resolver`` (for more on that and the alternate
1596+
``PIP_USE_FEATURE`` environment variable option, see `issue
1597+
8661`_).
15921598

15931599
* pip 20.3: pip defaults to the new resolver, but a user can opt-out
15941600
and choose the old resolver behavior, using the flag
@@ -1616,6 +1622,7 @@ announcements on the `low-traffic packaging announcements list`_ and
16161622
.. _resolver testing survey: https://tools.simplysecure.org/survey/index.php?r=survey/index&sid=989272&lang=en
16171623
.. _issue 8661: https://github.com/pypa/pip/issues/8661
16181624
.. _our announcement on the PSF blog: http://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
1625+
.. _two-minute video explanation: https://www.youtube.com/watch?v=B4GQCBBsuNU
16191626
.. _tensorflow: https://pypi.org/project/tensorflow/
16201627
.. _low-traffic packaging announcements list: https://mail.python.org/mailman3/lists/pypi-announce.python.org/
16211628
.. _our survey on upgrades that create conflicts: https://docs.google.com/forms/d/e/1FAIpQLSeBkbhuIlSofXqCyhi3kGkLmtrpPOEBwr6iJA6SzHdxWKfqdA/viewform

news/9044.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update user docs to reflect new resolver as default in 20.3.

0 commit comments

Comments
 (0)