Skip to content

Commit cc9e3bd

Browse files
respond to review comments
1 parent 511659b commit cc9e3bd

File tree

2 files changed

+32
-25
lines changed

2 files changed

+32
-25
lines changed

src/pip/_internal/operations/prepare.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,9 @@ def _complete_partial_requirements(
507507
self._prepare_linked_requirement(
508508
req,
509509
parallel_builds,
510-
source_dir_exists_already=req.link
511-
in reqs_with_newly_unpacked_source_dirs,
510+
source_dir_exists_already=(
511+
req.link in reqs_with_newly_unpacked_source_dirs
512+
),
512513
)
513514

514515
def prepare_linked_requirement(

tests/conftest.py

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -935,17 +935,21 @@ def html_index_for_packages(
935935
pkg_links = "\n".join(
936936
f' <a href="{pkg}/index.html">{pkg}</a>' for pkg in fake_packages.keys()
937937
)
938-
index_html = f"""\
939-
<!DOCTYPE html>
940-
<html>
941-
<head>
942-
<meta name="pypi:repository-version" content="1.0">
943-
<title>Simple index</title>
944-
</head>
945-
<body>
946-
{pkg_links}
947-
</body>
948-
</html>"""
938+
# Output won't be nicely indented because dedent() acts after f-string
939+
# arg insertion.
940+
index_html = dedent(
941+
f"""\
942+
<!DOCTYPE html>
943+
<html>
944+
<head>
945+
<meta name="pypi:repository-version" content="1.0">
946+
<title>Simple index</title>
947+
</head>
948+
<body>
949+
{pkg_links}
950+
</body>
951+
</html>"""
952+
)
949953
# (2) Generate the index.html in a new subdirectory of the temp directory.
950954
(html_dir / "index.html").write_text(index_html)
951955

@@ -976,18 +980,20 @@ def html_index_for_packages(
976980
# write an index.html with the generated download links for each
977981
# copied file for this specific package name.
978982
download_links_str = "\n".join(download_links)
979-
pkg_index_content = f"""\
980-
<!DOCTYPE html>
981-
<html>
982-
<head>
983-
<meta name="pypi:repository-version" content="1.0">
984-
<title>Links for {pkg}</title>
985-
</head>
986-
<body>
987-
<h1>Links for {pkg}</h1>
988-
{download_links_str}
989-
</body>
990-
</html>"""
983+
pkg_index_content = dedent(
984+
f"""\
985+
<!DOCTYPE html>
986+
<html>
987+
<head>
988+
<meta name="pypi:repository-version" content="1.0">
989+
<title>Links for {pkg}</title>
990+
</head>
991+
<body>
992+
<h1>Links for {pkg}</h1>
993+
{download_links_str}
994+
</body>
995+
</html>"""
996+
)
991997
with open(pkg_subdir / "index.html", "w") as f:
992998
f.write(pkg_index_content)
993999

0 commit comments

Comments
 (0)