Skip to content

Commit be278a3

Browse files
authored
Merge pull request #12594 from notatallshaw/update-black-to-24.3.0
Update black to 24.4.0
2 parents 5da6b2f + 3bd8a7e commit be278a3

Some content is hidden

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

43 files changed

+59
-46
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
exclude: .patch
1818

1919
- repo: https://github.com/psf/black-pre-commit-mirror
20-
rev: 23.12.1
20+
rev: 24.4.0
2121
hooks:
2222
- id: black
2323

news/12594.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update Black pre-commit to 24.4.0

src/pip/_internal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_log.init_logging()
88

99

10-
def main(args: (Optional[List[str]]) = None) -> int:
10+
def main(args: Optional[List[str]] = None) -> int:
1111
"""This is preserved for old console scripts that may still be referencing
1212
it.
1313

src/pip/_internal/cli/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Primary application entrypoint.
22
"""
3+
34
import locale
45
import logging
56
import os

src/pip/_internal/cli/req_command.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def _create_truststore_ssl_context() -> Optional["SSLContext"]:
6666

6767

6868
class SessionCommandMixin(CommandContextMixIn):
69-
7069
"""
7170
A class mixin for command classes needing _build_session().
7271
"""
@@ -155,7 +154,6 @@ def _build_session(
155154

156155

157156
class IndexGroupCommand(Command, SessionCommandMixin):
158-
159157
"""
160158
Abstract base class for commands with the index_group options.
161159
@@ -442,9 +440,11 @@ def get_requirements(
442440
isolated=options.isolated_mode,
443441
use_pep517=options.use_pep517,
444442
user_supplied=True,
445-
config_settings=parsed_req.options.get("config_settings")
446-
if parsed_req.options
447-
else None,
443+
config_settings=(
444+
parsed_req.options.get("config_settings")
445+
if parsed_req.options
446+
else None
447+
),
448448
)
449449
requirements.append(req_to_add)
450450

src/pip/_internal/index/collector.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ def __hash__(self) -> int:
196196

197197

198198
class ParseLinks(Protocol):
199-
def __call__(self, page: "IndexContent") -> Iterable[Link]:
200-
...
199+
def __call__(self, page: "IndexContent") -> Iterable[Link]: ...
201200

202201

203202
def with_cached_index_content(fn: ParseLinks) -> ParseLinks:
@@ -395,7 +394,6 @@ class CollectedSources(NamedTuple):
395394

396395

397396
class LinkCollector:
398-
399397
"""
400398
Responsible for collecting Link objects from all configured locations,
401399
making network requests as needed.

src/pip/_internal/index/package_finder.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ class LinkType(enum.Enum):
106106

107107

108108
class LinkEvaluator:
109-
110109
"""
111110
Responsible for evaluating links for a particular project.
112111
"""
@@ -324,7 +323,6 @@ def filter_unallowed_hashes(
324323

325324

326325
class CandidatePreferences:
327-
328326
"""
329327
Encapsulates some of the preferences for filtering and sorting
330328
InstallationCandidate objects.
@@ -383,7 +381,6 @@ def iter_applicable(self) -> Iterable[InstallationCandidate]:
383381

384382

385383
class CandidateEvaluator:
386-
387384
"""
388385
Responsible for filtering and sorting candidates for installation based
389386
on what tags are valid.

src/pip/_internal/models/direct_url.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" PEP 610 """
2+
23
import json
34
import re
45
import urllib.parse

src/pip/_internal/models/scheme.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
https://docs.python.org/3/install/index.html#alternate-installation.
66
"""
77

8-
98
SCHEME_KEYS = ["platlib", "purelib", "headers", "scripts", "data"]
109

1110

src/pip/_internal/models/search_scope.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
class SearchScope:
18-
1918
"""
2019
Encapsulates the locations that pip is configured to search.
2120
"""

0 commit comments

Comments
 (0)