Description
# subprocess-tee This package provides a drop-in alternative to `subprocess.run` that captures the output while still printing it in **real-time**, just the way `tee` does. Printing output in real-time while still capturing is valuable for any tool that executes long-running child processes. For those, you do want to provide instant feedback (progress) related to what is happening. ```python # from subprocess import run from subprocess_tee import run result = run("echo 123") result.stdout == "123\n" ``` You can add `tee=False` to disable the tee functionality if you want, this being a much shorter alternative than adding the well known `stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL`. Keep in mind that `universal_newlines=True` is implied as we expect text processing, this being a divergence from the original `subprocess.run`. You can still use `check=True` in order to make it raise CompletedProcess exception when the result code is not zero.
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 0.4.2 | Imported from PyPI (0.4.2) | Low | 4/21/2026 |
| v0.4.2 | ## Bugfixes - Use exec mode when passed a list of strings (#101) @KotlinIsland | Low | 6/17/2024 |
| v0.4.1 | ## Bugfixes - Correct trove metadata related to supported platforms (#90) @ssbarnea - Move mypy config to pyproject.toml (#88) @ssbarnea - Stop using deprecated get_event_loop() (#86) @gotmax23 - Configure packit (#81) @ssbarnea - Add "setuptools >= 61.0" to build system requires (#82) @gotmax23 - Clear build dependencies (#80) @ssbarnea | Low | 12/17/2022 |
| v0.4.0 | ## Minor Changes - Enable support for py311 (#72) @ssbarnea ## Bugfixes - Remove support for py37 (#70) @ssbarnea - Remove support for py36 (#65) @ssbarnea - Mark test test_rich_console_ex as broken (#64) @ssbarnea | Low | 11/25/2022 |
| 0.3.5 | ## Bugfixes * fix: Add support for py310 (#49) @ssbarnea Kudos goes to: @ssbarnea | Low | 10/5/2021 |
| 0.3.4 | ## Bugfixes * Ensure output is displayed by tee (#47) @ssbarnea Kudos goes to: @ssbarnea | Low | 9/13/2021 |
| 0.3.3 | Release yanked due to https://github.com/pycontribs/subprocess-tee/issues/46 ## Bugfixes * Avoid attempt to write to wrong pipe object (#44) @ssbarnea * Avoid resource leaks with os.devnull (#43) @ssbarnea * Keep args the same as subprocess.run (#40) @ssbarnea * Bump linters (#41) @ssbarnea Kudos goes to: @ssbarnea | Low | 9/6/2021 |
| 0.3.2 | ## Changes ## Bugfixes * Extend stream limit to 8MB (#39) @ssbarnea | Low | 6/5/2021 |
| 0.3.1 | ## Changes ## Minor Changes * Add tee optional argument (#37) @ssbarnea ## Bugfixes * Assure returned stderr matches one from subprocess.run (#35) @ssbarnea * Assure check with success does not raise (#34) @ssbarnea | Low | 4/12/2021 |
| 0.3.0 | ## Changes ## Bugfixes * Keep devnull use compatible with subprocess.run (#33) @ssbarnea * Assure check=True is supported (#31) @ssbarnea * There is no need for a 'rich' extra (#27) @stoned * Increase asyncio.create_subprocess_shell limit (#28) @apatard | Low | 4/11/2021 |
| 0.2.0 | ## Changes ## Major Changes * Remove custom rich console (#24) @ssbarnea | Low | 12/19/2020 |
| 0.1.6 | ## Changes * Add release-drafter workflow (#23) @ssbarnea * Update minimum version of pytest (#20) @Chedi ## Bugfixes * Allow cwd on run (#22) @ssbarnea | Low | 12/3/2020 |
| 0.1.5 | ## Changes ## Minor Changes * Add testing of rich html_export (#13) @ssbarnea | Low | 11/9/2020 |
| 0.1.4 | ## Changes * No changes | Low | 11/7/2020 |
| 0.1.3 | ## Changes ## Bugfixes * Replace implicit shell with /bin/sh (#16) @ssbarnea * Make package PEP 561 compliant (#14) @ssbarnea | Low | 11/2/2020 |
| 0.1.2 | ## Changes ## Bugfixes * Allow passing env (#12) @ssbarnea | Low | 10/27/2020 |
| 0.1.1 | ## Changes ## Bugfixes * Correct optional echoing (#11) @ssbarnea * Fixed calling run with list (#10) @ssbarnea | Low | 10/26/2020 |
| 0.1 | ## Changes ## Minor Changes * Added ConsoleEx class for rich users (#4) @ssbarnea * Document package purpose (#2) @ssbarnea ## Bugfixes * Fixed deprecation warning around asyncio usage (#5) @ssbarnea | Low | 10/25/2020 |
