Skip to content

Commit bdb5d4c

Browse files
authored
[S3] Fix up networkx index for UV (#6575)
By manually adding data-requires-python=">=3.10" there TODO: Extract this info from metadata and add it for all relevant packages Test plan: Run `python3 manage.py --do-not-upload whl` and check generated indexes, for example in whl/cu128/networkx/index.html Fixes pytorch/pytorch#152191
1 parent a880734 commit bdb5d4c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

s3_management/manage.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,19 @@ def to_simple_package_html(
386386
# Do not include checksum for nightly packages, see
387387
# https://github.com/pytorch/test-infra/pull/6307
388388
maybe_fragment = f"#sha256={obj.checksum}" if obj.checksum and not obj.orig_key.startswith("whl/nightly") else ""
389-
pep658_attribute = ""
389+
attributes = ""
390390
if obj.pep658:
391391
pep658_sha = f"sha256={obj.pep658}"
392392
# pep714 renames the attribute to data-core-metadata
393-
pep658_attribute = (
393+
attributes = (
394394
f' data-dist-info-metadata="{pep658_sha}" data-core-metadata="{pep658_sha}"'
395395
)
396+
# Ugly hack: mark networkx-3.3, 3.4.2 as Python-3.10+ only to unblock https://github.com/pytorch/pytorch/issues/152191
397+
if any(obj.key.endswith(x) for x in ("networkx-3.3-py3-none-any.whl", "networkx-3.4.2-py3-none-any.whl")):
398+
attributes += ' data-requires-python=">=3.10"'
399+
396400
out.append(
397-
f' <a href="/{obj.key}{maybe_fragment}"{pep658_attribute}>{path.basename(obj.key).replace("%2B","+")}</a><br/>'
401+
f' <a href="/{obj.key}{maybe_fragment}"{attributes}>{path.basename(obj.key).replace("%2B","+")}</a><br/>'
398402
)
399403
# Adding html footer
400404
out.append(' </body>')

0 commit comments

Comments
 (0)