pypyr release v5.5.0
concurrent cmds & cmdOut dot notation
Release Date: 2022-05-26T13:18:48Z
- Introduce pypyr.steps.cmds &
pypyr.steps.shells to run programs or
shell statements asynchronously as parallel (concurrent) sub-processes.
- This means all the parallel commands start at the same time and run concurrently, rather than run serially one after the other.
- name: pypyr.steps.cmds
comment: copy 3 files concurrently
in:
cmds:
- cp file1.ext /media/vol1/
- cp file2.ext /media/vol2/file2-archive.ext
- cp file3.ext /media/vol3/
cmdOut
for pypyr.steps.cmd & pypyr.steps.shell gets dotted attribute access.- instead of
cmdOut[returncode]
access value like this:cmdOut.returncode
- backwards compatible - the old-style dict-like accessors will still work.
- This applies to the old serial cmd/shell steps, and also to the new parallel cmds/shells steps introduced in this release.
- Where previously you had to use the cumbersome dict-style [accessors] you can now use dotted attribute access instead::
- instead of
# old style
- name: pypyr.steps.echo
run: !py "cmdOut['returncode'] == 0"
in:
echoMe: "you'll only see me if cmd ran successfully with return code 0.
the command output was: {cmdOut[stdout]}.
the error output was: {cmdOut[stderr]}."
# new style
- name: pypyr.steps.echo
run: !py cmdOut.returncode == 0
in:
echoMe: "you'll only see me if cmd ran successfully with return code 0.
the command output was: {cmdOut.stdout}.
the error output was: {cmdOut.stderr}."
- Set default encoding for all the cmd/shell steps using
default_cmd_encoding
in config.
- You can use the $env variable PYPYR_CMD_ENCODING to initialize this value, in addition to the usual config files.
what’s changed
- async cmds + shells by @yaythomas in https://github.com/pypyr/pypyr/pull/274
- release 5.5 & default_cmd_encoding for serial by @yaythomas in https://github.com/pypyr/pypyr/pull/276
Full Changelog: https://github.com/pypyr/pypyr/compare/v5.4.0...v5.5.0
how to upgrade
If you want to upgrade (and you totally should!):
$ pip install --upgrade pypyr
source
You can find pypyr release v5.5.0 on github, where you can click through to associated Issues, Pull Requests and Users.
Released by yaythomas.