From 2c85f26b0baf8953099d056de86b53ee769eabf4 Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Sat, 4 Apr 2020 15:49:30 +1100 Subject: [PATCH] formula_cellar_checks: skip unless Python libs This avoids an unusual error message when Python is needed for building (e.g., code generation) but is not used at runtime. ``` ==> brew audit recode --online Error: 1 problem in 1 formula detected recode: * Packages have been installed for: but this formula depends on: Python 3.7 ``` --- Library/Homebrew/formula_cellar_checks.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index 6a509ee7c1..b793188396 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -180,6 +180,8 @@ module FormulaCellarChecks match.captures.first end.compact + return if pythons.blank? + python_deps = deps.map(&:name) .grep(/^python(@.*)?$/) .map { |d| Formula[d].version.to_s[/^\d+\.\d+/] }