PaulHowarth/Blog/2020-01-05

Sunday 5th January 2020

Fedora Project

  • Updated python-invoke to 1.4.0 in Rawhide:

    • A corner case in ~invoke.context.Context.run caused overridden streams to be unused if those streams were also set to be hidden, e.g. 'run(command, hide=True, out_stream=StringIO())' would result in no writes to the 'StringIO' object (GH#637); this has been fixed - hiding for a given stream is now ignored if that stream has been set to some non-'None' (and in the case of 'in_stream', non-'False') value

    • As part of feature work on GH#682, we noticed that the '~invoke.runners.Result' return value from '~invoke.context.Context.run' was inconsistent between dry-run and regular modes; for example, the dry-run version of the object lacked updated values for 'hide', 'encoding' and 'env' - this has been fixed

    • Add asynchronous behaviour to '~invoke.runners.Runner.run' (GH#194, GH#682):

      • Basic asynchronicity, where the method returns as soon as the sub-process has started running, and that return value is an object with methods allowing access to the final result
      • "Disowning" sub-processes entirely, which not only returns immediately but also omits background threading, allowing the sub-processes to outlive Invoke's own process
      • See the updated API docs for the '~invoke.runners.Runner' for details on the new 'asynchronous' and 'disown' kwargs enabling this behaviour

    • Never accompanied the top-level singleton '~invoke.run' (which simply wraps an anonymous '~invoke.context.Context's 'run' method) with its logical sibling, '~invoke.sudo' - this has been remedied

  • I also updated the package to enable most of the test suite at package build time; I sent one patch upstream and added a workaround for test failures with more recent versions of pytest (handing of stdin in more recent pytest versions breaks runner tests, similar to GH#530)


Recent