206
206
"wheel" ,
207
207
]}
208
208
209
- # Should match torch-2.0.0.dev20221221+cu118-cp310-cp310-linux_x86_64.whl as:
210
- # Group 1: torch-2.0.0.dev
211
- # Group 2: 20221221
212
- PACKAGE_DATE_REGEX = r"([a-zA-z]*-[0-9.]*.dev)([0-9]*)"
213
209
214
210
# How many packages should we keep of a specific package?
215
211
KEEP_THRESHOLD = 60
216
212
217
- # TODO (huydhn): Clean this up afte https://github.com/pytorch/pytorch/pull/152238
218
- # is in the release branch, be it via cherry picking to the next release branch
219
- # cut
220
- KEEP_NIGHTLY_PACKAGES_FOR_EXECUTORCH = {datetime (2025 , 3 , 10 , 0 , 0 )}
221
213
222
214
S3IndexType = TypeVar ('S3IndexType' , bound = 'S3Index' )
223
215
@@ -244,21 +236,6 @@ def __lt__(self, other):
244
236
return self .key < other .key
245
237
246
238
247
- def extract_package_build_time (full_package_name : str ) -> datetime :
248
- result = search (PACKAGE_DATE_REGEX , full_package_name )
249
- if result is not None :
250
- with suppress (ValueError ):
251
- # Ignore any value errors since they probably shouldn't be hidden anyways
252
- return datetime .strptime (result .group (2 ), "%Y%m%d" )
253
- return datetime .now ()
254
-
255
-
256
- def between_bad_dates (package_build_time : datetime ):
257
- start_bad = datetime (year = 2022 , month = 8 , day = 17 )
258
- end_bad = datetime (year = 2022 , month = 12 , day = 30 )
259
- return start_bad <= package_build_time <= end_bad
260
-
261
-
262
239
def safe_parse_version (ver_str : str ) -> Version :
263
240
try :
264
241
return _parse_version (ver_str )
@@ -301,15 +278,11 @@ def nightly_packages_to_show(self: S3IndexType) -> List[S3Object]:
301
278
for obj in all_sorted_packages :
302
279
full_package_name = path .basename (obj )
303
280
package_name = full_package_name .split ('-' )[0 ]
304
- package_build_time = extract_package_build_time (full_package_name )
305
281
# Hard pass on packages that are included in our allow list
306
282
if package_name .lower () not in PACKAGE_ALLOW_LIST :
307
283
to_hide .add (obj )
308
284
continue
309
- if package_build_time not in KEEP_NIGHTLY_PACKAGES_FOR_EXECUTORCH and (
310
- packages [package_name ] >= KEEP_THRESHOLD
311
- or between_bad_dates (package_build_time )
312
- ):
285
+ if packages [package_name ] >= KEEP_THRESHOLD :
313
286
to_hide .add (obj )
314
287
else :
315
288
packages [package_name ] += 1
0 commit comments