Skip to content

Commit b44f3b4

Browse files
Round of ruff format
1 parent 8bf09c1 commit b44f3b4

Some content is hidden

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

53 files changed

+92
-115
lines changed

noxfile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Automation using nox.
2-
"""
1+
"""Automation using nox."""
32

43
import argparse
54
import glob

src/pip/_internal/build_env.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Build Environment used for isolation during sdist building
2-
"""
1+
"""Build Environment used for isolation during sdist building"""
32

43
import logging
54
import os

src/pip/_internal/cache.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Cache Management
2-
"""
1+
"""Cache Management"""
32

43
import hashlib
54
import json

src/pip/_internal/cli/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
"""Subpackage containing all of pip's command line interface related code
2-
"""
1+
"""Subpackage containing all of pip's command line interface related code"""
32

43
# This file intentionally does not import submodules

src/pip/_internal/cli/autocompletion.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Logic that powers autocompletion installed by ``pip completion``.
2-
"""
1+
"""Logic that powers autocompletion installed by ``pip completion``."""
32

43
import optparse
54
import os

src/pip/_internal/cli/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Primary application entrypoint.
2-
"""
1+
"""Primary application entrypoint."""
32

43
import locale
54
import logging

src/pip/_internal/cli/main_parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""A single place for constructing and exposing the main parser
2-
"""
1+
"""A single place for constructing and exposing the main parser"""
32

43
import os
54
import subprocess

src/pip/_internal/commands/freeze.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ def add_options(self) -> None:
7272
dest="freeze_all",
7373
action="store_true",
7474
help=(
75-
"Do not skip these packages in the output:"
76-
" {}".format(", ".join(_dev_pkgs()))
75+
"Do not skip these packages in the output:" " {}".format(
76+
", ".join(_dev_pkgs())
77+
)
7778
),
7879
)
7980
self.cmd_opts.add_option(

src/pip/_internal/commands/install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ def run(self, options: Values, args: List[str]) -> int:
307307
options.target_dir = os.path.abspath(options.target_dir)
308308
if (
309309
# fmt: off
310-
os.path.exists(options.target_dir) and
311-
not os.path.isdir(options.target_dir)
310+
os.path.exists(options.target_dir)
311+
and not os.path.isdir(options.target_dir)
312312
# fmt: on
313313
):
314314
raise CommandError(

src/pip/_internal/index/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
"""Index interaction code
2-
"""
1+
"""Index interaction code"""

src/pip/_internal/metadata/_json.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def sanitise_header(h: Union[Header, str]) -> str:
6464
key = json_name(field)
6565
if multi:
6666
value: Union[str, List[str]] = [
67-
sanitise_header(v) for v in msg.get_all(field) # type: ignore
67+
sanitise_header(v)
68+
for v in msg.get_all(field) # type: ignore
6869
]
6970
else:
7071
value = sanitise_header(msg.get(field)) # type: ignore

src/pip/_internal/models/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
"""A package that contains models that represent entities.
2-
"""
1+
"""A package that contains models that represent entities."""

src/pip/_internal/models/direct_url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" PEP 610 """
1+
"""PEP 610"""
22

33
import json
44
import re

src/pip/_internal/network/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
"""Contains purely network-related utilities.
2-
"""
1+
"""Contains purely network-related utilities."""

src/pip/_internal/network/cache.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""HTTP cache implementation.
2-
"""
1+
"""HTTP cache implementation."""
32

43
import os
54
from contextlib import contextmanager

src/pip/_internal/network/download.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Download files with progress indicators.
2-
"""
1+
"""Download files with progress indicators."""
32

43
import email.message
54
import logging

src/pip/_internal/network/xmlrpc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""xmlrpclib.Transport implementation
2-
"""
1+
"""xmlrpclib.Transport implementation"""
32

43
import logging
54
import urllib.parse

src/pip/_internal/operations/build/metadata.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Metadata generation logic for source distributions.
2-
"""
1+
"""Metadata generation logic for source distributions."""
32

43
import os
54

src/pip/_internal/operations/build/metadata_editable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Metadata generation logic for source distributions.
2-
"""
1+
"""Metadata generation logic for source distributions."""
32

43
import os
54

src/pip/_internal/operations/build/metadata_legacy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Metadata generation logic for legacy source distributions.
2-
"""
1+
"""Metadata generation logic for legacy source distributions."""
32

43
import logging
54
import os

