Skip to content

Commit b642cb0

Browse files
authored
Merge pull request #32 from arcivanov/issue_31
Files may contain both dashes and underscores, so compare them with both
2 parents a2d684c + 7400572 commit b642cb0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/python/pypi_cleanup/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def run(self):
111111
releases_by_date[version] = max(
112112
[datetime.datetime.strptime(f["upload-time"], '%Y-%m-%dT%H:%M:%S.%f%z')
113113
for f in project_info["files"]
114-
if f["filename"].lower().startswith(f"{self.package}-{version}")])
114+
if f["filename"].lower().startswith(f"{self.package}-{version}") or
115+
f["filename"].lower().startswith(f"{self.package.replace('-', '_')}-{version}")])
115116

116117
if not releases_by_date:
117118
logging.info(f"No releases for package {self.package!r} have been found")

0 commit comments

Comments
 (0)