Pywatch: Run tests when your code changes

I’m happy to announce that [pywatch][pywatch-git] is ready for use, I think.

What does it do? It’s both a Python module and a command line client that allow you to run arbitrary shell commands whenever changes occur in a list of specified files.

Here’s an example:

pywatch --help
Usage: pywatch [options] "command" file1 file2 ...

Options:
  -h, --help     show this help message and exit
  -v, --verbose  Output timestamp when commands are run.
chris@pinko:~/Code/pywatch$ pywatch -v ./bin/test src/pywatch/watcher.py src/pywatch/tests.py

Running commands at 2009-06-20 12:00:13.226711
Running zope.testing.testrunner.layer.UnitTests tests:
  Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
  Ran 4 tests with 0 failures and 0 errors in 2.003 seconds.
Tearing down left over layers:
  Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.

Running commands at 2009-06-20 12:00:34.422557
Test-module import failures:

Module: pywatch.tests

Traceback (most recent call last):
  File "/home/chris/Code/pywatch/src/pywatch/tests.py", line 1, in 
    import makethistestblowup
ImportError: No module named makethistestblowup



Test-modules with import problems:
  pywatch.tests
Total: 0 tests, 0 failures, 0 errors in 0.000 seconds.

Running commands at 2009-06-20 12:00:44.600708
Running zope.testing.testrunner.layer.UnitTests tests:
  Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
  Ran 4 tests with 0 failures and 0 errors in 2.006 seconds.
Tearing down left over layers:
  Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.

So far I’ve been using it to automatically run tests on personal projects, including [pywatch][pywatch-git] and [baseboards][baseboards-git].

You could use it to run other arbitrary commands whenever you change a file, but running tests was the particular itch I was trying to scratch.

It’s available at [GitHub][pywatch-git] and [PyPI][pywatch-pypi]

[pywatch-git]: http://github.com/cmheisel/pywatch/tree/master
[pywatch-pypi]: http://pypi.python.org/pypi/pywatch/0.3
[baseboards-git]: http://github.com/cmheisel/django-baseboard/tree/master

Posted in Programming, Projects, Python, Pywatch | 5 Comments

Django-Loupe for Design Collaboration

Posted in Blogmarks | Comments Off on Django-Loupe for Design Collaboration

Simulate Office Presence with Skype and VNC | Smarterware

Posted in Blogmarks | Comments Off on Simulate Office Presence with Skype and VNC | Smarterware

The Capitalist Manifesto: Greed Is Good (to a point)

Posted in Blogmarks | Comments Off on The Capitalist Manifesto: Greed Is Good (to a point)

django-baseboard updated to 0.3

I’m happy to announce that [django-baseboard](http://pypi.python.org/pypi/django-baseboard/) has been updated to 0.3

Here’s what’s new:

* Better error handling and reporting for the management commands/cron jobs
* Projects are no longer required to have an RSS feed foreign key (bugfix from 0.2)
* Project.project_url returns the Basecamp project’s homepage URL (because Project.basecamp_url can be any valid URL within a project entered by a user)
* baseboard.helpers.update_summaries takes and honors a network timeout argument (defaults to 20 seconds)
* Projects now have RSSFeed foreign keys — suitable for displaying a Trac change log or a project blog, etc.

If you were following along on [GitHub](http://github.com/cmheisel/django-baseboard) then you’ve already got the last three changes. If you were using the official [PyPi relese](http://pypi.python.org/pypi/django-baseboard/) then I, ahem, forgot to upload version 0.2.

But now there’s 0.3 which is a whole tenth better than 0.2, and a whopping two-tenths better than 0.1.

Posted in BasecampReporting, Projects, Python, Technology | Comments Off on django-baseboard updated to 0.3