URL: http://github.com/peterbe/python-gorun/tree/master

gorun.py - Using (py)inotify to run commands when files change By popular demand I've made my little pyinotify wrapper available for download. It's nothing fancy really but damn useful and productive.

It relies on inotify (so you're stuffed on OSX and Windows) which makes it very fast and efficient (as opposed to periodic polling and file modification time comparisons).

At the moment it's actually quite generic for any command and any file but I'm hoping to take this to the next level with some magic dust that automatically only runs unit tests that fail or something. We'll see what happens.

Here's an example configuration that I'm currently using:


DIRECTORIES = (
  ('search/unit_tests/test_views.py',
   './manage.py test --settings=test_settings search.ViewTestCase'),

  ('search/unit_tests',
   './manage.py test --settings=test_settings search'),

  ('search',
   './manage.py test --settings=test_settings search'),
)

Comments

Your email will never ever be published.

Previous:
Getting uploadify to work July 17, 2009 Web development
Next:
Battery life usage on an iPhone 3G(S) July 27, 2009 iPhone
Related by category:
A Python dict that can report which keys you did not use June 12, 2025 Python
Autocomplete using PostgreSQL instead of Elasticsearch December 18, 2025 Python
Comparison of speed between gpt-5, gpt-5-mini, and gpt-5-nano December 15, 2025 Python
Using AI to rewrite blog post comments November 12, 2025 Python
Related by keyword:
To assert or assertEqual in Python unit testing February 14, 2009 Python
setuptools usability - not good, what can be done? July 15, 2009 Python
Mocking a Python standard library March 14, 2008 Zope
Correction: running Django tests with MongoDB is NOT slow May 30, 2010 Django, MongoDB