Skip to content

Commit 1bcebab

Browse files
authored
Merge pull request #9044 from brainwane/docs-change-resolver-default
2 parents 92f9e77 + 7657c44 commit 1bcebab

File tree

7 files changed

+87
-72
lines changed

7 files changed

+87
-72
lines changed

README.rst

+4-2
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`_; `learn more`_. We want your input, so `sign up for our user experience research studies`_ 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,9 @@ 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+
.. _making a big improvement to the heart of pip: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
52+
.. _learn more: https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020
53+
.. _sign up for our user experience research studies: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
5254
.. _Issue tracking: https://github.com/pypa/pip/issues
5355
.. _Discourse channel: https://discuss.python.org/c/packaging
5456
.. _Development mailing list: https://mail.python.org/mailman3/lists/distutils-sig.python.org/

docs/html/development/architecture/anatomy.rst

+1-2
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

+4
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

+2
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

+3-3
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`. We want your input, so `sign up for our user experience research studies`_ to help us do it right.
2121

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

@@ -40,8 +40,8 @@ rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.
4040

4141
.. _package installer: https://packaging.python.org/guides/tool-recommendations/
4242
.. _Python Package Index: https://pypi.org
43-
.. _join our user experience surveys pool: ux_research_design
44-
.. _learn more and take our survey: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
43+
.. _making a big improvement to the heart of pip: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
44+
.. _sign up for our user experience research studies: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
4545
.. _Installation: https://pip.pypa.io/en/stable/installing.html
4646
.. _Documentation: https://pip.pypa.io/en/stable/
4747
.. _Changelog: https://pip.pypa.io/en/stable/news.html

docs/html/user_guide.rst

+72-65
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
--------------------------------
@@ -1374,19 +1380,24 @@ of ability. Some examples that you could consider include:
13741380
* ``distlib`` - Packaging and distribution utilities (including functions for
13751381
interacting with PyPI).
13761382

1383+
.. _changes-to-the-pip-dependency-resolver-in-20-2-2020:
1384+
13771385
.. _`Resolver changes 2020`:
13781386

1379-
Changes to the pip dependency resolver in 20.2 (2020)
1387+
Changes to the pip dependency resolver in 20.3 (2020)
13801388
=====================================================
13811389

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.
1390+
pip 20.3 has a new dependency resolver, on by default. (pip 20.1 and
1391+
20.2 included pre-release versions of the new dependency resolver,
1392+
hidden behind optional user flags.) Read below for a migration guide,
1393+
how to invoke the legacy resolver, and the deprecation timeline. We
1394+
also made a `two-minute video explanation`_ you can watch.
1395+
1396+
We will continue to improve the pip dependency resolver in response to
1397+
testers' feedback. Please give us feedback through the `resolver
1398+
testing survey`_.
1399+
1400+
.. _`Migration guide for 2020 resolver changes`:
13901401

13911402
Watch out for
13921403
-------------
@@ -1441,29 +1452,26 @@ We are also changing our support for :ref:`Constraints Files`:
14411452
* Links are not allowed as constraints (see :issue:`8253`)
14421453
* Constraints cannot have extras (see :issue:`6628`)
14431454

1455+
Per our :ref:`Python 2 Support` policy, pip 20.3 users who are using
1456+
Python 2 will use the legacy resolver by default. Python 2 users
1457+
should upgrade to Python 3 as soon as possible, since in pip 21.0 in
1458+
January 2021, pip will drop support for Python 2 altogether.
14441459

1445-
How to test
1446-
-----------
14471460

1448-
1. **Install pip 20.2** with ``python -m pip install --upgrade pip``.
1461+
How to upgrade and migrate
1462+
--------------------------
1463+
1464+
1. **Install pip 20.3** with ``python -m pip install --upgrade pip``.
14491465

14501466
2. **Validate your current environment** by running ``pip check``. This
14511467
will report if you have any inconsistencies in your set of installed
14521468
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
1469+
that you will hit issues with the new resolver (and may
14541470
address hidden problems in your current environment!). If you run
14551471
``pip check`` and run into stuff you can’t figure out, please `ask
14561472
for help in our issue tracker or chat <https://pip.pypa.io/>`__.
14571473

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!)
1474+
3. **Test the new version of pip**.
14671475

14681476
While we have tried to make sure that pip’s test suite covers as
14691477
many cases as we can, we are very aware that there are people using
@@ -1478,45 +1486,38 @@ How to test
14781486
- using ``pip install --force-reinstall`` to check whether
14791487
it does what you think it should
14801488
- using constraints files
1489+
- the "Setups to test with special attention" and "Examples to try" below
14811490

14821491
- If you have a build pipeline that depends on pip installing your
14831492
dependencies for you, check that the new resolver does what you
14841493
need.
14851494

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-
14911495
- Run your project’s CI (test suite, build process, etc.) using the
14921496
new resolver, and let us know of any issues.
14931497
- 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.
1498+
check whether the new resolver fixes them, and read :ref:`Fixing
1499+
conflicting dependencies`. Also, let us know if the new resolver
1500+
has issues with any workarounds you put in to address the
1501+
current resolver’s limitations. We’ll need to ensure that people
1502+
can transition off such workarounds smoothly.
14981503
- If you develop or support a tool that wraps pip or uses it to
14991504
deliver part of your functionality, please test your integration
1500-
with pip 20.2.
1505+
with pip 20.3.
15011506

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

1504-
Setups we might need more testing on
1505-
------------------------------------
1512+
5. **Please report bugs** through the `resolver testing survey`_.
15061513

1507-
* Windows, including Windows Subsystem for Linux (WSL)
15081514

1509-
* Macintosh
1510-
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

+1
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)