running-process
Advanced tools
+1
-1
| Metadata-Version: 2.4 | ||
| Name: running_process | ||
| Version: 1.0.6 | ||
| Version: 1.0.7 | ||
| Summary: A modern subprocess.Popen wrapper with improved process management | ||
@@ -5,0 +5,0 @@ Project-URL: Homepage, https://github.com/yourusername/running-process |
+5
-5
@@ -8,9 +8,9 @@ running_process/__init__.py,sha256=0SbyaLazVhgiWX4w6n21kMj2gMIVYSBtTxEARfEy3ow,690 | ||
| running_process/pty.py,sha256=KfRutEF4dZyLRc4h0Wvl7nRbiM3zqHuibX4MaV7SEYY,8147 | ||
| running_process/running_process.py,sha256=I1cqqZF4aE-1dMAka0378lsteOzFcltDikGeWj0OICk,40637 | ||
| running_process/running_process.py,sha256=RWhaTUfqjTi-NhaQQ4d0-L8OiR9QXEivad356NHnMFc,42730 | ||
| running_process/running_process_manager.py,sha256=xx_kmXw9j-hjOI_pRrlTKdc9yekKBVQHhUq1eDpBGJU,2467 | ||
| running_process/subprocess_runner.py,sha256=O_Wwe2vrXWnYkiNEpauNLre3PqNO3uDogrRz0JCkH7M,3223 | ||
| running_process/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54 | ||
| running_process-1.0.6.dist-info/METADATA,sha256=XQ-Kc4wqKF-ltPpXANXhW-aer1sNXQdEz4nPJgZ4uig,8465 | ||
| running_process-1.0.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87 | ||
| running_process-1.0.6.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064 | ||
| running_process-1.0.6.dist-info/RECORD,, | ||
| running_process-1.0.7.dist-info/METADATA,sha256=-op6vAtBOV9YRYox3xsWuhgNaAG5eYnJA7YvQj9lqzo,8465 | ||
| running_process-1.0.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87 | ||
| running_process-1.0.7.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064 | ||
| running_process-1.0.7.dist-info/RECORD,, |
@@ -1000,3 +1000,56 @@ """Enhanced subprocess execution with timeout protection, output streaming, and process tree management. | ||
| @classmethod | ||
| def run_streaming( | ||
| cls, | ||
| cmd: list[str], | ||
| env: dict[str, str] | None = None, | ||
| cwd: str | None = None, | ||
| timeout: float | None = None, | ||
| stdout_callback: Callable[[str], None] | None = None, | ||
| stderr_callback: Callable[[str], None] | None = None, | ||
| **kwargs: Any, | ||
| ) -> int: | ||
| """Convenience classmethod for running a command with streaming output. | ||
| This method provides backwards compatibility for code that uses the clud-style | ||
| run_streaming API. It creates a RunningProcess instance and waits for completion | ||
| with an echo callback. | ||
| Note: stderr is automatically merged into stdout in RunningProcess, so stderr_callback | ||
| is accepted but ignored for API compatibility. | ||
| Args: | ||
| cmd: Command and arguments to execute as list of strings | ||
| env: Environment variables for the process (optional) | ||
| cwd: Working directory for the process (optional) | ||
| timeout: Optional timeout in seconds | ||
| stdout_callback: Optional callback for stdout lines (default: print to stdout) | ||
| stderr_callback: Optional callback for stderr lines (IGNORED - for API compatibility only) | ||
| **kwargs: Additional arguments (currently unused, for API compatibility) | ||
| Returns: | ||
| Process exit code | ||
| Raises: | ||
| TimeoutError: If timeout is exceeded | ||
| """ | ||
| # Use stdout_callback if provided, otherwise print | ||
| echo_callback: EchoCallback = stdout_callback if stdout_callback is not None else print | ||
| # Convert cwd string to Path if provided | ||
| cwd_path = Path(cwd) if cwd is not None else None | ||
| # Create and run process | ||
| process = cls( | ||
| command=cmd, | ||
| cwd=cwd_path, | ||
| env=env, | ||
| timeout=int(timeout) if timeout is not None else None, | ||
| auto_run=False, # Don't auto-run, we'll call start() explicitly | ||
| ) | ||
| process.start() | ||
| return process.wait(echo=echo_callback, timeout=timeout) | ||
| # NOTE: RunningProcessManager and its singleton live in running_process_manager.py | ||
@@ -1003,0 +1056,0 @@ |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.