src/pip/_internal/operations/check.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Validation of dependencies of packages
2-
"""
1+
"""Validation of dependencies of packages"""
32

43
import logging
54
from contextlib import suppress
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
"""For modules related to installing packages.
2-
"""
1+
"""For modules related to installing packages."""

src/pip/_internal/operations/install/editable_legacy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Legacy editable installation process, i.e. `setup.py develop`.
2-
"""
1+
"""Legacy editable installation process, i.e. `setup.py develop`."""
32

43
import logging
54
from typing import Optional, Sequence

src/pip/_internal/operations/install/wheel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Support for installing and building the "wheel" binary package format.
2-
"""
1+
"""Support for installing and building the "wheel" binary package format."""
32

43
import collections
54
import compileall

src/pip/_internal/operations/prepare.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Prepares a distribution for installation
2-
"""
1+
"""Prepares a distribution for installation"""
32

43
# The following comment should be removed at some point in the future.
54
# mypy: strict-optional=False

src/pip/_internal/req/req_uninstall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _script_names(
3838

3939

4040
def _unique(
41-
fn: Callable[..., Generator[Any, None, None]]
41+
fn: Callable[..., Generator[Any, None, None]],
4242
) -> Callable[..., Generator[Any, None, None]]:
4343
@functools.wraps(fn)
4444
def unique(*args: Any, **kw: Any) -> Generator[Any, None, None]:

src/pip/_internal/utils/compatibility_tags.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Generate and work with PEP 425 Compatibility Tags.
2-
"""
1+
"""Generate and work with PEP 425 Compatibility Tags."""
32

43
import re
54
from typing import List, Optional, Tuple

src/pip/_internal/utils/datetime.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""For when pip wants to check the date or time.
2-
"""
1+
"""For when pip wants to check the date or time."""
32

43
import datetime
54

src/pip/_internal/utils/filetypes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Filetype information.
2-
"""
1+
"""Filetype information."""
32

43
from typing import Tuple
54

src/pip/_internal/utils/retry.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def retry(
2323
"""
2424

2525
def wrapper(func: Callable[P, T]) -> Callable[P, T]:
26-
2726
@functools.wraps(func)
2827
def retry_wrapped(*args: P.args, **kwargs: P.kwargs) -> T:
2928
# The performance counter is monotonic on all platforms we care

src/pip/_internal/utils/unpacking.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Utilities related archives.
2-
"""
1+
"""Utilities related archives."""
32

43
import logging
54
import os

src/pip/_internal/utils/wheel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Support functions for working with wheel files.
2-
"""
1+
"""Support functions for working with wheel files."""
32

43
import logging
54
from email.message import Message

src/pip/_internal/wheel_builder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Orchestrator for building wheels from InstallRequirements.
2-
"""
1+
"""Orchestrator for building wheels from InstallRequirements."""
32

43
import logging
54
import os.path

tests/functional/test_cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Basic CLI functionality checks.
2-
"""
1+
"""Basic CLI functionality checks."""
32

43
import subprocess
54
import sys

tests/functional/test_completion.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def test_completion_alone(autocomplete_script: PipTestEnvironment) -> None:
188188
assert (
189189
"ERROR: You must pass --bash or --fish or --powershell or --zsh"
190190
in result.stderr
191-
), ("completion alone failed -- " + result.stderr)
191+
), "completion alone failed -- " + result.stderr
192192

193193

