Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blacken the codebase #8903

Closed
wants to merge 238 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
238 commits
Select commit Hold shift + click to select a range
a00f85d
Prepare flake8 for black
pradyunsg Sep 23, 2020
58c594c
Prepare isort for black
pradyunsg Sep 23, 2020
be189c5
Add linter: black
pradyunsg Sep 23, 2020
917b41d
Blacken docs/html/conf.py
pradyunsg Sep 23, 2020
ed383dd
Blacken docs/pip_sphinxext.py
pradyunsg Sep 23, 2020
228405e
Blacken noxfile.py
pradyunsg Sep 23, 2020
f477a9f
Blacken setup.py
pradyunsg Sep 23, 2020
e59ba23
Blacken src/pip/__main__.py
pradyunsg Sep 23, 2020
d7013db
Blacken src/pip/_internal/build_env.py
pradyunsg Sep 23, 2020
30e9ffa
Blacken src/pip/_internal/cache.py
pradyunsg Sep 23, 2020
8341d56
Blacken src/pip/_internal/cli/autocompletion.py
pradyunsg Sep 23, 2020
3d3461e
Blacken src/pip/_internal/cli/base_command.py
pradyunsg Sep 23, 2020
d489b0f
Blacken src/pip/_internal/cli/cmdoptions.py
pradyunsg Sep 23, 2020
591fe48
Blacken src/pip/_internal/cli/command_context.py
pradyunsg Sep 23, 2020
9265b28
Blacken src/pip/_internal/cli/main.py
pradyunsg Sep 23, 2020
847a369
Blacken src/pip/_internal/cli/main_parser.py
pradyunsg Sep 23, 2020
ec97119
Blacken src/pip/_internal/cli/parser.py
pradyunsg Sep 23, 2020
6e3b8de
Blacken src/pip/_internal/cli/progress_bars.py
pradyunsg Sep 23, 2020
5540522
Blacken src/pip/_internal/cli/req_command.py
pradyunsg Sep 23, 2020
d5ca5c8
Blacken src/pip/_internal/cli/spinners.py
pradyunsg Sep 23, 2020
9747cb4
Blacken src/pip/_internal/commands/__init__.py
pradyunsg Sep 23, 2020
1c09fd6
Blacken src/pip/_internal/commands/cache.py
pradyunsg Sep 23, 2020
315e93d
Blacken src/pip/_internal/commands/check.py
pradyunsg Sep 23, 2020
8ae3b96
Blacken src/pip/_internal/commands/completion.py
pradyunsg Sep 23, 2020
42ca479
Blacken src/pip/_internal/commands/configuration.py
pradyunsg Sep 23, 2020
790ad78
Blacken src/pip/_internal/commands/debug.py
pradyunsg Sep 23, 2020
a6fcc8f
Blacken src/pip/_internal/commands/download.py
pradyunsg Sep 23, 2020
920e735
Blacken src/pip/_internal/commands/freeze.py
pradyunsg Sep 23, 2020
053004e
Blacken src/pip/_internal/commands/hash.py
pradyunsg Sep 23, 2020
a6b6ae4
Blacken src/pip/_internal/commands/help.py
pradyunsg Sep 23, 2020
5ade8d8
Blacken src/pip/_internal/commands/install.py
pradyunsg Sep 23, 2020
befa6f9
Blacken src/pip/_internal/commands/list.py
pradyunsg Sep 23, 2020
b4f28f8
Blacken src/pip/_internal/commands/search.py
pradyunsg Sep 23, 2020
ef5df9c
Blacken src/pip/_internal/commands/show.py
pradyunsg Sep 23, 2020
eefc7cf
Blacken src/pip/_internal/commands/uninstall.py
pradyunsg Sep 23, 2020
28440e5
Blacken src/pip/_internal/commands/wheel.py
pradyunsg Sep 23, 2020
7122f91
Blacken src/pip/_internal/configuration.py
pradyunsg Sep 23, 2020
959588a
Blacken src/pip/_internal/distributions/__init__.py
pradyunsg Sep 23, 2020
62be315
Blacken src/pip/_internal/distributions/sdist.py
pradyunsg Sep 23, 2020
4b71216
Blacken src/pip/_internal/exceptions.py
pradyunsg Sep 23, 2020
eb65c9f
Blacken src/pip/_internal/index/collector.py
pradyunsg Sep 23, 2020
bba7af7
Blacken src/pip/_internal/index/package_finder.py
pradyunsg Sep 23, 2020
efe13ab
Blacken src/pip/_internal/locations.py
pradyunsg Sep 23, 2020
7c5534e
Blacken src/pip/_internal/models/candidate.py
pradyunsg Sep 23, 2020
9480c49
Blacken src/pip/_internal/models/direct_url.py
pradyunsg Sep 23, 2020
ce76107
Blacken src/pip/_internal/models/format_control.py
pradyunsg Sep 23, 2020
e0f460b
Blacken src/pip/_internal/models/index.py
pradyunsg Sep 23, 2020
3ae834c
Blacken src/pip/_internal/models/link.py
pradyunsg Sep 23, 2020
1220724
Blacken src/pip/_internal/models/scheme.py
pradyunsg Sep 23, 2020
ec73049
Blacken src/pip/_internal/models/search_scope.py
pradyunsg Sep 23, 2020
7abbdcf
Blacken src/pip/_internal/models/selection_prefs.py
pradyunsg Sep 23, 2020
7d77f56
Blacken src/pip/_internal/models/target_python.py
pradyunsg Sep 23, 2020
77e36ff
Blacken src/pip/_internal/models/wheel.py
pradyunsg Sep 23, 2020
dc7ea43
Blacken src/pip/_internal/network/auth.py
pradyunsg Sep 23, 2020
ad3abda
Blacken src/pip/_internal/network/cache.py
pradyunsg Sep 23, 2020
33fcb6f
Blacken src/pip/_internal/network/download.py
pradyunsg Sep 23, 2020
9de7dbb
Blacken src/pip/_internal/network/lazy_wheel.py
pradyunsg Sep 23, 2020
b011e0d
Blacken src/pip/_internal/network/session.py
pradyunsg Sep 23, 2020
ffbc5db
Blacken src/pip/_internal/network/utils.py
pradyunsg Sep 23, 2020
c5762d4
Blacken src/pip/_internal/network/xmlrpc.py
pradyunsg Sep 23, 2020
e1c4046
Blacken src/pip/_internal/operations/build/metadata.py
pradyunsg Sep 23, 2020
eefb3eb
Blacken src/pip/_internal/operations/build/metadata_legacy.py
pradyunsg Sep 23, 2020
8571caf
Blacken src/pip/_internal/operations/build/wheel.py
pradyunsg Sep 23, 2020
4c86c03
Blacken src/pip/_internal/operations/build/wheel_legacy.py
pradyunsg Sep 23, 2020
79b8961
Blacken src/pip/_internal/operations/check.py
pradyunsg Sep 23, 2020
a3140d4
Blacken src/pip/_internal/operations/freeze.py
pradyunsg Sep 23, 2020
1019a24
Blacken src/pip/_internal/operations/install/editable_legacy.py
pradyunsg Sep 23, 2020
7cdd2f5
Blacken src/pip/_internal/operations/install/legacy.py
pradyunsg Sep 23, 2020
7f581b5
Blacken src/pip/_internal/operations/install/wheel.py
pradyunsg Sep 23, 2020
6698646
Blacken src/pip/_internal/operations/prepare.py
pradyunsg Sep 23, 2020
d623f92
Blacken src/pip/_internal/pyproject.py
pradyunsg Sep 23, 2020
99e6629
Blacken src/pip/_internal/req/__init__.py
pradyunsg Sep 23, 2020
df3479c
Blacken src/pip/_internal/req/constructors.py
pradyunsg Sep 23, 2020
fcbdd93
Blacken src/pip/_internal/req/req_file.py
pradyunsg Sep 23, 2020
f8098c2
Blacken src/pip/_internal/req/req_install.py
pradyunsg Sep 23, 2020
058da2d
Blacken src/pip/_internal/req/req_set.py
pradyunsg Sep 23, 2020
ca440bb
Blacken src/pip/_internal/req/req_tracker.py
pradyunsg Sep 23, 2020
0aee7ac
Blacken src/pip/_internal/req/req_uninstall.py
pradyunsg Sep 23, 2020
fcdbb50
Blacken src/pip/_internal/resolution/base.py
pradyunsg Sep 23, 2020
f0d7170
Blacken src/pip/_internal/resolution/legacy/resolver.py
pradyunsg Sep 23, 2020
97b4940
Blacken src/pip/_internal/resolution/resolvelib/candidates.py
pradyunsg Sep 23, 2020
2d74479
Blacken src/pip/_internal/resolution/resolvelib/factory.py
pradyunsg Sep 23, 2020
3e62cf1
Blacken src/pip/_internal/resolution/resolvelib/provider.py
pradyunsg Sep 23, 2020
adaccc2
Blacken src/pip/_internal/resolution/resolvelib/requirements.py
pradyunsg Sep 23, 2020
33ff9a7
Blacken src/pip/_internal/resolution/resolvelib/resolver.py
pradyunsg Sep 23, 2020
a75c63f
Blacken src/pip/_internal/self_outdated_check.py
pradyunsg Sep 23, 2020
965d8de
Blacken src/pip/_internal/utils/appdirs.py
pradyunsg Sep 23, 2020
c1a1c5e
Blacken src/pip/_internal/utils/compat.py
pradyunsg Sep 23, 2020
5fbd85c
Blacken src/pip/_internal/utils/compatibility_tags.py
pradyunsg Sep 23, 2020
ca19cc8
Blacken src/pip/_internal/utils/deprecation.py
pradyunsg Sep 23, 2020
caaebe1
Blacken src/pip/_internal/utils/direct_url_helpers.py
pradyunsg Sep 23, 2020
0bb9253
Blacken src/pip/_internal/utils/encoding.py
pradyunsg Sep 23, 2020
233aa2a
Blacken src/pip/_internal/utils/filesystem.py
pradyunsg Sep 23, 2020
0031d7f
Blacken src/pip/_internal/utils/filetypes.py
pradyunsg Sep 23, 2020
ad6f498
Blacken src/pip/_internal/utils/hashes.py
pradyunsg Sep 23, 2020
ee38e74
Blacken src/pip/_internal/utils/inject_securetransport.py
pradyunsg Sep 23, 2020
fb1ef44
Blacken src/pip/_internal/utils/logging.py
pradyunsg Sep 23, 2020
0815677
Blacken src/pip/_internal/utils/misc.py
pradyunsg Sep 23, 2020
9f49bcf
Blacken src/pip/_internal/utils/models.py
pradyunsg Sep 23, 2020
569e644
Blacken src/pip/_internal/utils/packaging.py
pradyunsg Sep 23, 2020
97429e3
Blacken src/pip/_internal/utils/parallel.py
pradyunsg Sep 23, 2020
af4d93a
Blacken src/pip/_internal/utils/pkg_resources.py
pradyunsg Sep 23, 2020
70083dc
Blacken src/pip/_internal/utils/setuptools_build.py
pradyunsg Sep 23, 2020
6d6a0a6
Blacken src/pip/_internal/utils/subprocess.py
pradyunsg Sep 23, 2020
fd18bf5
Blacken src/pip/_internal/utils/temp_dir.py
pradyunsg Sep 23, 2020
9f82ad4
Blacken src/pip/_internal/utils/unpacking.py
pradyunsg Sep 23, 2020
02529f7
Blacken src/pip/_internal/utils/urls.py
pradyunsg Sep 23, 2020
9b31aa1
Blacken src/pip/_internal/utils/virtualenv.py
pradyunsg Sep 23, 2020
9708bea
Blacken src/pip/_internal/utils/wheel.py
pradyunsg Sep 23, 2020
15eaffd
Blacken src/pip/_internal/vcs/bazaar.py
pradyunsg Sep 23, 2020
84b907e
Blacken src/pip/_internal/vcs/git.py
pradyunsg Sep 23, 2020
1b877d6
Blacken src/pip/_internal/vcs/mercurial.py
pradyunsg Sep 23, 2020
38e03ee
Blacken src/pip/_internal/vcs/subversion.py
pradyunsg Sep 23, 2020
3f4cd00
Blacken src/pip/_internal/vcs/versioncontrol.py
pradyunsg Sep 23, 2020
e6205a3
Blacken src/pip/_internal/wheel_builder.py
pradyunsg Sep 23, 2020
f1d8977
Blacken tests/conftest.py
pradyunsg Sep 23, 2020
01e0a3e
Blacken tests/data/
pradyunsg Sep 23, 2020
86635b1
Blacken tests/functional/test_broken_stdout.py
pradyunsg Sep 23, 2020
5fce173
Blacken tests/functional/test_cache.py
pradyunsg Sep 23, 2020
bebe569
Blacken tests/functional/test_check.py
pradyunsg Sep 23, 2020
5848101
Blacken tests/functional/test_cli.py
pradyunsg Sep 23, 2020
e205135
Blacken tests/functional/test_completion.py
pradyunsg Sep 23, 2020
f512874
Blacken tests/functional/test_configuration.py
pradyunsg Sep 23, 2020
959018f
Blacken tests/functional/test_debug.py
pradyunsg Sep 23, 2020
a9c1ac2
Blacken tests/functional/test_download.py
pradyunsg Sep 23, 2020
f401f1f
Blacken tests/functional/test_fast_deps.py
pradyunsg Sep 23, 2020
362cfcf
Blacken tests/functional/test_freeze.py
pradyunsg Sep 23, 2020
c64919c
Blacken tests/functional/test_hash.py
pradyunsg Sep 23, 2020
485056d
Blacken tests/functional/test_help.py
pradyunsg Sep 23, 2020
7ade3db
Blacken tests/functional/test_install.py
pradyunsg Sep 23, 2020
e893ec2
Blacken tests/functional/test_install_check.py
pradyunsg Sep 23, 2020
94abcd1
Blacken tests/functional/test_install_cleanup.py
pradyunsg Sep 23, 2020
14879c8
Blacken tests/functional/test_install_compat.py
pradyunsg Sep 23, 2020
04e215d
Blacken tests/functional/test_install_config.py
pradyunsg Sep 23, 2020
90df216
Blacken tests/functional/test_install_extras.py
pradyunsg Sep 23, 2020
8d36272
Blacken tests/functional/test_install_force_reinstall.py
pradyunsg Sep 23, 2020
00e2419
Blacken tests/functional/test_install_index.py
pradyunsg Sep 23, 2020
97d8aa7
Blacken tests/functional/test_install_reqs.py
pradyunsg Sep 23, 2020
7832c8b
Blacken tests/functional/test_install_requested.py
pradyunsg Sep 23, 2020
45fc289
Blacken tests/functional/test_install_upgrade.py
pradyunsg Sep 23, 2020
84d35e5
Blacken tests/functional/test_install_user.py
pradyunsg Sep 23, 2020
ecb0bfc
Blacken tests/functional/test_install_vcs_git.py
pradyunsg Sep 23, 2020
4d9e119
Blacken tests/functional/test_install_wheel.py
pradyunsg Sep 23, 2020
46779fe
Blacken tests/functional/test_list.py
pradyunsg Sep 23, 2020
af62427
Blacken tests/functional/test_new_resolver.py
pradyunsg Sep 23, 2020
f9dc56b
Blacken tests/functional/test_new_resolver_errors.py
pradyunsg Sep 23, 2020
43b8766
Blacken tests/functional/test_new_resolver_hashes.py
pradyunsg Sep 23, 2020
2528ab4
Blacken tests/functional/test_new_resolver_target.py
pradyunsg Sep 23, 2020
7ae9a01
Blacken tests/functional/test_new_resolver_user.py
pradyunsg Sep 23, 2020
fb92042
Blacken tests/functional/test_no_color.py
pradyunsg Sep 23, 2020
284e3d3
Blacken tests/functional/test_pep517.py
pradyunsg Sep 23, 2020
251254f
Blacken tests/functional/test_requests.py
pradyunsg Sep 23, 2020
36b23f7
Blacken tests/functional/test_search.py
pradyunsg Sep 23, 2020
90cb179
Blacken tests/functional/test_show.py
pradyunsg Sep 23, 2020
da029d9
Blacken tests/functional/test_uninstall.py
pradyunsg Sep 23, 2020
4769d09
Blacken tests/functional/test_uninstall_user.py
pradyunsg Sep 23, 2020
da49600
Blacken tests/functional/test_vcs_bazaar.py
pradyunsg Sep 23, 2020
47b7575
Blacken tests/functional/test_vcs_git.py
pradyunsg Sep 23, 2020
dca2d9d
Blacken tests/functional/test_warning.py
pradyunsg Sep 23, 2020
4882af9
Blacken tests/functional/test_wheel.py
pradyunsg Sep 23, 2020
de08118
Blacken tests/functional/test_yaml.py
pradyunsg Sep 23, 2020
2ba7ae2
Blacken tests/lib/__init__.py
pradyunsg Sep 23, 2020
68ed352
Blacken tests/lib/certs.py
pradyunsg Sep 23, 2020
e7f43c5
Blacken tests/lib/configuration_helpers.py
pradyunsg Sep 23, 2020
cf6314d
Blacken tests/lib/filesystem.py
pradyunsg Sep 23, 2020
03dab36
Blacken tests/lib/git_submodule_helpers.py
pradyunsg Sep 23, 2020
a87febf
Blacken tests/lib/index.py
pradyunsg Sep 23, 2020
61ad72b
Blacken tests/lib/local_repos.py
pradyunsg Sep 23, 2020
7347df7
Blacken tests/lib/options_helpers.py
pradyunsg Sep 23, 2020
159605b
Blacken tests/lib/path.py
pradyunsg Sep 23, 2020
f88b77b
Blacken tests/lib/requests_mocks.py
pradyunsg Sep 23, 2020
a646341
Blacken tests/lib/server.py
pradyunsg Sep 23, 2020
d1e2f2a
Blacken tests/lib/test_lib.py
pradyunsg Sep 23, 2020
de68892
Blacken tests/lib/test_wheel.py
pradyunsg Sep 23, 2020
5ca7d04
Blacken tests/lib/venv.py
pradyunsg Sep 23, 2020
cfda354
Blacken tests/lib/wheel.py
pradyunsg Sep 23, 2020
6f71cc1
Blacken tests/unit/resolution_resolvelib/conftest.py
pradyunsg Sep 23, 2020
e3a5514
Blacken tests/unit/resolution_resolvelib/test_requirement.py
pradyunsg Sep 23, 2020
433d1e6
Blacken tests/unit/resolution_resolvelib/test_resolver.py
pradyunsg Sep 23, 2020
973e78c
Blacken tests/unit/test_appdirs.py
pradyunsg Sep 23, 2020
5eb628d
Blacken tests/unit/test_base_command.py
pradyunsg Sep 23, 2020
6b0f386
Blacken tests/unit/test_build_env.py
pradyunsg Sep 23, 2020
48ded81
Blacken tests/unit/test_cache.py
pradyunsg Sep 23, 2020
99b7cc3
Blacken tests/unit/test_check.py
pradyunsg Sep 23, 2020
db260d3
Blacken tests/unit/test_cmdoptions.py
pradyunsg Sep 23, 2020
a59aa89
Blacken tests/unit/test_collector.py
pradyunsg Sep 23, 2020
f68e6ff
Blacken tests/unit/test_command_install.py
pradyunsg Sep 23, 2020
80b43a4
Blacken tests/unit/test_commands.py
pradyunsg Sep 23, 2020
8153f51
Blacken tests/unit/test_compat.py
pradyunsg Sep 23, 2020
3a6bd68
Blacken tests/unit/test_configuration.py
pradyunsg Sep 23, 2020
0a457c8
Blacken tests/unit/test_direct_url.py
pradyunsg Sep 23, 2020
42f7d7e
Blacken tests/unit/test_direct_url_helpers.py
pradyunsg Sep 23, 2020
8306561
Blacken tests/unit/test_finder.py
pradyunsg Sep 23, 2020
6e97c17
Blacken tests/unit/test_format_control.py
pradyunsg Sep 23, 2020
d582fcd
Blacken tests/unit/test_index.py
pradyunsg Sep 23, 2020
3be8e24
Blacken tests/unit/test_link.py
pradyunsg Sep 23, 2020
27eb90c
Blacken tests/unit/test_locations.py
pradyunsg Sep 23, 2020
cc9bc2b
Blacken tests/unit/test_logging.py
pradyunsg Sep 23, 2020
ed04a80
Blacken tests/unit/test_models.py
pradyunsg Sep 23, 2020
42fb9ff
Blacken tests/unit/test_models_wheel.py
pradyunsg Sep 23, 2020
6e30876
Blacken tests/unit/test_network_auth.py
pradyunsg Sep 23, 2020
20292af
Blacken tests/unit/test_network_cache.py
pradyunsg Sep 23, 2020
1a16d3f
Blacken tests/unit/test_network_download.py
pradyunsg Sep 23, 2020
a833385
Blacken tests/unit/test_network_lazy_wheel.py
pradyunsg Sep 23, 2020
b2f5b06
Blacken tests/unit/test_network_session.py
pradyunsg Sep 23, 2020
63b1002
Blacken tests/unit/test_network_utils.py
pradyunsg Sep 23, 2020
561cde4
Blacken tests/unit/test_operations_prepare.py
pradyunsg Sep 23, 2020
bbf8ba7
Blacken tests/unit/test_options.py
pradyunsg Sep 23, 2020
8645d77
Blacken tests/unit/test_packaging.py
pradyunsg Sep 23, 2020
5c6cba3
Blacken tests/unit/test_pep517.py
pradyunsg Sep 23, 2020
56740ff
Blacken tests/unit/test_req.py
pradyunsg Sep 23, 2020
8e69851
Blacken tests/unit/test_req_file.py
pradyunsg Sep 23, 2020
efef20d
Blacken tests/unit/test_req_install.py
pradyunsg Sep 23, 2020
d69e6e0
Blacken tests/unit/test_req_uninstall.py
pradyunsg Sep 23, 2020
3e2cd2f
Blacken tests/unit/test_resolution_legacy_resolver.py
pradyunsg Sep 23, 2020
a2ba79f
Blacken tests/unit/test_search_scope.py
pradyunsg Sep 23, 2020
dafa9dd
Blacken tests/unit/test_self_check_outdated.py
pradyunsg Sep 23, 2020
ed2a32e
Blacken tests/unit/test_target_python.py
pradyunsg Sep 23, 2020
c731632
Blacken tests/unit/test_urls.py
pradyunsg Sep 23, 2020
ebf2a55
Blacken tests/unit/test_utils.py
pradyunsg Sep 23, 2020
f4b6e7d
Blacken tests/unit/test_utils_compatibility_tags.py
pradyunsg Sep 23, 2020
ff901d0
Blacken tests/unit/test_utils_distutils_args.py
pradyunsg Sep 23, 2020
5e8e82b
Blacken tests/unit/test_utils_filesystem.py
pradyunsg Sep 23, 2020
570ec4d
Blacken tests/unit/test_utils_parallel.py
pradyunsg Sep 23, 2020
26f5afa
Blacken tests/unit/test_utils_pkg_resources.py
pradyunsg Sep 23, 2020
4e02578
Blacken tests/unit/test_utils_subprocess.py
pradyunsg Sep 23, 2020
c0831dd
Blacken tests/unit/test_utils_temp_dir.py
pradyunsg Sep 23, 2020
f06519d
Blacken tests/unit/test_utils_unpacking.py
pradyunsg Sep 23, 2020
1e6c84a
Blacken tests/unit/test_utils_virtualenv.py
pradyunsg Sep 23, 2020
fd62a58
Blacken tests/unit/test_utils_wheel.py
pradyunsg Sep 23, 2020
83744bd
Blacken tests/unit/test_vcs.py
pradyunsg Sep 23, 2020
56dbc68
Blacken tests/unit/test_vcs_mercurial.py
pradyunsg Sep 23, 2020
69c573d
Blacken tests/unit/test_wheel.py
pradyunsg Sep 23, 2020
8581efe
Blacken tests/unit/test_wheel_builder.py
pradyunsg Sep 23, 2020
24227fa
Blacken tests/yaml/linter.py
pradyunsg Sep 23, 2020
c3b6037
Blacken tools/automation/release/__init__.py
pradyunsg Sep 23, 2020
c7b20fb
Blacken tools/tox_pip.py
pradyunsg Sep 23, 2020
a96d51d
Use f-strings in noxfile.py
pradyunsg Sep 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
82 changes: 41 additions & 41 deletions src/pip/_internal/resolution/legacy/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,31 +75,37 @@ def _check_dist_requires_python(
requires_python = get_requires_python(dist)
try:
is_compatible = check_requires_python(
requires_python, version_info=version_info,
requires_python,
version_info=version_info,
)
except specifiers.InvalidSpecifier as exc:
logger.warning(
"Package %r has an invalid Requires-Python: %s",
dist.project_name, exc,
dist.project_name,
exc,
)
return

if is_compatible:
return

version = '.'.join(map(str, version_info))
version = ".".join(map(str, version_info))
if ignore_requires_python:
logger.debug(
'Ignoring failed Requires-Python check for package %r: '
'%s not in %r',
dist.project_name, version, requires_python,
"Ignoring failed Requires-Python check for package %r: " "%s not in %r",
dist.project_name,
version,
requires_python,
)
return

raise UnsupportedPythonVersion(
'Package {!r} requires a different Python: {} not in {!r}'.format(
dist.project_name, version, requires_python,
))
"Package {!r} requires a different Python: {} not in {!r}".format(
dist.project_name,
version,
requires_python,
)
)


