Commit 47ebd2b6 by Calen Pennington

Set pythonpath when running pylint via rake to avoid import errors

parent 324d286f
...@@ -141,11 +141,7 @@ end ...@@ -141,11 +141,7 @@ end
desc "Run pylint on all #{system} code" desc "Run pylint on all #{system} code"
task "pylint_#{system}" => report_dir do task "pylint_#{system}" => report_dir do
Dir["#{system}/djangoapps/*", "#{system}/lib/*"].each do |app| Dir["#{system}/djangoapps/*", "#{system}/lib/*"].each do |app|
if File.exists? "#{app}/setup.py" pythonpath_prefix = "PYTHONPATH=#{system}:#{system}/djangoapps:#{system}/lib:common/djangoapps:common/lib"
pythonpath_prefix = "PYTHONPATH=#{app}"
else
pythonpath_prefix = "PYTHONPATH=#{File.dirname(app)}"
end
app = File.basename(app) app = File.basename(app)
if app =~ /.py$/ if app =~ /.py$/
app = app.gsub('.py', '') app = app.gsub('.py', '')
...@@ -423,7 +419,7 @@ end ...@@ -423,7 +419,7 @@ end
namespace :cms do namespace :cms do
desc "Delete existing MongoDB based course" desc "Delete existing MongoDB based course"
task :delete_course do task :delete_course do
if ENV['LOC'] and ENV['COMMIT'] if ENV['LOC'] and ENV['COMMIT']
sh(django_admin(:cms, :dev, :delete_course, ENV['LOC'], ENV['COMMIT'])) sh(django_admin(:cms, :dev, :delete_course, ENV['LOC'], ENV['COMMIT']))
elsif ENV['LOC'] elsif ENV['LOC']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment