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
Show file tree
Hide file tree
Changes from 10 commits
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
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ repos:
- id: trailing-whitespace
exclude: .patch

- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
Expand Down
94 changes: 40 additions & 54 deletions docs/html/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import re
import sys

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

docs_dir = os.path.dirname(os.path.dirname(__file__))
# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -30,54 +30,54 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
# extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.extlinks', 'pip_sphinxext', 'sphinx.ext.intersphinx']
extensions = ["sphinx.ext.extlinks", "pip_sphinxext", "sphinx.ext.intersphinx"]

# intersphinx
intersphinx_cache_limit = 0
intersphinx_mapping = {
'pypug': ('https://packaging.python.org/', None),
'pypa': ('https://www.pypa.io/en/latest/', None),
"pypug": ("https://packaging.python.org/", None),
"pypa": ("https://www.pypa.io/en/latest/", None),
}


# Add any paths that contain templates here, relative to this directory.
templates_path = []

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
# source_encoding = 'utf-8'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'pip'
copyright = '2008-2020, PyPA'
project = "pip"
copyright = "2008-2020, PyPA"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.

version = release = 'dev'
version = release = "dev"

# Readthedocs seems to install pip as an egg (via setup.py install) which
# is somehow resulting in "import pip" picking up an older copy of pip.
# Rather than trying to force RTD to install pip properly, we'll simply
# read the version direct from the __init__.py file. (Yes, this is
# fragile, but it works...)

pip_init = os.path.join(docs_dir, '..', 'src', 'pip', '__init__.py')
pip_init = os.path.join(docs_dir, "..", "src", "pip", "__init__.py")
with open(pip_init) as f:
for line in f:
m = re.match(r'__version__ = "(.*)"', line)
if m:
__version__ = m.group(1)
# The short X.Y version.
version = '.'.join(__version__.split('.')[:2])
version = ".".join(__version__.split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = __version__
break
Expand All @@ -95,14 +95,14 @@
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
today_fmt = "%B %d, %Y"

# List of documents that shouldn't be included in the build.
# unused_docs = []

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_patterns = ['build/']
exclude_patterns = ["build/"]

# The reST default role (used for this markup: `text`) to use for all documents
# default_role = None
Expand All @@ -119,15 +119,15 @@
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []

extlinks = {
'issue': ('https://github.com/pypa/pip/issues/%s', '#'),
'pull': ('https://github.com/pypa/pip/pull/%s', 'PR #'),
'pypi': ('https://pypi.org/project/%s/', ''),
"issue": ("https://github.com/pypa/pip/issues/%s", "#"),
"pull": ("https://github.com/pypa/pip/pull/%s", "PR #"),
"pypi": ("https://pypi.org/project/%s/", ""),
}

# -- Options for HTML output --------------------------------------------------
Expand All @@ -140,12 +140,12 @@
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'collapsiblesidebar': True,
'externalrefs': True,
'navigation_depth': 3,
'issues_url': 'https://github.com/pypa/pip/issues',
'codebgcolor': '#eeffcc',
'codetextcolor': '#333333',
"collapsiblesidebar": True,
"externalrefs": True,
"navigation_depth": 3,
"issues_url": "https://github.com/pypa/pip/issues",
"codebgcolor": "#eeffcc",
"codetextcolor": "#333333",
}

# Add any paths that contain custom themes here, relative to this directory.
Expand Down Expand Up @@ -173,7 +173,7 @@

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = "%b %d, %Y"

# If true, the Docutils Smart Quotes transform (originally based on
# SmartyPants) will be used to convert characters like quotes and dashes
Expand All @@ -192,10 +192,7 @@
smartquotes_action = "qe"

# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['localtoc.html', 'relations.html'],
'index': ['localtoc.html']
}
html_sidebars = {"**": ["localtoc.html", "relations.html"], "index": ["localtoc.html"]}

# Additional templates that should be rendered to pages, maps page names to
# template names.
Expand All @@ -222,7 +219,7 @@
# html_file_suffix = ''

# Output file base name for HTML help builder.
htmlhelp_basename = 'pipdocs'
htmlhelp_basename = "pipdocs"


# -- Options for LaTeX output -------------------------------------------------
Expand All @@ -237,11 +234,11 @@
# (source start file, target name, title, author, documentclass [howto/manual])
latex_documents = [
(
'index',
'pip.tex',
u'pip Documentation',
u'pip developers',
'manual',
"index",
"pip.tex",
u"pip Documentation",
u"pip developers",
"manual",
),
]

Expand All @@ -266,37 +263,26 @@

# List of manual pages generated
man_pages = [
(
'index',
'pip',
u'package manager for Python packages',
u'pip developers',
1
)
("index", "pip", u"package manager for Python packages", u"pip developers", 1)
]


def to_document_name(path, base_dir):
"""Convert a provided path to a Sphinx "document name".
"""
"""Convert a provided path to a Sphinx "document name"."""
relative_path = os.path.relpath(path, base_dir)
root, _ = os.path.splitext(relative_path)
return root.replace(os.sep, '/')
return root.replace(os.sep, "/")


