Runcommands

Latest version: v1.0a71

Safety actively analyzes 631215 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 12 of 13

1.0a7

- Renamed package from `taskrunner` to `runcommands`. The latter name is
available on PyPI and the term "command" is perhaps less ambiguous
than "task".
- Fleshed out the Paramiko remote runner a bit. It now A) works and B) caches
connections per user/host. Needs review/testing. Should be made more robust
in dealing with auth and network issues.

1.0a6

- Added `RemoteRunner` class.
- Added a start at a Paramiko-based remote runner as an alternative to shelling
out to `ssh`. Work in progress.
- Moved `NonBlockingStreamReader` into a separate module for potential reuse.
E.g., it might be useful in the Paramiko-based remote runner.
- Made `NonBlockingStreamReader` handle text streams. I.e., we no longer assume
all streams are byte streams.
- Improved handling of output in `LocalRunner`/`NonBlockingStreamReader`.
Streams can be closed after a subprocess exits, so we have to account for
this.
- Added `Parameter.takes_value` and `Parameter.takes_option_value`. These can
be easier to use in some cases than checking for `is_bool` (just because the
meaning is more clear).
- Improved completion by correctly handling options that don't take values.
This makes use of `Parameter.takes_option_value`.
- Added `abort_on_unconfirmed` option to `confirm`.
- Added `prompt` utility function.
- Added `release` command.

1.0a5

- Added `timeout` option to `local` command. Set default timeout for `local`
command to `None` (no timeout by default).
- Added `timeout` option to `remote` command. The default timeout for remote
commands is 30 seconds.
- Fleshed out command line completion, especially for Bash. It now works pretty
well.
- Fixed a bug in the `show_config` command where it failed to abort when a bad
`name` was passed.

1.0a4

Major changes

- Added `config` option to `Command`/`command`. This makes specifying override
config for a command easy. Useful for overriding default command config
options when most commands use those defaults but one or two don't.
- Added initial handling of `dict`. The logic for parsing `-o name=value`
options was moved into the `command` module.
- Added initial handling of `list`/`tuple` command options.
- Added initial completion support; a sample bash completion script is
provided.
- Added `Result.__bool__()` because `if command(config): ...` is convenient in
some cases.
- The default version set in `Config` is now the short hash of the HEAD of the
git repo in the current directory instead of `'X.Y.Z'`. This is easy to
override by setting `version_getter = module:getter` in the project's command
config.
- Revamped internals of `LocalRunner`. In particular, improved handling of
in/out/err stream data (but this is tricky to get right, so more work may be
needed). When decoding stream data, the encoding is now read from the locale
instead of hard coding 'UTF-8'.
- Reimplemented `main` script so that it's just an entry point; moved the logic
of running commands into `commands.run()`.
- Fixed a typo/bug in `RawConfig._clone()`; was calling `clone()` instead of
`_clone()` when descending into sub-config objects.

Other changes

- Made the `commands_module` arg to `CommandRunner.load_commands()` optional;
use `self.commands_module` by default.
- Limited width of short command listing to 80 columns.
- Improved output of `show_config` when `--name` is used and refers to a config
object (by descending into the config object).
- Added `Printer.echo()` for echoing commands and the like; it uses the same
color as `Printer.debug()` because A) echoing is largely used for debugging
and B) there aren't that many colors to choose from.
- Fixed "danger" color in printer utility; was cyan for some reason instead of
red.

1.0a3

Third alpha version.

- Don't allow options to be passed via `-o` when there's a corresponding
script option; being able to pass the same option via two different vectors
seems like it could be confusing.
- Add `_overrides` option to `RawConfig`; simplifies updating a config object
with overrides without needing to make a separate call to do the update.
- Add `RawConfig._clone(**overrides)` method.
- Improve output of `runcommands -l`, the condensed command listing. Use the
current terminal width to format commands into rows without mid-word
wrapping.
- Show condensed command listing when no commands are specified. The long
command listing is really verbose and not that useful in this case.
- Add `-H` alias for `--hide` to main script.
- Standardize on `-E` for commands that have and `echo` option and `-H` for
commands that have a `hide` option. This also leaves `-h` available for
command help.
- Use `-h` for command help. If a command has multiple H options, the first
will get `-H` (unless the command also has a `hide` option) and the second
won't get a short option name.
- Normalize command option names more by stripping dashes (after converting
underscores to dashes) and lower-casing.

1.0a2

Second alpha version.

- Attempt to fix buffering issues when running subprocesses via `LocalRunner`.
I say "attempt" because this is pretty complex and hard to get just right.
- Allow arbitrary config options to passed via the command line via `-o`; these
options take precedence over config set via config file.
- Improve (color) printer utility. Put the various color printing functions in
a class and create a default instance of that class so that this instance can
be imported instead of having to import the functions individually.
- Print warning, error, and debug messages to stderr by default.
- Make it easier to determine if stdout and/or stderr should be hidden by
adding some utility class methods to the `Hide` enum.
- Only set the `hide` option for a command from the global config value if the
command's default is `hide=None`. TODO: Something similar for `echo`, but
that's a bit harder.
- Remove unused imports, clean other lint, add `__all__` lists where
appropriate, etc.

Page 12 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.