From 47ebd2b66139f529019eacb708f60628d0a6e17b Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 13 Mar 2013 13:20:11 -0400 Subject: [PATCH] Set pythonpath when running pylint via rake to avoid import errors --- rakefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rakefile b/rakefile index 34bf380176..21c39cf73e 100644 --- a/rakefile +++ b/rakefile @@ -141,11 +141,7 @@ end desc "Run pylint on all #{system} code" task "pylint_#{system}" => report_dir do Dir["#{system}/djangoapps/*", "#{system}/lib/*"].each do |app| - if File.exists? "#{app}/setup.py" - pythonpath_prefix = "PYTHONPATH=#{app}" - else - pythonpath_prefix = "PYTHONPATH=#{File.dirname(app)}" - end + pythonpath_prefix = "PYTHONPATH=#{system}:#{system}/djangoapps:#{system}/lib:common/djangoapps:common/lib" app = File.basename(app) if app =~ /.py$/ app = app.gsub('.py', '') @@ -423,7 +419,7 @@ end namespace :cms do desc "Delete existing MongoDB based course" task :delete_course do - + if ENV['LOC'] and ENV['COMMIT'] sh(django_admin(:cms, :dev, :delete_course, ENV['LOC'], ENV['COMMIT'])) elsif ENV['LOC']