Skip to content

Commit 41587f5

Browse files
committed
Manual fix of E501 (line length too long)
1 parent 6fbc6ef commit 41587f5

File tree

13 files changed

+42
-25
lines changed

13 files changed

+42
-25
lines changed

src/pip/_internal/commands/search.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ def search(self, query: List[str], options: Values) -> List[Dict[str, str]]:
7575
try:
7676
hits = pypi.search({"name": query, "summary": query}, "or")
7777
except xmlrpc.client.Fault as fault:
78-
message = f"XMLRPC request failed [code: {fault.faultCode}]\n{fault.faultString}"
78+
message = (
79+
f"XMLRPC request failed [code: {fault.faultCode}]\n{fault.faultString}"
80+
)
7981
raise CommandError(message)
8082
assert isinstance(hits, list)
8183
return hits

src/pip/_internal/models/candidate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def __init__(self, name: str, version: str, link: Link) -> None:
2020
)
2121

2222
def __repr__(self) -> str:
23-
return f"<InstallationCandidate({self.name!r}, {self.version!r}, {self.link!r})>"
23+
return (
24+
f"<InstallationCandidate({self.name!r}, {self.version!r}, {self.link!r})>"
25+
)
2426

2527
def __str__(self) -> str:
2628
return f"{self.name!r} candidate (version {self.version} at {self.link})"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_legacy_build_wheel_path(
4040
# Sort for determinism.
4141
names = sorted(names)
4242
if not names:
43-
msg = (f"Legacy build of wheel for {name!r} created no files.\n")
43+
msg = f"Legacy build of wheel for {name!r} created no files.\n"
4444
msg += format_command_result(command_args, command_output)
4545
logger.warning(msg)
4646
return None

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ def make_data_scheme_file(record_path: RecordPath) -> "File":
505505
_, scheme_key, dest_subpath = normed_path.split(os.path.sep, 2)
506506
except ValueError:
507507
message = (
508-
f"Unexpected file in {wheel_path}: {record_path!r}. .data directory contents"
509-
" should be named like: '<scheme key>/<path>'."
508+
f"Unexpected file in {wheel_path}: {record_path!r}. .data directory"
509+
" contents should be named like: '<scheme key>/<path>'."
510510
)
511511
raise InstallationError(message)
512512

@@ -515,9 +515,10 @@ def make_data_scheme_file(record_path: RecordPath) -> "File":
515515
except KeyError:
516516
valid_scheme_keys = ", ".join(sorted(scheme_paths))
517517
message = (
518-
f"Unknown scheme key used in {wheel_path}: {scheme_key} (for file {record_path!r}). .data"
519-
" directory contents should be in subdirectories named"
520-
f" with a valid scheme key ({valid_scheme_keys})"
518+
f"Unknown scheme key used in {wheel_path}: {scheme_key} "
519+
f"(for file {record_path!r}). .data directory contents "
520+
f"should be in subdirectories named with a valid scheme "
521+
f"key ({valid_scheme_keys})"
521522
)
522523
raise InstallationError(message)
523524

src/pip/_internal/req/constructors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def parse_editable(editable_req: str) -> Tuple[Optional[str], str, Set[str]]:
132132
package_name = link.egg_fragment
133133
if not package_name:
134134
raise InstallationError(
135-
f"Could not detect requirement name for '{editable_req}', please specify one "
136-
"with #egg=your_package_name"
135+
f"Could not detect requirement name for '{editable_req}', "
136+
"please specify one with #egg=your_package_name"
137137
)
138138
return package_name, url, set()
139139

src/pip/_internal/req/req_install.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ def __str__(self) -> str:
222222
return s
223223

224224
def __repr__(self) -> str:
225-
return f"<{self.__class__.__name__} object: {str(self)} editable={self.editable!r}>"
225+
return (
226+
f"<{self.__class__.__name__} object: "
227+
f"{str(self)} editable={self.editable!r}>"
228+
)
226229

227230
def format_debug(self) -> str:
228231
"""An un-tested helper for getting state, for debugging."""

src/pip/_internal/req/req_uninstall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ def from_dist(cls, dist: BaseDistribution) -> "UninstallPathSet":
510510

511511
elif dist.installed_by_distutils:
512512
raise UninstallationError(
513-
f"Cannot uninstall {dist.raw_name!r}. It is a distutils installed project "
514-
"and thus we cannot accurately determine which files belong "
513+
f"Cannot uninstall {dist.raw_name!r}. It is a distutils installed "
514+
"project and thus we cannot accurately determine which files belong "
515515
"to it which would lead to only a partial uninstall."
516516
)
517517

src/pip/_internal/resolution/legacy/resolver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def _check_dist_requires_python(
104104
return
105105

106106
raise UnsupportedPythonVersion(
107-
f"Package {dist.raw_name!r} requires a different Python: {version} not in {requires_python!r}"
107+
f"Package {dist.raw_name!r} requires a different Python: "
108+
f"{version} not in {requires_python!r}"
108109
)
109110

110111

@@ -261,7 +262,8 @@ def _add_requirement_to_set(
261262
)
262263
if has_conflicting_requirement:
263264
raise InstallationError(
264-
f"Double requirement given: {install_req} (already in {existing_req}, name={install_req.name!r})"
265+
f"Double requirement given: {install_req} "
266+
f"(already in {existing_req}, name={install_req.name!r})"
265267
)
266268

267269
# When no existing requirement exists, add the requirement as a

src/pip/_internal/resolution/resolvelib/candidates.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ def version(self) -> CandidateVersion:
191191
return self._version
192192

193193
def format_for_error(self) -> str:
194-
return f"{self.name} {self.version} (from {self._link.file_path if self._link.is_file else self._link})"
194+
return (
195+
f"{self.name} {self.version} "
196+
f"(from {self._link.file_path if self._link.is_file else self._link})"
197+
)
195198

196199
def _prepare_distribution(self) -> BaseDistribution:
197200
raise NotImplementedError("Override in subclass")
@@ -265,7 +268,9 @@ def __init__(
265268
# Version may not be present for PEP 508 direct URLs
266269
if version is not None:
267270
wheel_version = Version(wheel.version)
268-
assert version == wheel_version, f"{version!r} != {wheel_version!r} for wheel {name}"
271+
assert (
272+
version == wheel_version
273+
), f"{version!r} != {wheel_version!r} for wheel {name}"
269274

270275
if cache_entry is not None:
271276
assert ireq.link.is_wheel

src/pip/_internal/utils/direct_url_helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ def direct_url_as_pep440_direct_reference(direct_url: DirectUrl, name: str) -> s
1212
requirement = name + " @ "
1313
fragments = []
1414
if isinstance(direct_url.info, VcsInfo):
15-
requirement += f"{direct_url.info.vcs}+{direct_url.url}@{direct_url.info.commit_id}"
15+
requirement += (
16+
f"{direct_url.info.vcs}+{direct_url.url}@{direct_url.info.commit_id}"
17+
)
1618
elif isinstance(direct_url.info, ArchiveInfo):
1719
requirement += direct_url.url
1820
if direct_url.info.hash:

0 commit comments

Comments
 (0)