Runcommands

Latest version: v1.0a71

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

Scan your dependencies

Page 10 of 13

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.

1.0a14

Added

- Default args for the main script will now be read from `runcommands.cfg` or
`setup.cfg` if one of those is present and contains a `[runcommands]`
section.
- Added ability to list available envs to main script (`--list-envs`).
- Added support for bool-or-type options. This is used with `hide` options.
- Added support for args that specify choices. Added `choices` arg to
`Command`.
- Added support for `Enum` args. These args will be limited to the choices
specified by the enum.
- `commands_module` is now included in config.

Changed/Improved

- Command line option names for `dict` and `list` args are now made singular
when they end with an `s`. From the command line, dicts and lists are created
by using a given option multiple times. Using a singular name makes this more
clear.
- Improved `show-config` command. Added `--flat` flag (don't nest config).
Added `--values` flag (show values only without keys. Added ability to
specify multiple items. Added `--exclude` option.
- Made default type of `hide` args for all commands `bool_or(Hide)`.
- Improved handling of arg types in general.
- Removed fill/wrap code; use `textwrap.fill()` from the stdlib instead.
- Wrapped entire body of main script in try block. `RunCommandsError` is now
raised in some places. These keep the main script from blowing up with
a stack trace in cases where it's better to abort with a nice error message.

Fixed

- Fixed a one-off bug with `--` in the main script. Skip over it so it's not
treated as a command arg.
- Fixed an issue in `Printer.print()` where the `file` arg wasn't being passed
down to `print()`, which was causing warning, error, and debug messages to be
sent to stdout instead of stderr.
- Fixed `RawConfig` so it doesn't read files when adding items or cloning.

Page 10 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.