Skip to content

Instantly share code, notes, and snippets.

@jtratner
Created June 7, 2013 23:33
Show Gist options
  • Save jtratner/5733131 to your computer and use it in GitHub Desktop.
Save jtratner/5733131 to your computer and use it in GitHub Desktop.
Guardfile for pandas dev
# grab guard from https://github.com/guard/guard to use this file.
# Place it in the toplevel of the pandas repo and it'll just work for you.
def python_test(testpath)
base = "nosetests -A \"not slow\""
if testpath.nil?
puts "Running all non-slow tests"
return `#{base}`
else
puts "Running test on #{testpath}"
if !File.exists? testpath
puts "File does not exist :-("
return
end
return `#{base} #{testpath}`
end
end
# Add files and commands to this file, like the example:
# watch(%r{file/path}) { `command(s)` }
guard 'shell' do
watch(%r{^pandas/tests/.+\.py$}) { |m| python_test m[0] }
watch(%r{^pandas/.+/tests/.+\.py$}) { |m| python_test m[0] }
watch(%r{^pandas/(io|stats|sparse|tseries)/(.+py)$}) { |m| python_test "pandas/#{m[1]}/#{m[2]}" }
watch(%r{^pandas/core/expressions.py$}) { |m| python_test nil}
watch(%r{^pandas/core/(.+\.py)$}) { |m| python_test "pandas/tests/test_#{m[1]}"}
watch(%r{^pandas/docs/.+$}) {|m| `make docs`}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment