Skip to content

Version 2.7.0

Latest

Choose a tag to compare

@luispedro luispedro released this 22 Oct 15:12
· 5 commits to main since this release

User-visible improvements

  • jug execute and jug invalidate have new --name and --pattern options:

    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 --name and prints a warning. This makes it stricter than before: jug invalidate --target function used to also invalidate function_other (GH #63), but now only matches tasks called function. If you relied on the loose matching, use --pattern. An empty pattern is an error, so jug 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 frozenset arguments 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 with frozenset arguments will be recomputed once.

  • jug status now exits with status 0 if all tasks are complete and 1 otherwise, like jug check (before, the exit code was the number of finished tasks). With --cache the exit code is only as accurate as the cache, so do not rely on it in scripts.

  • Smaller compatibility changes: jug.unsafe.NoHash now passes the value of a wrapped Task to the function (not the Task); a Task inside a subclass of list or tuple (e.g., a namedtuple) now raises a TypeError instead of failing obscurely; the redis backend requires redis-py 3.5 or later.

  • A Task's function can now be a functools.partial object.

  • jug webstatus uses the same columns as jug status, shows failed tasks and sorts tasks by name.

  • jug execute is faster at selecting the next task when there are many tasks, and --wait-cycle-time accepts 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 execute with barriers: waiting is now bounded by --nr-wait-cycles overall (it could previously wait for up to about 75 hours), and with --keep-going failed tasks are not re-run every time the jugfile is reloaded.
  • Tasks wrapped in CustomHash, NoHash or a slice of a mapreduce.map result are now tracked as dependencies (before, a task could start before its inputs had run). jug check no longer takes exponential time on diamond-shaped task graphs.
  • Several jug pack / file_store fixes: 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 installs obj as the store.
  • --pdb implies --debug and 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 bytes object took over 90 seconds to load).
  • Fixed exit_when_true(), jug graph --file-format, slicing mapreduce.map results 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.