hupper is an integrated process monitor for your Python process, designed for development. It automatically tracks changes to imported Python files and custom paths, restarting the process when files are modified. Reloads can also be triggered manually from code. It is currently at version 1.12.1 and maintains an active release cadence.
pip install hupperVerified import paths — ran on the pinned version, not inferred.
To use hupper, define your application's entry point as a callable function. Call `hupper.start_reloader()` from your main script, passing the dotted path to this entry point. `hupper` will then fork a worker process to run your application and monitor for file changes. If changes are detected, the worker process will be restarted. The `HUPPER_RELOADER` environment variable distinguishes between the monitor and worker processes internally. Running the script and then modifying `my_app.py` will demonstrate the reload functionality.
Upgrade your Python environment to 3.7+ before upgrading hupper to 1.11 or later.
Always ensure `reload_interval` is a positive integer or omit it to use the default.
Upgrade to hupper 1.10 or later to benefit from improved SIGTERM handling, which gracefully forwards the signal to the child process.
Design your application's entry point to account for this dual behavior, typically by checking `os.environ.get('HUPPER_RELOADER')` or by structuring your `main` function as shown in the quickstart.Set the `HUPPER_DEFAULT_MONITOR` environment variable (e.g., `export HUPPER_DEFAULT_MONITOR=hupper.polling.PollingFileMonitor`) before running your hupper-monitored application if you need to force a specific monitoring mechanism.
Install `hupper` using pip: `pip install hupper` or ensure your virtual environment is activated before running the application.
Upgrade `hupper` to a newer version (e.g., beyond 1.7 if applicable, as older versions had issues with `stdin` in Docker) or ensure your application handles graceful shutdowns to release ports. Consider adding a `shutdown-interval` or ensuring `hupper` doesn't attempt to read from `stdin` in non-interactive environments if that's the underlying cause.