Skip to content

Commit 2c77a0c

Browse files
committed
s3_management: simplify allowlist, correct underscores
Signed-off-by: Eli Uriegas <[email protected]>
1 parent c41bb49 commit 2c77a0c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

s3_management/manage.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@
3030
"whl/test": "torch_test.html",
3131
}
3232

33+
# NOTE: This refers to the name on the wheels themselves and not the name of
34+
# package as specified by setuptools, for packages with "-" (hyphens) in their
35+
# names you need to convert them to "_" (underscores) in order for them to be
36+
# allowed here since the name of the wheels is compared here
3337
PACKAGE_ALLOW_LIST = {
3438
"Pillow",
3539
"certifi",
36-
"charset-normalizer",
40+
"charset_normalizer",
3741
"cmake",
3842
"filelock",
3943
"idna",
@@ -42,7 +46,7 @@
4246
"networkx",
4347
"numpy",
4448
"packaging",
45-
"pytorch-triton",
49+
"pytorch_triton",
4650
"requests",
4751
"sympy",
4852
"torch",
@@ -54,7 +58,7 @@
5458
"torchrec",
5559
"torchtext",
5660
"torchvision",
57-
"typing-extensions",
61+
"typing_extensions",
5862
"urllib3",
5963
}
6064

@@ -120,13 +124,14 @@ def nightly_packages_to_show(self: S3IndexType) -> Set[str]:
120124
full_package_name = path.basename(obj)
121125
package_name = full_package_name.split('-')[0]
122126
package_build_time = extract_package_build_time(full_package_name)
127+
# Hard pass on packages that are included in our allow list
128+
if package_name not in PACKAGE_ALLOW_LIST:
129+
to_hide.add(obj)
130+
continue
123131
if packages[package_name] >= KEEP_THRESHOLD:
124132
to_hide.add(obj)
125133
elif between_bad_dates(package_build_time):
126134
to_hide.add(obj)
127-
elif (package_name not in PACKAGE_ALLOW_LIST or
128-
package_name.replace("-", "_") not in PACKAGE_ALLOW_LIST):
129-
to_hide.add(obj)
130135
else:
131136
packages[package_name] += 1
132137
return set(self.objects).difference({

0 commit comments

Comments
 (0)