194194
def test_completion_for_un_snippet(autocomplete: DoAutocomplete) -> None:
@@ -263,10 +263,7 @@ def test_completion_files_after_option(
263263
), "autocomplete function could not complete <dir> after options in command"
264264
assert not any(
265265
out in res.stdout for out in (os.path.join("REPLAY", ""), "README.txt")
266-
), (
267-
"autocomplete function completed <file> or <dir> that "
268-
"should not be completed"
269-
)
266+
), "autocomplete function completed <file> or <dir> that " "should not be completed"
270267
if sys.platform != "win32":
271268
return
272269
assert (

tests/functional/test_configuration.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Tests for the config command
2-
"""
1+
"""Tests for the config command"""
32

43
import re
54
import textwrap

tests/functional/test_install_user.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ def test_install_user_conflict_in_usersite(
136136
dist_info_folder = script.user_site / "INITools-0.1.dist-info"
137137
initools_v3_file = (
138138
# file only in 0.3
139-
script.base_path
140-
/ script.user_site
141-
/ "initools"
142-
/ "configparser.py"
139+
script.base_path / script.user_site / "initools" / "configparser.py"
143140
)
144141
result2.did_create(dist_info_folder)
145142
assert not isfile(initools_v3_file), initools_v3_file

tests/functional/test_new_resolver.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,9 @@ def test_new_resolver_requires_python_error(script: PipTestEnvironment) -> None:
412412
)
413413

414414
message = (
415-
"Package 'base' requires a different Python: "
416-
"{}.{}.{} not in '<2'".format(*sys.version_info[:3])
415+
"Package 'base' requires a different Python: " "{}.{}.{} not in '<2'".format(
416+
*sys.version_info[:3]
417+
)
417418
)
418419
assert message in result.stderr, str(result)
419420

@@ -1169,8 +1170,9 @@ def test_new_resolver_no_deps_checks_requires_python(
11691170
)
11701171

11711172
message = (
1172-
"Package 'base' requires a different Python: "
1173-
"{}.{}.{} not in '<2'".format(*sys.version_info[:3])
1173+
"Package 'base' requires a different Python: " "{}.{}.{} not in '<2'".format(
1174+
*sys.version_info[:3]
1175+
)
11741176
)
11751177
assert message in result.stderr
11761178

tests/lib/configuration_helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Helpers for tests that check configuration
2-
"""
1+
"""Helpers for tests that check configuration"""
32

43
import contextlib
54
import functools

tests/lib/filesystem.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Helpers for filesystem-dependent tests.
2-
"""
1+
"""Helpers for filesystem-dependent tests."""
32

43
import os
54
from contextlib import contextmanager

tests/lib/options_helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Provides helper classes for testing option handling in pip
2-
"""
1+
"""Provides helper classes for testing option handling in pip"""
32

43
from optparse import Values
54
from typing import List, Tuple

tests/lib/requests_mocks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Helper classes as mocks for requests objects.
2-
"""
1+
"""Helper classes as mocks for requests objects."""
32

43
from io import BytesIO
54
from typing import Any, Callable, Dict, Iterator, List, Optional

tests/lib/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def make_environ(self) -> Dict[str, Any]:
4848

4949

5050
def _mock_wsgi_adapter(
51-
mock: Callable[["WSGIEnvironment", "StartResponse"], "WSGIApplication"]
51+
mock: Callable[["WSGIEnvironment", "StartResponse"], "WSGIApplication"],
5252
) -> "WSGIApplication":
5353
"""Uses a mock to record function arguments and provide
5454
the actual function that should respond.

tests/lib/test_wheel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Tests for wheel helper.
2-
"""
1+
"""Tests for wheel helper."""
32

43
import csv
54
from email import message_from_string

tests/lib/wheel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Helper for building wheels as would be in test cases.
2-
"""
1+
"""Helper for building wheels as would be in test cases."""
32

43
import csv
54
import itertools

tests/unit/resolution_resolvelib/test_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def resolver(preparer: RequirementPreparer, finder: PackageFinder) -> Resolver:
3333

3434

3535
def _make_graph(
36-
edges: List[Tuple[Optional[str], Optional[str]]]
36+
edges: List[Tuple[Optional[str], Optional[str]]],
3737
) -> "DirectedGraph[Optional[str]]":
3838
"""Build graph from edge declarations."""
3939

tests/unit/test_appdirs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_user_cache_dir_unicode(self, monkeypatch: pytest.MonkeyPatch) -> None:
6464
return
6565

6666
def my_get_win_folder(csidl_name: str) -> str:
67-
return "\u00DF\u00E4\u03B1\u20AC"
67+
return "\u00df\u00e4\u03b1\u20ac"
6868

6969
monkeypatch.setattr(
7070
platformdirs.windows, # type: ignore

tests/unit/test_base_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class FakeCommandWithUnicode(FakeCommand):
5555
_name = "fake_unicode"
5656

5757
def run(self, options: Values, args: List[str]) -> int:
58-
logging.getLogger("pip.tests").info(b"bytes here \xE9")
59-
logging.getLogger("pip.tests").info(b"unicode here \xC3\xA9".decode("utf-8"))
58+
logging.getLogger("pip.tests").info(b"bytes here \xe9")
59+
logging.getLogger("pip.tests").info(b"unicode here \xc3\xa9".decode("utf-8"))
6060
return SUCCESS
6161

6262

0 commit comments

Comments
 (0)