Repository navigation
User-visible improvements
-
jug executeandjug invalidatehave new--nameand--patternoptions:jug execute --name function # exactly the tasks called `function` jug execute --name 'function*' # wildcards are supported jug invalidate --pattern compute_ # substring anywhere in the name jug invalidate --pattern '/compute_.*/' # or a /regex/
The old
--target(and--invalid) is now a deprecated synonym of--nameand prints a warning. This makes it stricter than before:jug invalidate --target functionused to also invalidatefunction_other(GH #63), but now only matches tasks calledfunction. If you relied on the loose matching, use--pattern. An empty pattern is an error, sojug invalidate --pattern "$TASK"with an unset variable does not invalidate everything. -
Shell completion. argcomplete is supported, and
jug --print-completion {bash,zsh,tcsh}generates a completion script using shtab. Both are optional dependencies (pip install 'jug[completion]'). -
Tasks with
frozensetarguments get new hashes. Their hashes used to be different in every process for most frozensets, so these tasks were never seen as finished and parallel workers kept re-running them. They are now stable, which means cached results for tasks withfrozensetarguments will be recomputed once. -
jug statusnow exits with status 0 if all tasks are complete and 1 otherwise, likejug check(before, the exit code was the number of finished tasks). With--cachethe exit code is only as accurate as the cache, so do not rely on it in scripts. -
Smaller compatibility changes:
jug.unsafe.NoHashnow passes the value of a wrapped Task to the function (not the Task); a Task inside a subclass oflistortuple(e.g., anamedtuple) now raises aTypeErrorinstead of failing obscurely; the redis backend requires redis-py 3.5 or later. -
A Task's function can now be a
functools.partialobject. -
jug webstatususes the same columns asjug status, shows failed tasks and sorts tasks by name. -
jug executeis faster at selecting the next task when there are many tasks, and--wait-cycle-timeaccepts fractional values.
Bugfixes
Security fix: jug webstatus now escapes jugfile and task names (and only accepts an integer for ?refresh=). Before, these were inserted into the page unescaped, which allowed HTML/JavaScript injection.
jug executewith barriers: waiting is now bounded by--nr-wait-cyclesoverall (it could previously wait for up to about 75 hours), and with--keep-goingfailed tasks are not re-run every time the jugfile is reloaded.- Tasks wrapped in
CustomHash,NoHashor a slice of amapreduce.mapresult are now tracked as dependencies (before, a task could start before its inputs had run).jug checkno longer takes exponential time on diamond-shaped task graphs. - Several
jug pack/file_storefixes: no lost or undone results with concurrent workers, correct handling of numpy arrays and polars DataFrames, and pack files are created with the same permissions as result files (they were unreadable to other users of a shared jugdir). bvalue()only treats a value as unavailable if a task it needs has not run yet, rather than swallowing any error.jug.init(..., store=obj)now installsobjas the store.--pdbimplies--debugand no longer opens a second debugger on exit; boolean flags can be set in configuration files, and "no" is read as false.- Fixed a quadratic slowdown when loading large results (a 64 MiB
bytesobject took over 90 seconds to load). - Fixed
exit_when_true(),jug graph --file-format, slicingmapreduce.mapresults with a step, and reading UTF-8 jugfiles under a non-UTF-8 locale.
Internal updates
- The documentation is now written in Markdown, the examples were updated to match current behaviour and subcommands, options, backends and hooks that were missing are now documented.
- Python 3.9 is no longer supported. Jug now requires Python 3.10 or later. Python 3.15 is now supported.