Skip to content

Commit

Permalink
Merge pull request #32 from arcivanov/issue_31
Browse files Browse the repository at this point in the history
Files may contain both dashes and underscores, so compare them with both
  • Loading branch information
arcivanov authored Apr 20, 2024
2 parents a2d684c + 7400572 commit b642cb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/python/pypi_cleanup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def run(self):
releases_by_date[version] = max(
[datetime.datetime.strptime(f["upload-time"], '%Y-%m-%dT%H:%M:%S.%f%z')
for f in project_info["files"]
if f["filename"].lower().startswith(f"{self.package}-{version}")])
if f["filename"].lower().startswith(f"{self.package}-{version}") or
f["filename"].lower().startswith(f"{self.package.replace('-', '_')}-{version}")])

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

0 comments on commit b642cb0

Please sign in to comment.