Runcommands

Latest version: v1.0a71

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

Scan your dependencies

Page 11 of 13

1.0a13

- Improved command env handling and options.

1.0a12

- Fixed a bug when raising `TimeoutExpired` exception in `LocalRunner`. The
captured output data is bytes and needs to be decoded.
- Improved handling of non-existent commands module or config file. Catch
exceptions and raise an appropriate `RunCommandsError` instead. The main
script catches these errors and aborts with a useful message instead of
spewing a traceback.
- Improved `release` command's automatic next version detection. In particular,
it can now derive `1.0aN` from `1.0aM`.

1.0a11

- Fixed potential decoding errors when capturing subprocess data. Captured data
is no longer decoded eagerly, which avoids decoding errors when the data read
ends with an incomplete Unicode byte sequence. This was an issue for commands
that output a lot of data, like `npm install`.

1.0a10

- Improved input/output mirroring/capture in `LocalRunner`.
- Fixed input mirroring issue with subprocesses that accept single character
input (like `less`).
- Added loop to read until no more data is available after subprocess exits.
- Added `COLUMNS` and `LINES` to subprocess environment when using PTY so
output isn't constrained to the default terminal size.
- Made more robust by checking for closed streams when reading, closing PTY
file descriptors, etc.
- Moved read/mirror/capture code into its own module for potential reuse.
- Made an attempt to fix the Paramiko remote runner strategy using the
`select`-based reader, but it didn't work because the file handles returned
by `SSHClient.exec_command()` aren't "real" files (they don't have
a `fileno()` method).

1.0a9

- Simplified handling of input/output in `LocalRunner`. Instead of firing up
reader threads, this version uses `select`. This seems to actually work in
all cases now (PTY vs non-PTY), but it won't work on Windows. It also breaks
the Paramiko remote runner strategy (since `NonBlockingStreamReader` was
removed). It might be possible to create a thread-based version of the same
logic...
- In `get_default_prepend_path`, bad asset paths are now skipped over and
a warning is printed. This fits with how non-existent path directories are
skipped. Previously, a bad asset path would cause a nasty `ImportError`.
- Improved `util.asset_path`:
- Inject `config` into path at top instead of at bottom.
- Raise a better error when a path contains an unimportable package.
- Added `clean` command.

1.0a8

- Underscores in command names are now replaced with dashes. This is just an
aesthetic preference.
- Fixed an issue with completion where it would always provide options for the
last command on the command line even if the cursor was moved before the last
command.
- Removed distinction between `-l` and `--list` main script options. `-l` used
to show a short listing of commands (i.e., just their names) and `--list`
would show a long listing with usage strings. Both now show the short
listing. The output of `--list` was long and cluttered and with completion
working it no longer seems necessary.
- When printing help for a command, the command function's entire docstring is
now shown.
- When running the main script, we now check for any kind of `RunCommandsError`
and print an error message (instead of spewing a traceback) when one is
raised. In particular, this catches a bad/missing `--env`.
- Made some low-level improvements to the local runner class:
- Fixed some issues with prompting for user input by fixing issues with how
subprocesses' stdout/stderr are read and mirrored back to the controlling
terminal.
- Added initial PTY support.

Page 11 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.