Merge pull request #16790 from cho-m/pypi-ignore-test-resources

utils/pypi: ignore test resources when counting matches
This commit is contained in:
Mike McQuaid 2024-03-04 14:41:18 +00:00 committed by GitHub
commit c3d18113c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -374,7 +374,7 @@ module PyPI
ohai "Updating resource blocks" unless silent
Utils::Inreplace.inreplace formula.path do |s|
if s.inreplace_string.scan(inreplace_regex).length > 1
if T.must(s.inreplace_string.split(/^ test do\b/, 2).first).scan(inreplace_regex).length > 1
odie "Unable to update resource blocks for \"#{formula.name}\" automatically. Please update them manually."
end
s.sub! inreplace_regex, new_resource_blocks