Skip to content

Commit 88417b4

Browse files
committed
Merge branch 'main' into release/21.2.3
2 parents 10d7320 + 0b95378 commit 88417b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1048
-942
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
tests:
3131
# Anything that's touching testable stuff
3232
- ".github/workflows/ci.yml"
33-
- "tools/requirements/tests.txt"
3433
- "src/**"
3534
- "tests/**"
3635
if: github.event_name == 'pull_request'

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ repos:
2222
- id: black
2323
exclude: |
2424
(?x)
25-
^src/pip/_internal/commands|
2625
^src/pip/_internal/index|
2726
^src/pip/_internal/models|
2827
^src/pip/_internal/operations|
29-
^src/pip/_internal/req|
3028
^src/pip/_internal/vcs|
3129
^src/pip/_internal/\w+\.py$|
3230
# Tests

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ sphinx:
77
python:
88
version: 3.8
99
install:
10-
- requirements: tools/requirements/docs.txt
10+
- requirements: docs/requirements.txt

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ recursive-include src/pip/_vendor *LICENSE*
1010
recursive-include src/pip/_vendor *COPYING*
1111

1212
include docs/docutils.conf
13+
include docs/requirements.txt
1314

1415
exclude .coveragerc
1516
exclude .mailmap

docs/html/cli/pip.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ verbosity log will be kept. This option is empty by default. This log appends
4747
to previous logging.
4848

4949
Like all pip options, ``--log`` can also be set as an environment variable, or
50-
placed into the pip config file. See the :ref:`Configuration` section.
50+
placed into the pip config file. See the :doc:`topics/configuration` section.
5151

5252
.. _`exists-action`:
5353

docs/html/development/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
Configuration
55
=============
66

7-
This content is now covered in the :ref:`Configuration` section of the :doc:`User Guide </user_guide>`.
7+
This content is now covered in the :doc:`topics/configuration` section of the :doc:`User Guide </user_guide>`.

tools/requirements/docs.txt renamed to docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sphinx == 3.2.1
1+
sphinx ~= 4.1.0
22
towncrier
33
furo
44
myst_parser

news/10128.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve deprecation warning regarding the copying of source trees when installing from a local directory.

news/10165.trivial.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Add a ``feature_flag`` optional kwarg to the ``deprecated()`` function
2+
``pip._internal.utils.deprecation:deprecated``. Also formulate a corresponding canned
3+
message which suggests using the ``--use-feature={feature_flag}`` to test upcoming
4+
behavior.

news/10233.bugfix.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
New resolver: When a package is specified with extras in constraints, and with
2+
extras in non-constraint requirements, the resolver now correctly identifies the
3+
constraint's existence and avoids backtracking.

news/10252.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Modify the ``sysconfig.get_preferred_scheme`` function check to be
2+
compatible with CPython 3.10’s alphareleases.

news/2A2E5A1E-F014-40E9-B0EF-0D9C4686358F.trivial.rst

Whitespace-only changes.

news/51d70b65-78e9-426c-80a6-47efcaad9628.trivial.rst

Whitespace-only changes.

noxfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"protected-pip": "tools/tox_pip.py",
2525
}
2626
REQUIREMENTS = {
27-
"docs": "tools/requirements/docs.txt",
28-
"tests": "tools/requirements/tests.txt",
29-
"common-wheels": "tools/requirements/tests-common_wheels.txt",
27+
"docs": "docs/requirements.txt",
28+
"tests": "tests/requirements.txt",
29+
"common-wheels": "tests/requirements-common_wheels.txt",
3030
}
3131

3232
AUTHORS_FILE = "AUTHORS.txt"

src/pip/_internal/commands/__init__.py

