Install & Compatibility
Where this runs
tested against v0.6.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.994s · 27.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.3s · import 0.888s · 28MB
24MB installed
● package 24MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
watch
✓ import jurigged
jurigged.watch()
To enable programmatic file watching, e.g., in an IPython/Jupyter session, or to explicitly start watching in a script.
To use jurigged, you can either run your script with `jurigged your_script.py` from the command line, or programmatically call `jurigged.watch()` within your script. Create a file named `my_app.py` with the code above. Run it using `jurigged my_app.py`. Then, modify the `greet` function (e.g., to `return "Hello, updated Jurigged!"`) and save the file. You will see the output change live without restarting the script.
import jurigged
import time
def greet():
return "Hello, Jurigged!"
def main():
jurigged.watch()
print("Watching for changes... edit this file and save!")
while True:
print(greet())
time.sleep(2)
if __name__ == '__main__':
main()
jurigged --version
Debug
Known issues
gotchaFunctions that are currently executing or are part of an active generator/async function will continue to run with their original code. Only subsequent invocations will reflect the changes. Breakpoints on the stack cannot be changed.fixChanges apply to the next execution of the function. For critical debugging, a full restart might be necessary, or consider alternative debugging approaches.
affects: All versions
breakingChanging class initializers (`__init__`) or attribute names can lead to broken objects. Jurigged updates methods on existing instances but does not re-run `__init__` or rename attributes, potentially causing inconsistencies between new methods and old data.fixCarefully manage changes to class structure, especially `__init__` and attribute definitions, during live updates. For substantial structural changes, a full application restart is recommended.
affects: All versions
gotchaUpdating code for decorators or closures may not work reliably. Decorators that inspect or modify function code might not update properly, potentially leading to unexpected behavior or stale logic.fixAvoid making live changes to decorator definitions or the functions they wrap in complex ways. If modifications are essential, a restart is often the safest approach.
affects: All versions
gotchaChanging top-level module code (outside of `if __name__ == '__main__':`) can cause the `jurigged` watcher thread to stop, preventing further hot reloads. This is particularly problematic if the top-level code includes long-running loops.fixAlways place your main application logic within an `if __name__ == '__main__':` block. `jurigged` will then re-execute only the diff if this guard is not touched.
affects: All versions
gotchaLine numbers in patched code can sometimes diverge, leading to incorrect line numbers in stack traces, debugger breakpoints drifting, and unexpected behavior. This issue is more prevalent with complex functions, nested functions, or altered decorator calls.fixIf line number inconsistencies occur, restarting the application is the most reliable solution. For complex scenarios, consider simplifying the hot-reloaded code or improving test coverage to catch these issues early.
affects: All versions (reported in issues up to March 2025)
gotchaFile watching mechanisms can be inconsistent. Specifically, `watchdog` on Windows may watch directories rather than individual files, and some editors (like `vi` saving to temporary swap files) can cause issues. There are also no direct hooks for cleanup on hot reload, which can complicate state management for applications like web servers that manage connections.fixIf file changes are not detected, try using the `--poll <INTERVAL>` flag (e.g., `jurigged --poll 1 your_script.py`). For applications requiring specific cleanup, consider implementing manual restart mechanisms or architectural patterns that tolerate abrupt code changes.
affects: All versions (some `vi` issues fixed from v0.3.5)
Errors
Common errors & fixes
Jurigged said it updated the function but it's still running the old code.
Functions that are already running will continue to execute with the old code; only subsequent invocations will use the new code. This commonly affects active loops, generators, or asynchronous functions.
fixFor code within a `for` loop, extract the loop's body into its own helper function. For generators or async functions, ensure the function is re-entered for the changes to take effect. Alternatively, consider using the `reloading` library in conjunction with `jurigged` for more comprehensive loop reloading.
The file is not being watched. / The file is watched, but nothing happens when I change the function.
By default, `jurigged` watches files in the current working directory. Issues can arise if the file is outside this directory, if your editor saves files by moving a temporary file (rather than directly modifying it), or due to problems with the underlying OS native file watching mechanisms.
fixExplicitly tell `jurigged` which files or directories to watch using `jurigged -w <file>` or `jurigged -w /`. If changes still aren't detected, try using polling by adding the `--poll <INTERVAL>` flag (e.g., `jurigged --poll 0.5`) to force `jurigged` to check for file changes at regular intervals instead of relying on OS events.
line numbers for breakpoints start to drift by 1 / stack traces do not match up
Jurigged's patching process can cause the line numbers in the reloaded code to diverge from the original source, leading to incorrect line reporting in debuggers, stack traces, and introspection libraries like `varname`. This is a known bug, especially with complex modifications to nested functions, decorators, or class definitions.
fixThis is a known bug within the library, and there isn't a direct code fix for users. A common workaround is to restart the application when encountering these debugging inconsistencies. For `pytest` assertion rewrites, the library would need to implement a hook capability on reevaluation.
AttributeError: 'NoneType' object has no attribute '__code__' (or similar AttributeError/unexpected behavior on existing instances after class definition changes)
`jurigged` updates existing instances of a class with new methods but does not re-run the `__init__` method or rename attributes on those existing instances. This can lead to objects having new methods but old data, resulting in `AttributeError` or other runtime inconsistencies.
fixWhen making fundamental changes to a class's `__init__` method or modifying/renaming attributes, it is often necessary to restart the application to ensure all instances are properly initialized with the new structure. Design classes to gracefully handle missing or changed attributes, or ensure changes are made early in development cycles before instances accumulate.
ModuleNotFoundError: No module named 'jurigged'
The `jurigged` library has not been installed in your current Python environment.
fixInstall the library using pip: `pip install jurigged`.
Upgrade
Version history
0.6.1latest on PyPI · released May 13, 2025
Audit
Dependencies
watchdogrequiredUsed for monitoring file system changes to trigger hot reloads.