File tree 2 files changed +32
-25
lines changed
src/pip/_internal/operations 2 files changed +32
-25
lines changed Original file line number Diff line number Diff line change @@ -509,8 +509,9 @@ def _complete_partial_requirements(
509
509
self ._prepare_linked_requirement (
510
510
req ,
511
511
parallel_builds ,
512
- source_dir_exists_already = req .link
513
- in reqs_with_newly_unpacked_source_dirs ,
512
+ source_dir_exists_already = (
513
+ req .link in reqs_with_newly_unpacked_source_dirs
514
+ ),
514
515
)
515
516
516
517
def prepare_linked_requirement (
Original file line number Diff line number Diff line change @@ -935,17 +935,21 @@ def html_index_for_packages(
935
935
pkg_links = "\n " .join (
936
936
f' <a href="{ pkg } /index.html">{ pkg } </a>' for pkg in fake_packages .keys ()
937
937
)
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
+ )
949
953
# (2) Generate the index.html in a new subdirectory of the temp directory.
950
954
(html_dir / "index.html" ).write_text (index_html )
951
955
@@ -976,18 +980,20 @@ def html_index_for_packages(
976
980
# write an index.html with the generated download links for each
977
981
# copied file for this specific package name.
978
982
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
+ )
991
997
with open (pkg_subdir / "index.html" , "w" ) as f :
992
998
f .write (pkg_index_content )
993
999
You can’t perform that action at this time.
0 commit comments