diff options
| author | Samuel John | 2013-07-16 11:10:14 +0200 |
|---|---|---|
| committer | Samuel John | 2013-07-16 11:10:14 +0200 |
| commit | e66faeb8a04ffd412fd1c60f055f718cf1993d38 (patch) | |
| tree | 4fd6dc0a1829898f913d6d9aad1ce45fbbb4c46d | |
| parent | 606749c0debfdf2f18f6bbbc681e17092e3781f7 (diff) | |
| download | homebrew-e66faeb8a04ffd412fd1c60f055f718cf1993d38.tar.bz2 | |
Audit LanguageModuleDependency for python
LanguageModuleDependency.new(:python,...) is deprecated now.
Replace it by
depends_on :python => ['module' => 'name-on-PyPi']
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index fd0a9781e..13fd2462f 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -496,23 +496,30 @@ class FormulaAuditor def audit_python if text =~ /(def\s*)?which_python/ - problem "Replace `which_python` by `python.xy`, which returns e.g. 'python2.7'." + problem "Replace `which_python` by `python.xy`, which returns e.g. 'python2.7'" end if text =~ /which\(?["']python/ problem "Don't locate python with `which 'python'`, use `python.binary` instead" end + if text =~ /LanguageModuleDependency.new\s?\(\s?:python/ + problem <<-EOS.undent + Python: Replace `LanguageModuleDependency.new(:python,'PyPi-name','module')` + by the new `depends_on :python => ['module' => 'PyPi-name']` + EOS + end + # Checks that apply only to code in def install if text =~ /(\s*)def\s+install((.*\n)*?)(\1end)/ install_body = $2 if install_body =~ /system\(?\s*['"]python/ - problem "Instead of `system 'python', ...`, call `system python, ...`." + problem "Instead of `system 'python', ...`, call `system python, ...`" end if text =~ /system\(?\s*python\.binary/ - problem "Instead of `system python.binary, ...`, call `system python, ...`." + problem "Instead of `system python.binary, ...`, call `system python, ...`" end end @@ -534,7 +541,7 @@ class FormulaAuditor # Don't check this for all formulae, because some are allowed to set the # PYTHONPATH. E.g. python.rb itself needs to set it. if text =~ /ENV\.append.*PYTHONPATH/ || text =~ /ENV\[['"]PYTHONPATH['"]\]\s*=[^=]/ - problem "Don't set the PYTHONPATH, instead declare `depends_on :python`." + problem "Don't set the PYTHONPATH, instead declare `depends_on :python`" end else # So if there is no PythonInstalled requirement, we can check if the |
