From bb44d66e79fcbfc0c90ec47414ac48fd6d2d7004 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Wed, 6 Sep 2023 23:28:23 +0100 Subject: [PATCH] Python package names can have more characters in than just `_` and `-` --- Library/Homebrew/resource_auditor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/resource_auditor.rb b/Library/Homebrew/resource_auditor.rb index 68f1f90594..3bf4cc912a 100644 --- a/Library/Homebrew/resource_auditor.rb +++ b/Library/Homebrew/resource_auditor.rb @@ -103,7 +103,7 @@ module Homebrew def audit_resource_name_matches_pypi_package_name_in_url return unless url.match?(%r{^https?://files\.pythonhosted\.org/packages/}) - pypi_package_name = url.split("/").last.split(/-\d+\.\d+./).first.tr("_", "-") + pypi_package_name = url.split("/").last.split(/[-.]\d+?./).first.gsub(/[_.]/, "-") return if name.casecmp(pypi_package_name).zero? problem "resource name should be `#{pypi_package_name}` to match the PyPI package name"