class Resolver(BaseResolver):
Expand Down Expand Up @@ -146,8 +152,9 @@ def __init__(
self.use_user_site = use_user_site
self._make_install_req = make_install_req

self._discovered_dependencies = \
defaultdict(list) # type: DiscoveredDependencies
self._discovered_dependencies = defaultdict(
list
) # type: DiscoveredDependencies
Comment on lines +155 to +157
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I blame Python 2 (type comments) and over-long variable names for that.


def resolve(self, root_reqs, check_supported_wheels):
# type: (List[InstallRequirement], bool) -> RequirementSet
Expand All @@ -161,9 +168,7 @@ def resolve(self, root_reqs, check_supported_wheels):
possible to move the preparation to become a step separated from
dependency resolution.
"""
requirement_set = RequirementSet(
check_supported_wheels=check_supported_wheels
)
requirement_set = RequirementSet(check_supported_wheels=check_supported_wheels)
for req in root_reqs:
if req.constraint:
check_invalid_constraint_type(req)
Expand Down Expand Up @@ -240,8 +245,8 @@ def _check_skip_installed(self, req_to_install):

if not self._is_upgrade_allowed(req_to_install):
if self.upgrade_strategy == "only-if-needed":
return 'already satisfied, skipping upgrade'
return 'already satisfied'
return "already satisfied, skipping upgrade"
return "already satisfied"

# Check for the possibility of an upgrade. For link-based
# requirements we have to pull the tree down and inspect to assess
Expand All @@ -251,7 +256,7 @@ def _check_skip_installed(self, req_to_install):
self.finder.find_requirement(req_to_install, upgrade=True)
except BestVersionAlreadyInstalled:
# Then the best version is installed.
return 'already up-to-date'
return "already up-to-date"
except DistributionNotFound:
# No distribution found, so we squash the error. It will
# be raised later when we re-try later to do the install.
Expand All @@ -271,14 +276,14 @@ def _find_requirement_link(self, req):
# Log a warning per PEP 592 if necessary before returning.
link = best_candidate.link
if link.is_yanked:
reason = link.yanked_reason or '<none given>'
reason = link.yanked_reason or "<none given>"
msg = (
# Mark this as a unicode string to prevent
# "UnicodeEncodeError: 'ascii' codec can't encode character"
# in Python 2 when the reason contains non-ascii characters.
u'The candidate selected for download or install is a '
'yanked version: {candidate}\n'
'Reason for being yanked: {reason}'
u"The candidate selected for download or install is a "
"yanked version: {candidate}\n"
"Reason for being yanked: {reason}"
).format(candidate=best_candidate, reason=reason)
logger.warning(msg)

Expand Down Expand Up @@ -309,7 +314,7 @@ def _populate_link(self, req):
supported_tags=get_supported(),
)
if cache_entry is not None:
logger.debug('Using cached wheel link: %s', cache_entry.link)
logger.debug("Using cached wheel link: %s", cache_entry.link)
if req.link is req.original_link and cache_entry.persistent:
req.original_link_is_in_wheel_cache = True
req.link = cache_entry.link
Expand All @@ -328,9 +333,7 @@ def _get_dist_for(self, req):
skip_reason = self._check_skip_installed(req)

if req.satisfied_by:
return self.preparer.prepare_installed_requirement(
req, skip_reason
)
return self.preparer.prepare_installed_requirement(req, skip_reason)

# We eagerly populate the link, since that's our "legacy" behavior.
self._populate_link(req)
Expand All @@ -349,17 +352,17 @@ def _get_dist_for(self, req):

if req.satisfied_by:
should_modify = (
self.upgrade_strategy != "to-satisfy-only" or
self.force_reinstall or
self.ignore_installed or
req.link.scheme == 'file'
self.upgrade_strategy != "to-satisfy-only"
or self.force_reinstall
or self.ignore_installed
or req.link.scheme == "file"
)
if should_modify:
self._set_req_to_reinstall(req)
else:
logger.info(
'Requirement already satisfied (use --upgrade to upgrade):'
' %s', req,
"Requirement already satisfied (use --upgrade to upgrade):" " %s",
req,
)
return dist

Expand All @@ -386,7 +389,8 @@ def _resolve_one(
# This will raise UnsupportedPythonVersion if the given Python
# version isn't compatible with the distribution's Requires-Python.
_check_dist_requires_python(
dist, version_info=self._py_version_info,
dist,
version_info=self._py_version_info,
ignore_requires_python=self.ignore_requires_python,
)

Expand All @@ -404,9 +408,7 @@ def add_req(subreq, extras_requested):
extras_requested=extras_requested,
)
if parent_req_name and add_to_parent:
self._discovered_dependencies[parent_req_name].append(
add_to_parent
)
self._discovered_dependencies[parent_req_name].append(add_to_parent)
more_reqs.extend(to_scan_again)

with indent_log():
Expand All @@ -418,23 +420,21 @@ def add_req(subreq, extras_requested):
# provided by the user.
assert req_to_install.user_supplied
requirement_set.add_requirement(
req_to_install, parent_req_name=None,
req_to_install,
parent_req_name=None,
)

if not self.ignore_dependencies:
if req_to_install.extras:
logger.debug(
"Installing extra requirements: %r",
','.join(req_to_install.extras),
",".join(req_to_install.extras),
)
missing_requested = sorted(
set(req_to_install.extras) - set(dist.extras)
)
for missing in missing_requested:
logger.warning(
"%s does not provide the extra '%s'",
dist, missing
)
logger.warning("%s does not provide the extra '%s'", dist, missing)

available_requested = sorted(
set(dist.extras) & set(req_to_install.extras)
Expand Down