Lines changed: 89 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -3,87 +3,102 @@
33
"""
44

55
import importlib
6-
from collections import OrderedDict, namedtuple
6+
from collections import namedtuple
77
from typing import Any, Dict, Optional
88

99
from pip._internal.cli.base_command import Command
1010

11-
CommandInfo = namedtuple('CommandInfo', 'module_path, class_name, summary')
11+
CommandInfo = namedtuple("CommandInfo", "module_path, class_name, summary")
1212

13-
# The ordering matters for help display.
14-
# Also, even though the module path starts with the same
15-
# "pip._internal.commands" prefix in each case, we include the full path
16-
# because it makes testing easier (specifically when modifying commands_dict
17-
# in test setup / teardown by adding info for a FakeCommand class defined
18-
# in a test-related module).
19-
# Finally, we need to pass an iterable of pairs here rather than a dict
20-
# so that the ordering won't be lost when using Python 2.7.
21-
commands_dict: Dict[str, CommandInfo] = OrderedDict([
22-
('install', CommandInfo(
23-
'pip._internal.commands.install', 'InstallCommand',
24-
'Install packages.',
25-
)),
26-
('download', CommandInfo(
27-
'pip._internal.commands.download', 'DownloadCommand',
28-
'Download packages.',
29-
)),
30-
('uninstall', CommandInfo(
31-
'pip._internal.commands.uninstall', 'UninstallCommand',
32-
'Uninstall packages.',
33-
)),
34-
('freeze', CommandInfo(
35-
'pip._internal.commands.freeze', 'FreezeCommand',
36-
'Output installed packages in requirements format.',
37-
)),
38-
('list', CommandInfo(
39-
'pip._internal.commands.list', 'ListCommand',
40-
'List installed packages.',
41-
)),
42-
('show', CommandInfo(
43-
'pip._internal.commands.show', 'ShowCommand',
44-
'Show information about installed packages.',
45-
)),
46-
('check', CommandInfo(
47-
'pip._internal.commands.check', 'CheckCommand',
48-
'Verify installed packages have compatible dependencies.',
49-
)),
50-
('config', CommandInfo(
51-
'pip._internal.commands.configuration', 'ConfigurationCommand',
52-
'Manage local and global configuration.',
53-
)),
54-
('search', CommandInfo(
55-
'pip._internal.commands.search', 'SearchCommand',
56-
'Search PyPI for packages.',
57-
)),
58-
('cache', CommandInfo(
59-
'pip._internal.commands.cache', 'CacheCommand',
13+
# This dictionary does a bunch of heavy lifting for help output:
14+
# - Enables avoiding additional (costly) imports for presenting `--help`.
15+
# - The ordering matters for help display.
16+
#
17+
# Even though the module path starts with the same "pip._internal.commands"
18+
# prefix, the full path makes testing easier (specifically when modifying
19+
# `commands_dict` in test setup / teardown).
20+
commands_dict: Dict[str, CommandInfo] = {
21+
"install": CommandInfo(
22+
"pip._internal.commands.install",
23+
"InstallCommand",
24+
"Install packages.",
25+
),
26+
"download": CommandInfo(
27+
"pip._internal.commands.download",
28+
"DownloadCommand",
29+
"Download packages.",
30+
),
31+
"uninstall": CommandInfo(
32+
"pip._internal.commands.uninstall",
33+
"UninstallCommand",
34+
"Uninstall packages.",
35+
),
36+
"freeze": CommandInfo(
37+
"pip._internal.commands.freeze",
38+
"FreezeCommand",
39+
"Output installed packages in requirements format.",
40+
),
41+
"list": CommandInfo(
42+
"pip._internal.commands.list",
43+
"ListCommand",
44+
"List installed packages.",
45+
),
46+
"show": CommandInfo(
47+
"pip._internal.commands.show",
48+
"ShowCommand",
49+
"Show information about installed packages.",
50+
),
51+
"check": CommandInfo(
52+
"pip._internal.commands.check",
53+
"CheckCommand",
54+
"Verify installed packages have compatible dependencies.",
55+
),
56+
"config": CommandInfo(
57+
"pip._internal.commands.configuration",
58+
"ConfigurationCommand",
59+
"Manage local and global configuration.",
60+
),
61+
"search": CommandInfo(
62+
"pip._internal.commands.search",
63+
"SearchCommand",
64+
"Search PyPI for packages.",
65+
),
66+
"cache": CommandInfo(
67+
"pip._internal.commands.cache",
68+
"CacheCommand",
6069
"Inspect and manage pip's wheel cache.",
61-
)),
62-
('index', CommandInfo(
63-
'pip._internal.commands.index', 'IndexCommand',
70+
),
71+
"index": CommandInfo(
72+
"pip._internal.commands.index",
73+
"IndexCommand",
6474
"Inspect information available from package indexes.",
65-
)),
66-
('wheel', CommandInfo(
67-
'pip._internal.commands.wheel', 'WheelCommand',
68-
'Build wheels from your requirements.',
69-
)),
70-
('hash', CommandInfo(
71-
'pip._internal.commands.hash', 'HashCommand',
72-
'Compute hashes of package archives.',
73-
)),
74-
('completion', CommandInfo(
75-
'pip._internal.commands.completion', 'CompletionCommand',
76-
'A helper command used for command completion.',
77-
)),
78-
('debug', CommandInfo(
79-
'pip._internal.commands.debug', 'DebugCommand',
80-
'Show information useful for debugging.',
81-
)),
82-
('help', CommandInfo(
83-
'pip._internal.commands.help', 'HelpCommand',
84-
'Show help for commands.',
85-
)),
86-
])
75+
),
76+
"wheel": CommandInfo(
77+
"pip._internal.commands.wheel",
78+
"WheelCommand",
79+
"Build wheels from your requirements.",
80+
),
81+
"hash": CommandInfo(
82+
"pip._internal.commands.hash",
83+
"HashCommand",
84+
"Compute hashes of package archives.",
85+
),
86+
"completion": CommandInfo(
87+
"pip._internal.commands.completion",
88+
"CompletionCommand",
89+
"A helper command used for command completion.",
90+
),
91+
"debug": CommandInfo(
92+
"pip._internal.commands.debug",
93+
"DebugCommand",
94+
"Show information useful for debugging.",
95+
),
96+
"help": CommandInfo(
97+
"pip._internal.commands.help",
98+
"HelpCommand",
99+
"Show help for commands.",
100+
),
101+
}
87102

88103

89104
def create_command(name: str, **kwargs: Any) -> Command:

0 commit comments

Comments
 (0)