Fix python: detected_python_shebang python pattern

"python@" is not a valid dependency, must include something after the "@"
This commit is contained in:
Elan Ruusamäe 2023-09-06 01:38:58 +03:00 committed by GitHub
parent 0a72a4148d
commit 132b763242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,7 +115,7 @@ module Language
python_path = if use_python_from_path python_path = if use_python_from_path
"/usr/bin/env python3" "/usr/bin/env python3"
else else
python_deps = formula.deps.map(&:name).grep(/^python(@.*)?$/) python_deps = formula.deps.map(&:name).grep(/^python(@.+)?$/)
raise ShebangDetectionError.new("Python", "formula does not depend on Python") if python_deps.empty? raise ShebangDetectionError.new("Python", "formula does not depend on Python") if python_deps.empty?
if python_deps.length > 1 if python_deps.length > 1
raise ShebangDetectionError.new("Python", "formula has multiple Python dependencies") raise ShebangDetectionError.new("Python", "formula has multiple Python dependencies")