Fix leftover errors for Dependencies vs. T::Array[Dependency]

This commit is contained in:
Issy Long 2024-10-05 23:25:09 +01:00
parent 28349370d3
commit d1892d436a
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View File

@ -39,6 +39,11 @@ class Dependencies < SimpleDelegator
def inspect
"#<#{self.class.name}: #{__getobj__}>"
end
sig { returns(T::Array[Dependency]) }
def to_a
__getobj__.to_a
end
end
# A collection of requirements.

View File

@ -191,7 +191,7 @@ module FormulaCellarChecks
EOS
end
sig { params(lib: Pathname, deps: T::Array[Dependency]).returns(T.nilable(String)) }
sig { params(lib: Pathname, deps: Dependencies).returns(T.nilable(String)) }
def check_python_packages(lib, deps)
return unless lib.directory?
@ -209,7 +209,8 @@ module FormulaCellarChecks
return if pythons.blank?
python_deps = deps.map(&:name)
python_deps = deps.to_a
.map(&:name)
.grep(/^python(@.*)?$/)
.filter_map { |d| Formula[d].version.to_s[/^\d+\.\d+/] }