Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Usage

rerun [--help|-h] [--verbose|-v] [--ignore|-i=<file>] [--version] <command>

Where:

<command>           Command to execute
--help|-h           Show this help message and exit.
--ignore|-i=<file>  File or directory to ignore. Any directories of the
                    given name (and their subdirs) are excluded from the
                    search for changed files. Any modification to files of
                    the given name are ignored. The given value is
                    compared to basenames, so for example, "--ignore=def"
                    will skip the contents of directory "./abc/def/" and
                    will ignore file "./ghi/def". Can be specified multiple
                    times.
--verbose|-v        Display the names of changed files before the command
                    output.
--version           Show version number and exit.

Description

Rerun detects changes to files by polling file modification times once per second. It looks in the current directory and all its subdirectories. On detecting any changes, it clears the terminal and reruns the given command.

It always ignores directories called .svn, .git, .hg, .bzr, build and dist.

It always ignores files ending with .pyc or .pyo.

e.g:

rerun python -m unittest mypackage.mymodule

will rerun your tests every time you save your source code, but it won’t rerun the tests a second time when .pyo files get updated as a result of executing the tests. Handy for seeing the new test results in another console window after you hit ‘save’ in your editor, without having to change window focus.

Dependencies

Tested on MacOSX, Ubuntu, WindowsXP, Windows 7.

Runs under Python2.7 or 3.2.

May run under Python 2.6 or older with PyPI package ‘argparse’ installed.

No other dependencies.

Install

pip install rerun

Known Problems

Polling for modification times perhaps isn’t ideal. Registering of OS-specific notifications of file system events might be better. In practice though, I haven’t noticed it burden my machine in directories containing hundreds of files.

It might be handy if ‘–ignore’ accepted globs, e.g. “*.tmp”

See issues at https://bitbucket.org/tartley/rerun/issues?status=new&status=open

Alternatives

PyPI package ‘watchdog’ is a cross-platform library for handling file-system events, which includes script ‘watchmedo’, which looks like a more serious and heavy-duty version of ‘Rerun’.

Thanks

The idea came from the Bash command ‘watch’, and inspiration for this implementation came from an old blog post by Jeff Winkler, whos website http://jeffwinkler.net seems to have now died.

Contact

Documentation & download:

http://pypi.python.org/pypi/rerun/

Souce code and issues:

https://bitbucket.org/tartley/rerun

Contact the author:

Jonathan Hartley, email: tartley at domain tartley.com, Twitter: @tartley.

Metadata

Release files for rerun 1.0.14beta

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for rerun 1.0.14beta
File Size Uploaded Provenance Actions
rerun-1.0.14beta.zip 11.7 kB Without provenance Details for rerun-1.0.14beta.zip
rerun-1.0.14beta.tar.gz 6.3 kB Without provenance Details for rerun-1.0.14beta.tar.gz

Release files / rerun-1.0.14beta.zip

Download URL rerun-1.0.14beta.zip
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0c5c5bf73c7e071b01e87eadcc6582ccc3083e4ce53d98db11cb0fc9267e358f
BLAKE2b-256 checksum
How to use checksums
8400c2c61e69e1836ad6a68090099ac241e4285eb0f157e025365929946dcfb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rerun-1.0.14beta.tar.gz

Download URL rerun-1.0.14beta.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
96bbab1a7e1c7e65dd63fd7dba36ed1e562cbb9d690bff0feb12bcd5021971f5
BLAKE2b-256 checksum
How to use checksums
476b0284e54d0f4b32b175a2eb37706060435cfa4c5b2cab1ce04fa400c47f95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for rerun 1.0.14beta

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

1.0.18

This release

1.0.11beta

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page