Command-line usage¶
hmr app.py arg1 arg2
hmr -m mypackage arg1 arg2
python -m reactivity.hmr app.py
hmr app.py executes a file as __main__. hmr -m mypackage resolves the module, or the package's __main__.py, and preserves its package context so relative imports work. Arguments after the entry point are available through sys.argv[1:]. A directory entry is also accepted if it contains __main__.py; use -m when package-relative imports matter.
Run from the project directory: the default reactive include path is the working directory. The CLI runs the entry under an HMR effect and then watches for changes without restarting the interpreter. Press Ctrl+C to stop.
The entry module must finish its top-level execution before watching begins. For an indefinitely running web server, use a supported framework integration rather than wrapping a blocking server launch in hmr app.py.
These commands and package-relative imports were verified with hmr==0.7.6.3, including a real watcher update from an imported module. --help prints usage; missing entries or unresolvable modules produce an error. HMR does not provide a production deployment or process-supervision contract.
from reactivity.hmr.run import *¶
run_path
¶
run_path(entry: str, args: list[str])
Source code in reactivity/hmr/run.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
run_module
¶
run_module(module_name: str, args: list[str])
Source code in reactivity/hmr/run.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
cli
¶
cli(args: list[str] | None = None)
Source code in reactivity/hmr/run.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|