summaryrefslogtreecommitdiff
path: root/src/setuptools_scm/_run_cmd.py
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2023-02-25 21:49:56 +0100
committerRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2023-03-11 22:06:31 +0100
commit7d851ecb653d0d8cac3aa332b7a43b6e786d4c79 (patch)
treef7989cc06ce1ab0f82c59d86631e06e427b9ab8b /src/setuptools_scm/_run_cmd.py
parentdb92fbde296782bee7b32c2afc8b9afbb4d24c4a (diff)
downloadsetuptools-scm-7d851ecb653d0d8cac3aa332b7a43b6e786d4c79.tar.gz
refactor: unify command running apis
introduces the _run_cmd private module which is used across the board starts to remove use of the do/do_ex which predate
Diffstat (limited to 'src/setuptools_scm/_run_cmd.py')
-rw-r--r--src/setuptools_scm/_run_cmd.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/setuptools_scm/_run_cmd.py b/src/setuptools_scm/_run_cmd.py
index 83b0b19..14fda9c 100644
--- a/src/setuptools_scm/_run_cmd.py
+++ b/src/setuptools_scm/_run_cmd.py
@@ -61,8 +61,10 @@ def ensure_stripped_str(str_or_bytes: str | bytes) -> str:
def run(
cmd: _t.CMD_TYPE,
cwd: _t.PathT,
+ *,
strip: bool = True,
trace: bool = True,
+ timeout: int = 20,
) -> subprocess.CompletedProcess[str]:
if isinstance(cmd, str):
cmd = shlex.split(cmd)
@@ -81,6 +83,7 @@ def run(
HGPLAIN="1",
),
text=True,
+ timeout=timeout,
)
if strip:
if res.stdout: