Skip to content

Commit e39b9fe

Browse files
fix #943: extend default timeout to account for github ci issues
1 parent 056584b commit e39b9fe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/setuptools_scm/_run_cmd.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import textwrap
77
import warnings
88
from typing import Callable
9+
from typing import Final
910
from typing import Mapping
1011
from typing import overload
1112
from typing import Sequence
@@ -20,6 +21,11 @@
2021
else:
2122
BaseCompletedProcess = subprocess.CompletedProcess
2223

24+
# pick 40 seconds
25+
# unfortunately github CI for windows sometimes needs
26+
# up to 30 seconds to start a command
27+
28+
BROKEN_TIMEOUT: Final[int] = 40
2329

2430
log = _log.log.getChild("run_cmd")
2531

@@ -126,7 +132,7 @@ def run(
126132
*,
127133
strip: bool = True,
128134
trace: bool = True,
129-
timeout: int = 20,
135+
timeout: int = BROKEN_TIMEOUT,
130136
check: bool = False,
131137
) -> CompletedProcess:
132138
if isinstance(cmd, str):
@@ -174,7 +180,7 @@ def has_command(
174180
name: str, args: Sequence[str] = ["version"], warn: bool = True
175181
) -> bool:
176182
try:
177-
p = run([name, *args], cwd=".", timeout=5)
183+
p = run([name, *args], cwd=".", timeout=BROKEN_TIMEOUT)
178184
if p.returncode != 0:
179185
log.error(f"Command '{name}' returned non-zero. This is stderr:")
180186
log.error(p.stderr)

0 commit comments

Comments
 (0)