Runcommands

Latest version: v1.0a72

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

Scan your dependencies

Page 10 of 13

1.0a20

Added

- Started adding tests.
- `stty sane` is now run when a local process exits. This feels pretty hacky
and probably won't work on Windows.

Changed

- Re-revamped config stuff

Interpolation-related changes:

- Interpolation is now done when config values are retrieved instead of
interpolating all values up front. This allows a value to be changed
and any dependent values to be updated automatically.
- Interpolation now works with any value type, not just strings.
- It's now possible to do things like this in config files:

x = [1, 2, 3]
; y will be a list
y = ${y}
; z will be a string
z = "${y}"

Breaking changes:

- Renamed `RawConfig._clone()` to `copy()`.
- Removed `RawConfig._overrides()` context manager because it didn't seem
all that useful (just copy instead).
- `${...}` is now used instead of `{...}` for interpolation. Config
values are now parsed instead of using `str.format()`.
- When a `dict` or other mapping type is added to a config object, it
will no longer be converted to a `RawConfig` object.

Other changes:

- Added `RawConfig._iter_dotted()`; this was added to make
`RawConfig._to_string()` simpler, but it may have other uses.

- Added `util` package and moved the utilities from the `util` module into
various modules in that package.

Fixed

- Made `Config._get_default_version()` refer directly to
`config.version_getter()` instead of loading it from a string so it works in
subclasses.
- Made `config.version_getter()` work if it's run from anywhere within a git
work tree and not just at the root.
- The `cd` arg passed to `local` command is converted to an absolute path. This
is mainly to support asset paths (which was supported before).
- Added support for `flush` to `Printer.print()` (by not passing it through
to `Printer.colorize()`).

Removed

- `RawConfig._overrides()`
- `RawConfig._clone()` (renamed to `copy()`)
- `util.as_list()` and `util.as_tuple()`; these were holdovers from before
list-type options were supported.

1.0a19

- When getting the default version in `Config`, if a tag is checked out, use
the tag name instead of the short hash.

1.0a18

- Renamed `runners.commands.get_default_prepend_path` utility function to
`get_default_local_prepend_path`.
- Fixed some issues with creating & copying config objects. On Python 3.3
& 3.4, `OrderedDict.__init__` needs to be called.
- Made some internal improvements to local & remote runners.

1.0a17

- When the `--debug` flag is passed to the main script, `RunCommandsError`
exceptions are now raised instead of being caught. Raising these exceptions
actually facilitates debugging. ;)
- Default command options specified via config are now validated. Previously,
nonexistent default options would be silently ignored. Now a `CommandError`
will be raised.
- When reading streams (e.g., when the `local` command is run), `EIO` errors
are now caught and ignored. We already do this when writing, so it makes
sense to do it also when reading. TODO: Review which OS/IO errors can be
caught and safely ignored.
- Revamped config handling. Mainly, this is internal facing. Creation and
handling of config objects is simpler and more consistent.

1.0a16

- Added more documentation.
- `configure()` is now "officially" exported from the top level package (by
adding it to `__all__`).
- The `env` and `debug` config keys are now both copied from the `RunConfig` to
the top level `Config` so you can do `config.env` instead of `config.run.env`
in commands. This is somewhat for backward compatibility and somewhat just
for convenience.
- Improved `util.confirms()`'s `abort_on_unconfirmed` option.
- Fixed a little glitch in the output of `show-config`.

1.0a15

- Default run options can now be specified for individual commands in
`setup.cfg` or `runcommands.cfg` (in sections like `[runcommands:local]`).
- Default `list` and `dict` run options read from `setup.cfg` are now handled
correctly.
- Added support for environment variables corresponding to various run options
(`RUNCOMMANDS_ECHO`, `RUNCOMMANDS_HIDE`, etc). They can be set directly or
via the `runcommands.configure()` function. Environment variables take
precedence over run options read from `setup.cfg`.
- Made it easy to export console scripts for individual commands (by adding
something like `deploy = my.package:deploy.console_script` to a project's
`console_scripts` entry point).
- `list` options are now processed the same way `dict` options are: attempt to
parse them as JSON and fall back to str if that fails.
- Empty command line options are now converted to `None`. Empty values can be
passed using `--opt=` or `--opt ''`.
- Revamped env handling.
- Added handling of keyword-only command function args. Keyword-only args can
only be passed in direct/programmatic calls to a command; they aren't
included in the command line options.
- Made the project bootstrappable. It should be possible now to `git clone` the
project and then run `./commands.py install` to create a virtualenv for
development.
- Reorganized and cleaned up a bunch of stuff.
- Started writing Sphinx/RTD docs.
- Added tox configuration.

Fixed

- Fixed the `command` decorator's first arg: renamed it from `name_or_wrapped`
to `name`.
- When getting the default version via get in `Config`, return `None` if the
current directory isn't a git repo.

Page 10 of 13

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.