# Here, we crawl the entire man/commands/ directory and list every file with
# appropriate name and details
man_dir = os.path.join(docs_dir, 'man')
raw_subcommands = glob.glob(os.path.join(man_dir, 'commands/*.rst'))
man_dir = os.path.join(docs_dir, "man")
raw_subcommands = glob.glob(os.path.join(man_dir, "commands/*.rst"))
if not raw_subcommands:
raise FileNotFoundError(
'The individual subcommand manpages could not be found!'
)
raise FileNotFoundError("The individual subcommand manpages could not be found!")
for fname in raw_subcommands:
fname_base = to_document_name(fname, man_dir)
outname = 'pip-' + fname_base.split('/')[1]
description = u'description of {} command'.format(
outname.replace('-', ' ')
)
outname = "pip-" + fname_base.split("/")[1]
description = u"description of {} command".format(outname.replace("-", " "))

man_pages.append((fname_base, outname, description, u'pip developers', 1))
man_pages.append((fname_base, outname, description, u"pip developers", 1))
52 changes: 23 additions & 29 deletions docs/pip_sphinxext.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ class PipCommandUsage(rst.Directive):

def run(self):
cmd = create_command(self.arguments[0])
usage = dedent(
cmd.usage.replace('%prog', 'pip {}'.format(cmd.name))
).strip()
usage = dedent(cmd.usage.replace("%prog", "pip {}".format(cmd.name))).strip()
node = nodes.literal_block(usage, usage)
return [node]

Expand All @@ -34,19 +32,18 @@ def run(self):
desc = ViewList()
cmd = create_command(self.arguments[0])
description = dedent(cmd.__doc__)
for line in description.split('\n'):
for line in description.split("\n"):
desc.append(line, "")
self.state.nested_parse(desc, 0, node)
return [node]


class PipOptions(rst.Directive):

def _format_option(self, option, cmd_name=None):
bookmark_line = (
".. _`{cmd_name}_{option._long_opts[0]}`:"
if cmd_name else
".. _`{option._long_opts[0]}`:"
if cmd_name
else ".. _`{option._long_opts[0]}`:"
).format(**locals())
line = ".. option:: "
if option._short_opts:
Expand All @@ -59,7 +56,7 @@ def _format_option(self, option, cmd_name=None):
metavar = option.metavar or option.dest.lower()
line += " <{}>".format(metavar.lower())
# fix defaults
opt_help = option.help.replace('%default', str(option.default))
opt_help = option.help.replace("%default", str(option.default))
# fix paths with sys.prefix
opt_help = opt_help.replace(sys.prefix, "<sys.prefix>")
return [bookmark_line, "", line, "", " " + opt_help, ""]
Expand All @@ -82,9 +79,7 @@ def run(self):

class PipGeneralOptions(PipOptions):
def process_options(self):
self._format_options(
[o() for o in cmdoptions.general_group['options']]
)
self._format_options([o() for o in cmdoptions.general_group["options"]])


class PipIndexOptions(PipOptions):
Expand All @@ -93,7 +88,7 @@ class PipIndexOptions(PipOptions):
def process_options(self):
cmd_name = self.arguments[0]
self._format_options(
[o() for o in cmdoptions.index_group['options']],
[o() for o in cmdoptions.index_group["options"]],
cmd_name=cmd_name,
)

Expand All @@ -110,49 +105,48 @@ def process_options(self):


class PipReqFileOptionsReference(PipOptions):

def determine_opt_prefix(self, opt_name):
for command in commands_dict:
cmd = create_command(command)
if cmd.cmd_opts.has_option(opt_name):
return command

raise KeyError('Could not identify prefix of opt {}'.format(opt_name))
raise KeyError("Could not identify prefix of opt {}".format(opt_name))

def process_options(self):
for option in SUPPORTED_OPTIONS:
if getattr(option, 'deprecated', False):
if getattr(option, "deprecated", False):
continue

opt = option()
opt_name = opt._long_opts[0]
if opt._short_opts:
short_opt_name = '{}, '.format(opt._short_opts[0])
short_opt_name = "{}, ".format(opt._short_opts[0])
else:
short_opt_name = ''
short_opt_name = ""

if option in cmdoptions.general_group['options']:
prefix = ''
if option in cmdoptions.general_group["options"]:
prefix = ""
else:
prefix = '{}_'.format(self.determine_opt_prefix(opt_name))
prefix = "{}_".format(self.determine_opt_prefix(opt_name))

self.view_list.append(
' * :ref:`{short}{long}<{prefix}{opt_name}>`'.format(
" * :ref:`{short}{long}<{prefix}{opt_name}>`".format(
short=short_opt_name,
long=opt_name,
prefix=prefix,
opt_name=opt_name
opt_name=opt_name,
),
"\n"
"\n",
)


def setup(app):
app.add_directive('pip-command-usage', PipCommandUsage)
app.add_directive('pip-command-description', PipCommandDescription)
app.add_directive('pip-command-options', PipCommandOptions)
app.add_directive('pip-general-options', PipGeneralOptions)
app.add_directive('pip-index-options', PipIndexOptions)
app.add_directive("pip-command-usage", PipCommandUsage)
app.add_directive("pip-command-description", PipCommandDescription)
app.add_directive("pip-command-options", PipCommandOptions)
app.add_directive("pip-general-options", PipGeneralOptions)
app.add_directive("pip-index-options", PipIndexOptions)
app.add_directive(
'pip-requirements-file-options-ref-list', PipReqFileOptionsReference
"pip-requirements-file-options-ref-list", PipReqFileOptionsReference
)