[{"data":1,"prerenderedAt":2792},["ShallowReactive",2],{"page-\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fhandling-subprocess-timeouts-and-exit-codes\u002F":3,"content-directory":2245},{"id":4,"title":5,"body":6,"date":2230,"description":2231,"difficulty":2232,"draft":2233,"extension":2234,"meta":2235,"navigation":169,"path":2236,"seo":2237,"stem":2238,"tags":2239,"updated":2230,"__hash__":2244},"content\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fhandling-subprocess-timeouts-and-exit-codes\u002Findex.md","Handling Subprocess Timeouts and Exit Codes",{"type":7,"value":8,"toc":2208},"minimark",[9,31,36,57,65,91,95,111,115,128,781,800,823,826,845,849,856,859,910,917,1490,1495,1502,1533,1540,1544,1580,1584,1587,2081,2094,2098,2110,2114,2121,2131,2138,2141,2150,2161,2165,2172,2176,2204],[10,11,12,16,17,20,21,24,25,30],"p",{},[13,14,15],"code",{},"subprocess.run(argv, timeout=30)"," looks like a complete answer to \"what if the child hangs?\" It is not. It kills only the process you started, so a ",[13,18,19],{},"npm run build"," or ",[13,22,23],{},"sh -c"," wrapper dies while the real work carries on underneath, holding ports and file locks. And once the child is gone you still have to decide what your own CLI exits with: pass the child's code through, map it, or collapse everything to 1? This guide covers enforcing timeouts that actually stop the work, reading return codes correctly — including the negative ones — and turning all of it into exit codes a calling script can rely on. It extends the helper from ",[26,27,29],"a",{"href":28},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fcalling-external-commands-safely-with-subprocess\u002F","calling external commands safely with subprocess",".",[32,33,35],"h2",{"id":34},"prerequisites","Prerequisites",[37,38,39,43,46],"ul",{},[40,41,42],"li",{},"Python 3.10+, on Linux or macOS for the process-group examples (Windows differences are noted where they matter).",[40,44,45],{},"A CLI built with Typer or Click.",[40,47,48,49,52,53,56],{},"A basic understanding of signals — at least that ",[13,50,51],{},"SIGTERM"," asks a process to stop and ",[13,54,55],{},"SIGKILL"," forces it.",[32,58,60,61,64],{"id":59},"what-timeout-really-does","What ",[13,62,63],{},"timeout="," really does",[10,66,67,68,71,72,75,76,79,80,82,83,86,87,90],{},"When the deadline passes, ",[13,69,70],{},"subprocess.run()"," calls ",[13,73,74],{},"kill()"," on the child, waits for it to exit, and raises ",[13,77,78],{},"TimeoutExpired",". On POSIX that is ",[13,81,55],{},": immediate, uncatchable, no cleanup. The exception carries whatever output was captured so far in ",[13,84,85],{},"exc.stdout"," and ",[13,88,89],{},"exc.stderr"," (as bytes, even if you asked for text in some Python versions — decode defensively).",[92,93],"inline-diagram",{"name":94},"sp-timeout-timeline",[10,96,97,98,102,103,106,107,110],{},"Two things follow. First, the child gets no chance to clean up — temporary files stay, a half-written output file stays half-written. Second, and worse, ",[99,100,101],"strong",{},"grandchildren survive",". If you ran ",[13,104,105],{},"[\"npm\", \"run\", \"build\"]",", npm is killed, but the ",[13,108,109],{},"node"," process it spawned is re-parented to init and keeps running. The next invocation of your tool then fails with \"port already in use\" or finds a lock file it cannot explain.",[32,112,114],{"id":113},"the-recipe-a-deadline-that-kills-the-whole-tree","The recipe: a deadline that kills the whole tree",[10,116,117,118,121,122,124,125,127],{},"The robust approach is to start the child in its own ",[99,119,120],{},"process group"," (a new session), and when the deadline passes, signal the group: first ",[13,123,51],{}," so well-behaved programs can clean up, then ",[13,126,55],{}," after a grace period.",[129,130,135],"pre",{"className":131,"code":132,"language":133,"meta":134,"style":134},"language-python shiki shiki-themes github-light github-dark","# src\u002Fmytool\u002Fdeadline.py\nfrom __future__ import annotations\n\nimport os\nimport signal\nimport subprocess\nimport sys\nfrom dataclasses import dataclass\n\nGRACE_SECONDS = 5.0\n\n\n@dataclass(frozen=True)\nclass Outcome:\n    returncode: int\n    timed_out: bool\n    stdout: str\n    stderr: str\n\n\ndef _terminate_tree(proc: subprocess.Popen[str]) -> None:\n    \"\"\"Ask the whole group to stop, then force it.\"\"\"\n    if sys.platform == \"win32\":\n        proc.kill()  # TerminateProcess; use a job object for true trees\n        return\n    try:\n        os.killpg(proc.pid, signal.SIGTERM)\n    except ProcessLookupError:\n        return\n    try:\n        proc.wait(timeout=GRACE_SECONDS)\n    except subprocess.TimeoutExpired:\n        os.killpg(proc.pid, signal.SIGKILL)\n\n\ndef run_with_deadline(argv: list[str], timeout: float) -> Outcome:\n    popen_kwargs: dict = dict(\n        stdout=subprocess.PIPE,\n        stderr=subprocess.PIPE,\n        stdin=subprocess.DEVNULL,\n        text=True,\n        encoding=\"utf-8\",\n        errors=\"replace\",\n    )\n    if sys.platform == \"win32\":\n        popen_kwargs[\"creationflags\"] = subprocess.CREATE_NEW_PROCESS_GROUP\n    else:\n        popen_kwargs[\"start_new_session\"] = True\n\n    proc = subprocess.Popen(argv, **popen_kwargs)\n    try:\n        out, err = proc.communicate(timeout=timeout)\n        return Outcome(proc.returncode, False, out, err)\n    except subprocess.TimeoutExpired:\n        _terminate_tree(proc)\n        out, err = proc.communicate()\n        return Outcome(proc.returncode, True, out, err)\n    except BaseException:\n        _terminate_tree(proc)   # Ctrl+C or any error: never leave the tree running\n        proc.communicate()\n        raise\n","python","",[13,136,137,146,164,171,180,188,196,204,217,222,234,239,244,267,279,288,297,306,314,319,324,347,354,371,380,386,394,404,415,420,427,442,450,459,464,469,491,508,525,539,554,566,579,592,598,611,631,639,654,659,676,683,701,716,723,729,739,750,760,769,775],{"__ignoreMap":134},[138,139,142],"span",{"class":140,"line":141},"line",1,[138,143,145],{"class":144},"sJ8bj","# src\u002Fmytool\u002Fdeadline.py\n",[138,147,149,153,157,160],{"class":140,"line":148},2,[138,150,152],{"class":151},"szBVR","from",[138,154,156],{"class":155},"sj4cs"," __future__",[138,158,159],{"class":151}," import",[138,161,163],{"class":162},"sVt8B"," annotations\n",[138,165,167],{"class":140,"line":166},3,[138,168,170],{"emptyLinePlaceholder":169},true,"\n",[138,172,174,177],{"class":140,"line":173},4,[138,175,176],{"class":151},"import",[138,178,179],{"class":162}," os\n",[138,181,183,185],{"class":140,"line":182},5,[138,184,176],{"class":151},[138,186,187],{"class":162}," signal\n",[138,189,191,193],{"class":140,"line":190},6,[138,192,176],{"class":151},[138,194,195],{"class":162}," subprocess\n",[138,197,199,201],{"class":140,"line":198},7,[138,200,176],{"class":151},[138,202,203],{"class":162}," sys\n",[138,205,207,209,212,214],{"class":140,"line":206},8,[138,208,152],{"class":151},[138,210,211],{"class":162}," dataclasses ",[138,213,176],{"class":151},[138,215,216],{"class":162}," dataclass\n",[138,218,220],{"class":140,"line":219},9,[138,221,170],{"emptyLinePlaceholder":169},[138,223,225,228,231],{"class":140,"line":224},10,[138,226,227],{"class":155},"GRACE_SECONDS",[138,229,230],{"class":151}," =",[138,232,233],{"class":155}," 5.0\n",[138,235,237],{"class":140,"line":236},11,[138,238,170],{"emptyLinePlaceholder":169},[138,240,242],{"class":140,"line":241},12,[138,243,170],{"emptyLinePlaceholder":169},[138,245,247,251,254,258,261,264],{"class":140,"line":246},13,[138,248,250],{"class":249},"sScJk","@dataclass",[138,252,253],{"class":162},"(",[138,255,257],{"class":256},"s4XuR","frozen",[138,259,260],{"class":151},"=",[138,262,263],{"class":155},"True",[138,265,266],{"class":162},")\n",[138,268,270,273,276],{"class":140,"line":269},14,[138,271,272],{"class":151},"class",[138,274,275],{"class":249}," Outcome",[138,277,278],{"class":162},":\n",[138,280,282,285],{"class":140,"line":281},15,[138,283,284],{"class":162},"    returncode: ",[138,286,287],{"class":155},"int\n",[138,289,291,294],{"class":140,"line":290},16,[138,292,293],{"class":162},"    timed_out: ",[138,295,296],{"class":155},"bool\n",[138,298,300,303],{"class":140,"line":299},17,[138,301,302],{"class":162},"    stdout: ",[138,304,305],{"class":155},"str\n",[138,307,309,312],{"class":140,"line":308},18,[138,310,311],{"class":162},"    stderr: ",[138,313,305],{"class":155},[138,315,317],{"class":140,"line":316},19,[138,318,170],{"emptyLinePlaceholder":169},[138,320,322],{"class":140,"line":321},20,[138,323,170],{"emptyLinePlaceholder":169},[138,325,327,330,333,336,339,342,345],{"class":140,"line":326},21,[138,328,329],{"class":151},"def",[138,331,332],{"class":249}," _terminate_tree",[138,334,335],{"class":162},"(proc: subprocess.Popen[",[138,337,338],{"class":155},"str",[138,340,341],{"class":162},"]) -> ",[138,343,344],{"class":155},"None",[138,346,278],{"class":162},[138,348,350],{"class":140,"line":349},22,[138,351,353],{"class":352},"sZZnC","    \"\"\"Ask the whole group to stop, then force it.\"\"\"\n",[138,355,357,360,363,366,369],{"class":140,"line":356},23,[138,358,359],{"class":151},"    if",[138,361,362],{"class":162}," sys.platform ",[138,364,365],{"class":151},"==",[138,367,368],{"class":352}," \"win32\"",[138,370,278],{"class":162},[138,372,374,377],{"class":140,"line":373},24,[138,375,376],{"class":162},"        proc.kill()  ",[138,378,379],{"class":144},"# TerminateProcess; use a job object for true trees\n",[138,381,383],{"class":140,"line":382},25,[138,384,385],{"class":151},"        return\n",[138,387,389,392],{"class":140,"line":388},26,[138,390,391],{"class":151},"    try",[138,393,278],{"class":162},[138,395,397,400,402],{"class":140,"line":396},27,[138,398,399],{"class":162},"        os.killpg(proc.pid, signal.",[138,401,51],{"class":155},[138,403,266],{"class":162},[138,405,407,410,413],{"class":140,"line":406},28,[138,408,409],{"class":151},"    except",[138,411,412],{"class":155}," ProcessLookupError",[138,414,278],{"class":162},[138,416,418],{"class":140,"line":417},29,[138,419,385],{"class":151},[138,421,423,425],{"class":140,"line":422},30,[138,424,391],{"class":151},[138,426,278],{"class":162},[138,428,430,433,436,438,440],{"class":140,"line":429},31,[138,431,432],{"class":162},"        proc.wait(",[138,434,435],{"class":256},"timeout",[138,437,260],{"class":151},[138,439,227],{"class":155},[138,441,266],{"class":162},[138,443,445,447],{"class":140,"line":444},32,[138,446,409],{"class":151},[138,448,449],{"class":162}," subprocess.TimeoutExpired:\n",[138,451,453,455,457],{"class":140,"line":452},33,[138,454,399],{"class":162},[138,456,55],{"class":155},[138,458,266],{"class":162},[138,460,462],{"class":140,"line":461},34,[138,463,170],{"emptyLinePlaceholder":169},[138,465,467],{"class":140,"line":466},35,[138,468,170],{"emptyLinePlaceholder":169},[138,470,472,474,477,480,482,485,488],{"class":140,"line":471},36,[138,473,329],{"class":151},[138,475,476],{"class":249}," run_with_deadline",[138,478,479],{"class":162},"(argv: list[",[138,481,338],{"class":155},[138,483,484],{"class":162},"], timeout: ",[138,486,487],{"class":155},"float",[138,489,490],{"class":162},") -> Outcome:\n",[138,492,494,497,500,502,505],{"class":140,"line":493},37,[138,495,496],{"class":162},"    popen_kwargs: ",[138,498,499],{"class":155},"dict",[138,501,230],{"class":151},[138,503,504],{"class":155}," dict",[138,506,507],{"class":162},"(\n",[138,509,511,514,516,519,522],{"class":140,"line":510},38,[138,512,513],{"class":256},"        stdout",[138,515,260],{"class":151},[138,517,518],{"class":162},"subprocess.",[138,520,521],{"class":155},"PIPE",[138,523,524],{"class":162},",\n",[138,526,528,531,533,535,537],{"class":140,"line":527},39,[138,529,530],{"class":256},"        stderr",[138,532,260],{"class":151},[138,534,518],{"class":162},[138,536,521],{"class":155},[138,538,524],{"class":162},[138,540,542,545,547,549,552],{"class":140,"line":541},40,[138,543,544],{"class":256},"        stdin",[138,546,260],{"class":151},[138,548,518],{"class":162},[138,550,551],{"class":155},"DEVNULL",[138,553,524],{"class":162},[138,555,557,560,562,564],{"class":140,"line":556},41,[138,558,559],{"class":256},"        text",[138,561,260],{"class":151},[138,563,263],{"class":155},[138,565,524],{"class":162},[138,567,569,572,574,577],{"class":140,"line":568},42,[138,570,571],{"class":256},"        encoding",[138,573,260],{"class":151},[138,575,576],{"class":352},"\"utf-8\"",[138,578,524],{"class":162},[138,580,582,585,587,590],{"class":140,"line":581},43,[138,583,584],{"class":256},"        errors",[138,586,260],{"class":151},[138,588,589],{"class":352},"\"replace\"",[138,591,524],{"class":162},[138,593,595],{"class":140,"line":594},44,[138,596,597],{"class":162},"    )\n",[138,599,601,603,605,607,609],{"class":140,"line":600},45,[138,602,359],{"class":151},[138,604,362],{"class":162},[138,606,365],{"class":151},[138,608,368],{"class":352},[138,610,278],{"class":162},[138,612,614,617,620,623,625,628],{"class":140,"line":613},46,[138,615,616],{"class":162},"        popen_kwargs[",[138,618,619],{"class":352},"\"creationflags\"",[138,621,622],{"class":162},"] ",[138,624,260],{"class":151},[138,626,627],{"class":162}," subprocess.",[138,629,630],{"class":155},"CREATE_NEW_PROCESS_GROUP\n",[138,632,634,637],{"class":140,"line":633},47,[138,635,636],{"class":151},"    else",[138,638,278],{"class":162},[138,640,642,644,647,649,651],{"class":140,"line":641},48,[138,643,616],{"class":162},[138,645,646],{"class":352},"\"start_new_session\"",[138,648,622],{"class":162},[138,650,260],{"class":151},[138,652,653],{"class":155}," True\n",[138,655,657],{"class":140,"line":656},49,[138,658,170],{"emptyLinePlaceholder":169},[138,660,662,665,667,670,673],{"class":140,"line":661},50,[138,663,664],{"class":162},"    proc ",[138,666,260],{"class":151},[138,668,669],{"class":162}," subprocess.Popen(argv, ",[138,671,672],{"class":151},"**",[138,674,675],{"class":162},"popen_kwargs)\n",[138,677,679,681],{"class":140,"line":678},51,[138,680,391],{"class":151},[138,682,278],{"class":162},[138,684,686,689,691,694,696,698],{"class":140,"line":685},52,[138,687,688],{"class":162},"        out, err ",[138,690,260],{"class":151},[138,692,693],{"class":162}," proc.communicate(",[138,695,435],{"class":256},[138,697,260],{"class":151},[138,699,700],{"class":162},"timeout)\n",[138,702,704,707,710,713],{"class":140,"line":703},53,[138,705,706],{"class":151},"        return",[138,708,709],{"class":162}," Outcome(proc.returncode, ",[138,711,712],{"class":155},"False",[138,714,715],{"class":162},", out, err)\n",[138,717,719,721],{"class":140,"line":718},54,[138,720,409],{"class":151},[138,722,449],{"class":162},[138,724,726],{"class":140,"line":725},55,[138,727,728],{"class":162},"        _terminate_tree(proc)\n",[138,730,732,734,736],{"class":140,"line":731},56,[138,733,688],{"class":162},[138,735,260],{"class":151},[138,737,738],{"class":162}," proc.communicate()\n",[138,740,742,744,746,748],{"class":140,"line":741},57,[138,743,706],{"class":151},[138,745,709],{"class":162},[138,747,263],{"class":155},[138,749,715],{"class":162},[138,751,753,755,758],{"class":140,"line":752},58,[138,754,409],{"class":151},[138,756,757],{"class":155}," BaseException",[138,759,278],{"class":162},[138,761,763,766],{"class":140,"line":762},59,[138,764,765],{"class":162},"        _terminate_tree(proc)   ",[138,767,768],{"class":144},"# Ctrl+C or any error: never leave the tree running\n",[138,770,772],{"class":140,"line":771},60,[138,773,774],{"class":162},"        proc.communicate()\n",[138,776,778],{"class":140,"line":777},61,[138,779,780],{"class":151},"        raise\n",[10,782,783,786,787,790,791,794,795,799],{},[13,784,785],{},"start_new_session=True"," makes the child the leader of a new process group whose ID equals its PID, so ",[13,788,789],{},"os.killpg(proc.pid, ...)"," reaches every process it spawns — unless one of those deliberately starts its own session, which daemons do. ",[13,792,793],{},"communicate(timeout=...)"," reads both pipes concurrently while it waits, so it cannot deadlock the way sequential reads can (see ",[26,796,798],{"href":797},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fstreaming-subprocess-output-in-real-time\u002F","streaming subprocess output in real time"," for why that matters).",[10,801,802,803,806,807,810,811,814,815,818,819,30],{},"The ",[13,804,805],{},"except BaseException"," branch is easy to overlook and important. If the user presses Ctrl+C while you wait, ",[13,808,809],{},"KeyboardInterrupt"," is raised in your process — but because the child is in its own session, the terminal's ",[13,812,813],{},"SIGINT"," did ",[99,816,817],{},"not"," reach it. Without that branch the child runs on after your CLI exits. The broader pattern is in ",[26,820,822],{"href":821},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fhandling-keyboard-interrupt-cleanly\u002F","handling KeyboardInterrupt cleanly",[92,824],{"name":825},"sp-process-group",[10,827,828,829,832,833,836,837,840,841,844],{},"On Windows, ",[13,830,831],{},"CREATE_NEW_PROCESS_GROUP"," lets you send ",[13,834,835],{},"CTRL_BREAK_EVENT",", but killing a whole tree reliably needs a Job Object, which the standard library does not wrap. For most CLIs, ",[13,838,839],{},"proc.kill()"," plus documenting the limitation is acceptable; tools that orchestrate large trees on Windows usually depend on ",[13,842,843],{},"psutil"," to walk and kill children.",[32,846,848],{"id":847},"reading-the-return-code","Reading the return code",[10,850,851,852,855],{},"A ",[13,853,854],{},"returncode"," is not just \"zero or not\". Python encodes three different situations in it, and your CLI should tell them apart.",[92,857],{"name":858},"sp-returncode-map",[37,860,861,869,883],{},[40,862,863,868],{},[99,864,865],{},[13,866,867],{},"0"," — success.",[40,870,871,874,875,878,879,882],{},[99,872,873],{},"Positive"," — the program exited on its own with that status. Its meaning is defined by that program: ",[13,876,877],{},"grep"," uses 1 for \"no match\", ",[13,880,881],{},"diff"," uses 1 for \"files differ\", and both use 2 for real errors.",[40,884,885,888,889,892,893,896,897,899,900,896,903,905,906,909],{},[99,886,887],{},"Negative"," — on POSIX, the child was killed by signal ",[13,890,891],{},"-returncode",". ",[13,894,895],{},"-9"," is ",[13,898,55],{}," (often the out-of-memory killer), ",[13,901,902],{},"-15",[13,904,51],{},", ",[13,907,908],{},"-11"," is a segmentation fault.",[10,911,912,913,916],{},"Shells report signal deaths as ",[13,914,915],{},"128 + n",", so when you pass a signal death through, convert it. Here is the translation layer, wired into a Typer command:",[129,918,920],{"className":131,"code":919,"language":133,"meta":134,"style":134},"# src\u002Fmytool\u002Fcli.py\nimport signal\nimport sys\n\nimport typer\n\nfrom mytool.deadline import run_with_deadline\n\napp = typer.Typer()\n\nEXIT_TIMEOUT = 124\n\n\ndef exit_code_for(returncode: int) -> int:\n    if returncode \u003C 0:\n        return 128 + (-returncode)\n    return returncode\n\n\ndef describe(returncode: int) -> str:\n    if returncode \u003C 0:\n        try:\n            return f\"killed by {signal.Signals(-returncode).name}\"\n        except ValueError:\n            return f\"killed by signal {-returncode}\"\n    return f\"exited with status {returncode}\"\n\n\n@app.callback()\ndef main() -> None:\n    \"\"\"Task runner.\"\"\"\n\n\n@app.command()\ndef test(timeout: float = typer.Option(600, help=\"Seconds before the run is stopped.\")) -> None:\n    \"\"\"Run the test suite with a deadline.\"\"\"\n    outcome = run_with_deadline([sys.executable, \"-m\", \"pytest\", \"-q\"], timeout=timeout)\n    if outcome.timed_out:\n        typer.secho(f\"error: tests did not finish within {timeout:g}s\", fg=\"red\", err=True)\n        raise typer.Exit(EXIT_TIMEOUT)\n    if outcome.returncode != 0:\n        typer.secho(f\"error: pytest {describe(outcome.returncode)}\", fg=\"red\", err=True)\n        typer.echo(outcome.stdout[-2000:], err=True)\n        raise typer.Exit(exit_code_for(outcome.returncode))\n    typer.echo(outcome.stdout.strip().splitlines()[-1])\n\n\nif __name__ == \"__main__\":\n    app()\n",[13,921,922,927,933,939,943,950,954,966,970,980,984,994,998,1002,1022,1037,1056,1064,1068,1072,1089,1101,1108,1136,1146,1165,1182,1186,1190,1198,1212,1217,1221,1225,1232,1269,1274,1306,1313,1357,1369,1383,1420,1441,1448,1461,1465,1469,1485],{"__ignoreMap":134},[138,923,924],{"class":140,"line":141},[138,925,926],{"class":144},"# src\u002Fmytool\u002Fcli.py\n",[138,928,929,931],{"class":140,"line":148},[138,930,176],{"class":151},[138,932,187],{"class":162},[138,934,935,937],{"class":140,"line":166},[138,936,176],{"class":151},[138,938,203],{"class":162},[138,940,941],{"class":140,"line":173},[138,942,170],{"emptyLinePlaceholder":169},[138,944,945,947],{"class":140,"line":182},[138,946,176],{"class":151},[138,948,949],{"class":162}," typer\n",[138,951,952],{"class":140,"line":190},[138,953,170],{"emptyLinePlaceholder":169},[138,955,956,958,961,963],{"class":140,"line":198},[138,957,152],{"class":151},[138,959,960],{"class":162}," mytool.deadline ",[138,962,176],{"class":151},[138,964,965],{"class":162}," run_with_deadline\n",[138,967,968],{"class":140,"line":206},[138,969,170],{"emptyLinePlaceholder":169},[138,971,972,975,977],{"class":140,"line":219},[138,973,974],{"class":162},"app ",[138,976,260],{"class":151},[138,978,979],{"class":162}," typer.Typer()\n",[138,981,982],{"class":140,"line":224},[138,983,170],{"emptyLinePlaceholder":169},[138,985,986,989,991],{"class":140,"line":236},[138,987,988],{"class":155},"EXIT_TIMEOUT",[138,990,230],{"class":151},[138,992,993],{"class":155}," 124\n",[138,995,996],{"class":140,"line":241},[138,997,170],{"emptyLinePlaceholder":169},[138,999,1000],{"class":140,"line":246},[138,1001,170],{"emptyLinePlaceholder":169},[138,1003,1004,1006,1009,1012,1015,1018,1020],{"class":140,"line":269},[138,1005,329],{"class":151},[138,1007,1008],{"class":249}," exit_code_for",[138,1010,1011],{"class":162},"(returncode: ",[138,1013,1014],{"class":155},"int",[138,1016,1017],{"class":162},") -> ",[138,1019,1014],{"class":155},[138,1021,278],{"class":162},[138,1023,1024,1026,1029,1032,1035],{"class":140,"line":281},[138,1025,359],{"class":151},[138,1027,1028],{"class":162}," returncode ",[138,1030,1031],{"class":151},"\u003C",[138,1033,1034],{"class":155}," 0",[138,1036,278],{"class":162},[138,1038,1039,1041,1044,1047,1050,1053],{"class":140,"line":290},[138,1040,706],{"class":151},[138,1042,1043],{"class":155}," 128",[138,1045,1046],{"class":151}," +",[138,1048,1049],{"class":162}," (",[138,1051,1052],{"class":151},"-",[138,1054,1055],{"class":162},"returncode)\n",[138,1057,1058,1061],{"class":140,"line":299},[138,1059,1060],{"class":151},"    return",[138,1062,1063],{"class":162}," returncode\n",[138,1065,1066],{"class":140,"line":308},[138,1067,170],{"emptyLinePlaceholder":169},[138,1069,1070],{"class":140,"line":316},[138,1071,170],{"emptyLinePlaceholder":169},[138,1073,1074,1076,1079,1081,1083,1085,1087],{"class":140,"line":321},[138,1075,329],{"class":151},[138,1077,1078],{"class":249}," describe",[138,1080,1011],{"class":162},[138,1082,1014],{"class":155},[138,1084,1017],{"class":162},[138,1086,338],{"class":155},[138,1088,278],{"class":162},[138,1090,1091,1093,1095,1097,1099],{"class":140,"line":326},[138,1092,359],{"class":151},[138,1094,1028],{"class":162},[138,1096,1031],{"class":151},[138,1098,1034],{"class":155},[138,1100,278],{"class":162},[138,1102,1103,1106],{"class":140,"line":349},[138,1104,1105],{"class":151},"        try",[138,1107,278],{"class":162},[138,1109,1110,1113,1116,1119,1122,1125,1127,1130,1133],{"class":140,"line":356},[138,1111,1112],{"class":151},"            return",[138,1114,1115],{"class":151}," f",[138,1117,1118],{"class":352},"\"killed by ",[138,1120,1121],{"class":155},"{",[138,1123,1124],{"class":162},"signal.Signals(",[138,1126,1052],{"class":151},[138,1128,1129],{"class":162},"returncode).name",[138,1131,1132],{"class":155},"}",[138,1134,1135],{"class":352},"\"\n",[138,1137,1138,1141,1144],{"class":140,"line":373},[138,1139,1140],{"class":151},"        except",[138,1142,1143],{"class":155}," ValueError",[138,1145,278],{"class":162},[138,1147,1148,1150,1152,1155,1157,1159,1161,1163],{"class":140,"line":382},[138,1149,1112],{"class":151},[138,1151,1115],{"class":151},[138,1153,1154],{"class":352},"\"killed by signal ",[138,1156,1121],{"class":155},[138,1158,1052],{"class":151},[138,1160,854],{"class":162},[138,1162,1132],{"class":155},[138,1164,1135],{"class":352},[138,1166,1167,1169,1171,1174,1176,1178,1180],{"class":140,"line":388},[138,1168,1060],{"class":151},[138,1170,1115],{"class":151},[138,1172,1173],{"class":352},"\"exited with status ",[138,1175,1121],{"class":155},[138,1177,854],{"class":162},[138,1179,1132],{"class":155},[138,1181,1135],{"class":352},[138,1183,1184],{"class":140,"line":396},[138,1185,170],{"emptyLinePlaceholder":169},[138,1187,1188],{"class":140,"line":406},[138,1189,170],{"emptyLinePlaceholder":169},[138,1191,1192,1195],{"class":140,"line":417},[138,1193,1194],{"class":249},"@app.callback",[138,1196,1197],{"class":162},"()\n",[138,1199,1200,1202,1205,1208,1210],{"class":140,"line":422},[138,1201,329],{"class":151},[138,1203,1204],{"class":249}," main",[138,1206,1207],{"class":162},"() -> ",[138,1209,344],{"class":155},[138,1211,278],{"class":162},[138,1213,1214],{"class":140,"line":429},[138,1215,1216],{"class":352},"    \"\"\"Task runner.\"\"\"\n",[138,1218,1219],{"class":140,"line":444},[138,1220,170],{"emptyLinePlaceholder":169},[138,1222,1223],{"class":140,"line":452},[138,1224,170],{"emptyLinePlaceholder":169},[138,1226,1227,1230],{"class":140,"line":461},[138,1228,1229],{"class":249},"@app.command",[138,1231,1197],{"class":162},[138,1233,1234,1236,1239,1242,1244,1246,1249,1252,1254,1257,1259,1262,1265,1267],{"class":140,"line":466},[138,1235,329],{"class":151},[138,1237,1238],{"class":249}," test",[138,1240,1241],{"class":162},"(timeout: ",[138,1243,487],{"class":155},[138,1245,230],{"class":151},[138,1247,1248],{"class":162}," typer.Option(",[138,1250,1251],{"class":155},"600",[138,1253,905],{"class":162},[138,1255,1256],{"class":256},"help",[138,1258,260],{"class":151},[138,1260,1261],{"class":352},"\"Seconds before the run is stopped.\"",[138,1263,1264],{"class":162},")) -> ",[138,1266,344],{"class":155},[138,1268,278],{"class":162},[138,1270,1271],{"class":140,"line":471},[138,1272,1273],{"class":352},"    \"\"\"Run the test suite with a deadline.\"\"\"\n",[138,1275,1276,1279,1281,1284,1287,1289,1292,1294,1297,1300,1302,1304],{"class":140,"line":493},[138,1277,1278],{"class":162},"    outcome ",[138,1280,260],{"class":151},[138,1282,1283],{"class":162}," run_with_deadline([sys.executable, ",[138,1285,1286],{"class":352},"\"-m\"",[138,1288,905],{"class":162},[138,1290,1291],{"class":352},"\"pytest\"",[138,1293,905],{"class":162},[138,1295,1296],{"class":352},"\"-q\"",[138,1298,1299],{"class":162},"], ",[138,1301,435],{"class":256},[138,1303,260],{"class":151},[138,1305,700],{"class":162},[138,1307,1308,1310],{"class":140,"line":510},[138,1309,359],{"class":151},[138,1311,1312],{"class":162}," outcome.timed_out:\n",[138,1314,1315,1318,1321,1324,1326,1328,1331,1333,1336,1338,1341,1343,1346,1348,1351,1353,1355],{"class":140,"line":527},[138,1316,1317],{"class":162},"        typer.secho(",[138,1319,1320],{"class":151},"f",[138,1322,1323],{"class":352},"\"error: tests did not finish within ",[138,1325,1121],{"class":155},[138,1327,435],{"class":162},[138,1329,1330],{"class":151},":g",[138,1332,1132],{"class":155},[138,1334,1335],{"class":352},"s\"",[138,1337,905],{"class":162},[138,1339,1340],{"class":256},"fg",[138,1342,260],{"class":151},[138,1344,1345],{"class":352},"\"red\"",[138,1347,905],{"class":162},[138,1349,1350],{"class":256},"err",[138,1352,260],{"class":151},[138,1354,263],{"class":155},[138,1356,266],{"class":162},[138,1358,1359,1362,1365,1367],{"class":140,"line":541},[138,1360,1361],{"class":151},"        raise",[138,1363,1364],{"class":162}," typer.Exit(",[138,1366,988],{"class":155},[138,1368,266],{"class":162},[138,1370,1371,1373,1376,1379,1381],{"class":140,"line":556},[138,1372,359],{"class":151},[138,1374,1375],{"class":162}," outcome.returncode ",[138,1377,1378],{"class":151},"!=",[138,1380,1034],{"class":155},[138,1382,278],{"class":162},[138,1384,1385,1387,1389,1392,1394,1397,1399,1402,1404,1406,1408,1410,1412,1414,1416,1418],{"class":140,"line":568},[138,1386,1317],{"class":162},[138,1388,1320],{"class":151},[138,1390,1391],{"class":352},"\"error: pytest ",[138,1393,1121],{"class":155},[138,1395,1396],{"class":162},"describe(outcome.returncode)",[138,1398,1132],{"class":155},[138,1400,1401],{"class":352},"\"",[138,1403,905],{"class":162},[138,1405,1340],{"class":256},[138,1407,260],{"class":151},[138,1409,1345],{"class":352},[138,1411,905],{"class":162},[138,1413,1350],{"class":256},[138,1415,260],{"class":151},[138,1417,263],{"class":155},[138,1419,266],{"class":162},[138,1421,1422,1425,1427,1430,1433,1435,1437,1439],{"class":140,"line":581},[138,1423,1424],{"class":162},"        typer.echo(outcome.stdout[",[138,1426,1052],{"class":151},[138,1428,1429],{"class":155},"2000",[138,1431,1432],{"class":162},":], ",[138,1434,1350],{"class":256},[138,1436,260],{"class":151},[138,1438,263],{"class":155},[138,1440,266],{"class":162},[138,1442,1443,1445],{"class":140,"line":594},[138,1444,1361],{"class":151},[138,1446,1447],{"class":162}," typer.Exit(exit_code_for(outcome.returncode))\n",[138,1449,1450,1453,1455,1458],{"class":140,"line":600},[138,1451,1452],{"class":162},"    typer.echo(outcome.stdout.strip().splitlines()[",[138,1454,1052],{"class":151},[138,1456,1457],{"class":155},"1",[138,1459,1460],{"class":162},"])\n",[138,1462,1463],{"class":140,"line":613},[138,1464,170],{"emptyLinePlaceholder":169},[138,1466,1467],{"class":140,"line":633},[138,1468,170],{"emptyLinePlaceholder":169},[138,1470,1471,1474,1477,1480,1483],{"class":140,"line":641},[138,1472,1473],{"class":151},"if",[138,1475,1476],{"class":155}," __name__",[138,1478,1479],{"class":151}," ==",[138,1481,1482],{"class":352}," \"__main__\"",[138,1484,278],{"class":162},[138,1486,1487],{"class":140,"line":656},[138,1488,1489],{"class":162},"    app()\n",[1491,1492,1494],"h3",{"id":1493},"pass-through-map-or-collapse","Pass through, map, or collapse?",[10,1496,1497,1498,1501],{},"There is no single right policy; there is a right policy ",[99,1499,1500],{},"per command",", and it should be written down.",[37,1503,1504,1514,1523],{},[40,1505,1506,1509,1510,1513],{},[99,1507,1508],{},"Pass through"," when your command is a thin wrapper and callers think of it as the child. A ",[13,1511,1512],{},"mytool test"," that wraps pytest should exit with pytest's codes — CI systems already understand them.",[40,1515,1516,1519,1520,1522],{},[99,1517,1518],{},"Map"," when the child's codes carry meaning your callers need but under different numbers. ",[13,1521,877],{},"'s 1 (\"no match\") might become your 0 with an empty result.",[40,1524,1525,1528,1529,1532],{},[99,1526,1527],{},"Collapse"," to 1 when the child is an implementation detail. Nobody calling ",[13,1530,1531],{},"mytool deploy"," should need to know that exit 23 came from rsync's \"partial transfer\".",[10,1534,1535,1536,30],{},"Whatever you choose, reserve your own codes for your own conditions — usage errors (2), timeouts (124), missing programs (127) — as described in ",[26,1537,1539],{"href":1538},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fchoosing-exit-codes-for-cli-tools\u002F","choosing exit codes for CLI tools",[32,1541,1543],{"id":1542},"ux-considerations","UX considerations",[37,1545,1546,1552,1558,1564,1570],{},[40,1547,1548,1551],{},[99,1549,1550],{},"Name the limit in the message."," \"did not finish within 600s\" tells the user both what happened and which knob to turn. Expose the timeout as an option so they can turn it.",[40,1553,1554,1557],{},[99,1555,1556],{},"Distinguish \"failed\" from \"was stopped\"."," A timeout and a crash call for different next steps; say which one happened. \"killed by SIGKILL\" with no timeout of your own usually means the out-of-memory killer, which is worth hinting at.",[40,1559,1560,1563],{},[99,1561,1562],{},"Show partial output on timeout."," The last lines captured before the deadline usually show where the child was stuck.",[40,1565,1566,1569],{},[99,1567,1568],{},"Pick a grace period that fits the child."," Five seconds is enough for most tools to flush and exit; a database migration might need thirty. Too short, and you turn every timeout into a hard kill with no cleanup.",[40,1571,1572,1575,1576,1579],{},[99,1573,1574],{},"Never exit 0 after a timeout."," Even with ",[13,1577,1578],{},"--keep-going"," semantics, the overall exit code should report that something did not complete.",[32,1581,1583],{"id":1582},"testing-the-behaviour","Testing the behaviour",[10,1585,1586],{},"Test with small Python children so the suite runs anywhere, and assert on the outcome rather than on timing. The tree-kill test starts a child that spawns a grandchild, then checks the grandchild is gone:",[129,1588,1590],{"className":131,"code":1589,"language":133,"meta":134,"style":134},"# tests\u002Ftest_deadline.py\nimport os\nimport sys\nimport time\n\nimport pytest\n\nfrom mytool.cli import exit_code_for\nfrom mytool.deadline import run_with_deadline\n\nposix_only = pytest.mark.skipif(sys.platform == \"win32\", reason=\"process groups\")\n\n\ndef test_success_passes_through():\n    out = run_with_deadline([sys.executable, \"-c\", \"print('ok')\"], timeout=10)\n    assert (out.returncode, out.timed_out, out.stdout) == (0, False, \"ok\\n\")\n\n\ndef test_timeout_is_reported():\n    out = run_with_deadline([sys.executable, \"-c\", \"import time; time.sleep(30)\"], timeout=0.5)\n    assert out.timed_out\n\n\n@posix_only\ndef test_grandchild_is_killed(tmp_path):\n    pidfile = tmp_path \u002F \"grandchild.pid\"\n    parent = (\n        \"import subprocess, sys, time\\n\"\n        \"p = subprocess.Popen([sys.executable, '-c', 'import time; time.sleep(60)'])\\n\"\n        f\"open({str(pidfile)!r}, 'w').write(str(p.pid))\\n\"\n        \"time.sleep(60)\\n\"\n    )\n    out = run_with_deadline([sys.executable, \"-c\", parent], timeout=1.0)\n    assert out.timed_out\n    grandchild = int(pidfile.read_text())\n    time.sleep(0.2)\n    with pytest.raises(ProcessLookupError):\n        os.kill(grandchild, 0)\n\n\n@pytest.mark.parametrize((\"code\", \"expected\"), [(0, 0), (3, 3), (-15, 143), (-9, 137)])\ndef test_exit_code_mapping(code, expected):\n    assert exit_code_for(code) == expected\n",[13,1591,1592,1597,1603,1609,1616,1620,1627,1631,1643,1653,1657,1683,1687,1691,1701,1729,1759,1763,1767,1776,1802,1809,1813,1817,1822,1832,1848,1858,1867,1876,1902,1911,1915,1937,1943,1956,1966,1980,1989,1993,1997,2059,2069],{"__ignoreMap":134},[138,1593,1594],{"class":140,"line":141},[138,1595,1596],{"class":144},"# tests\u002Ftest_deadline.py\n",[138,1598,1599,1601],{"class":140,"line":148},[138,1600,176],{"class":151},[138,1602,179],{"class":162},[138,1604,1605,1607],{"class":140,"line":166},[138,1606,176],{"class":151},[138,1608,203],{"class":162},[138,1610,1611,1613],{"class":140,"line":173},[138,1612,176],{"class":151},[138,1614,1615],{"class":162}," time\n",[138,1617,1618],{"class":140,"line":182},[138,1619,170],{"emptyLinePlaceholder":169},[138,1621,1622,1624],{"class":140,"line":190},[138,1623,176],{"class":151},[138,1625,1626],{"class":162}," pytest\n",[138,1628,1629],{"class":140,"line":198},[138,1630,170],{"emptyLinePlaceholder":169},[138,1632,1633,1635,1638,1640],{"class":140,"line":206},[138,1634,152],{"class":151},[138,1636,1637],{"class":162}," mytool.cli ",[138,1639,176],{"class":151},[138,1641,1642],{"class":162}," exit_code_for\n",[138,1644,1645,1647,1649,1651],{"class":140,"line":219},[138,1646,152],{"class":151},[138,1648,960],{"class":162},[138,1650,176],{"class":151},[138,1652,965],{"class":162},[138,1654,1655],{"class":140,"line":224},[138,1656,170],{"emptyLinePlaceholder":169},[138,1658,1659,1662,1664,1667,1669,1671,1673,1676,1678,1681],{"class":140,"line":236},[138,1660,1661],{"class":162},"posix_only ",[138,1663,260],{"class":151},[138,1665,1666],{"class":162}," pytest.mark.skipif(sys.platform ",[138,1668,365],{"class":151},[138,1670,368],{"class":352},[138,1672,905],{"class":162},[138,1674,1675],{"class":256},"reason",[138,1677,260],{"class":151},[138,1679,1680],{"class":352},"\"process groups\"",[138,1682,266],{"class":162},[138,1684,1685],{"class":140,"line":241},[138,1686,170],{"emptyLinePlaceholder":169},[138,1688,1689],{"class":140,"line":246},[138,1690,170],{"emptyLinePlaceholder":169},[138,1692,1693,1695,1698],{"class":140,"line":269},[138,1694,329],{"class":151},[138,1696,1697],{"class":249}," test_success_passes_through",[138,1699,1700],{"class":162},"():\n",[138,1702,1703,1706,1708,1710,1713,1715,1718,1720,1722,1724,1727],{"class":140,"line":281},[138,1704,1705],{"class":162},"    out ",[138,1707,260],{"class":151},[138,1709,1283],{"class":162},[138,1711,1712],{"class":352},"\"-c\"",[138,1714,905],{"class":162},[138,1716,1717],{"class":352},"\"print('ok')\"",[138,1719,1299],{"class":162},[138,1721,435],{"class":256},[138,1723,260],{"class":151},[138,1725,1726],{"class":155},"10",[138,1728,266],{"class":162},[138,1730,1731,1734,1737,1739,1741,1743,1745,1747,1749,1752,1755,1757],{"class":140,"line":290},[138,1732,1733],{"class":151},"    assert",[138,1735,1736],{"class":162}," (out.returncode, out.timed_out, out.stdout) ",[138,1738,365],{"class":151},[138,1740,1049],{"class":162},[138,1742,867],{"class":155},[138,1744,905],{"class":162},[138,1746,712],{"class":155},[138,1748,905],{"class":162},[138,1750,1751],{"class":352},"\"ok",[138,1753,1754],{"class":155},"\\n",[138,1756,1401],{"class":352},[138,1758,266],{"class":162},[138,1760,1761],{"class":140,"line":299},[138,1762,170],{"emptyLinePlaceholder":169},[138,1764,1765],{"class":140,"line":308},[138,1766,170],{"emptyLinePlaceholder":169},[138,1768,1769,1771,1774],{"class":140,"line":316},[138,1770,329],{"class":151},[138,1772,1773],{"class":249}," test_timeout_is_reported",[138,1775,1700],{"class":162},[138,1777,1778,1780,1782,1784,1786,1788,1791,1793,1795,1797,1800],{"class":140,"line":321},[138,1779,1705],{"class":162},[138,1781,260],{"class":151},[138,1783,1283],{"class":162},[138,1785,1712],{"class":352},[138,1787,905],{"class":162},[138,1789,1790],{"class":352},"\"import time; time.sleep(30)\"",[138,1792,1299],{"class":162},[138,1794,435],{"class":256},[138,1796,260],{"class":151},[138,1798,1799],{"class":155},"0.5",[138,1801,266],{"class":162},[138,1803,1804,1806],{"class":140,"line":326},[138,1805,1733],{"class":151},[138,1807,1808],{"class":162}," out.timed_out\n",[138,1810,1811],{"class":140,"line":349},[138,1812,170],{"emptyLinePlaceholder":169},[138,1814,1815],{"class":140,"line":356},[138,1816,170],{"emptyLinePlaceholder":169},[138,1818,1819],{"class":140,"line":373},[138,1820,1821],{"class":249},"@posix_only\n",[138,1823,1824,1826,1829],{"class":140,"line":382},[138,1825,329],{"class":151},[138,1827,1828],{"class":249}," test_grandchild_is_killed",[138,1830,1831],{"class":162},"(tmp_path):\n",[138,1833,1834,1837,1839,1842,1845],{"class":140,"line":388},[138,1835,1836],{"class":162},"    pidfile ",[138,1838,260],{"class":151},[138,1840,1841],{"class":162}," tmp_path ",[138,1843,1844],{"class":151},"\u002F",[138,1846,1847],{"class":352}," \"grandchild.pid\"\n",[138,1849,1850,1853,1855],{"class":140,"line":396},[138,1851,1852],{"class":162},"    parent ",[138,1854,260],{"class":151},[138,1856,1857],{"class":162}," (\n",[138,1859,1860,1863,1865],{"class":140,"line":406},[138,1861,1862],{"class":352},"        \"import subprocess, sys, time",[138,1864,1754],{"class":155},[138,1866,1135],{"class":352},[138,1868,1869,1872,1874],{"class":140,"line":417},[138,1870,1871],{"class":352},"        \"p = subprocess.Popen([sys.executable, '-c', 'import time; time.sleep(60)'])",[138,1873,1754],{"class":155},[138,1875,1135],{"class":352},[138,1877,1878,1881,1884,1887,1890,1893,1895,1898,1900],{"class":140,"line":422},[138,1879,1880],{"class":151},"        f",[138,1882,1883],{"class":352},"\"open(",[138,1885,1886],{"class":155},"{str",[138,1888,1889],{"class":162},"(pidfile)",[138,1891,1892],{"class":151},"!r",[138,1894,1132],{"class":155},[138,1896,1897],{"class":352},", 'w').write(str(p.pid))",[138,1899,1754],{"class":155},[138,1901,1135],{"class":352},[138,1903,1904,1907,1909],{"class":140,"line":429},[138,1905,1906],{"class":352},"        \"time.sleep(60)",[138,1908,1754],{"class":155},[138,1910,1135],{"class":352},[138,1912,1913],{"class":140,"line":444},[138,1914,597],{"class":162},[138,1916,1917,1919,1921,1923,1925,1928,1930,1932,1935],{"class":140,"line":452},[138,1918,1705],{"class":162},[138,1920,260],{"class":151},[138,1922,1283],{"class":162},[138,1924,1712],{"class":352},[138,1926,1927],{"class":162},", parent], ",[138,1929,435],{"class":256},[138,1931,260],{"class":151},[138,1933,1934],{"class":155},"1.0",[138,1936,266],{"class":162},[138,1938,1939,1941],{"class":140,"line":461},[138,1940,1733],{"class":151},[138,1942,1808],{"class":162},[138,1944,1945,1948,1950,1953],{"class":140,"line":466},[138,1946,1947],{"class":162},"    grandchild ",[138,1949,260],{"class":151},[138,1951,1952],{"class":155}," int",[138,1954,1955],{"class":162},"(pidfile.read_text())\n",[138,1957,1958,1961,1964],{"class":140,"line":471},[138,1959,1960],{"class":162},"    time.sleep(",[138,1962,1963],{"class":155},"0.2",[138,1965,266],{"class":162},[138,1967,1968,1971,1974,1977],{"class":140,"line":493},[138,1969,1970],{"class":151},"    with",[138,1972,1973],{"class":162}," pytest.raises(",[138,1975,1976],{"class":155},"ProcessLookupError",[138,1978,1979],{"class":162},"):\n",[138,1981,1982,1985,1987],{"class":140,"line":510},[138,1983,1984],{"class":162},"        os.kill(grandchild, ",[138,1986,867],{"class":155},[138,1988,266],{"class":162},[138,1990,1991],{"class":140,"line":527},[138,1992,170],{"emptyLinePlaceholder":169},[138,1994,1995],{"class":140,"line":541},[138,1996,170],{"emptyLinePlaceholder":169},[138,1998,1999,2002,2005,2008,2010,2013,2016,2018,2020,2022,2025,2028,2030,2032,2034,2036,2039,2041,2044,2046,2048,2051,2053,2056],{"class":140,"line":556},[138,2000,2001],{"class":249},"@pytest.mark.parametrize",[138,2003,2004],{"class":162},"((",[138,2006,2007],{"class":352},"\"code\"",[138,2009,905],{"class":162},[138,2011,2012],{"class":352},"\"expected\"",[138,2014,2015],{"class":162},"), [(",[138,2017,867],{"class":155},[138,2019,905],{"class":162},[138,2021,867],{"class":155},[138,2023,2024],{"class":162},"), (",[138,2026,2027],{"class":155},"3",[138,2029,905],{"class":162},[138,2031,2027],{"class":155},[138,2033,2024],{"class":162},[138,2035,1052],{"class":151},[138,2037,2038],{"class":155},"15",[138,2040,905],{"class":162},[138,2042,2043],{"class":155},"143",[138,2045,2024],{"class":162},[138,2047,1052],{"class":151},[138,2049,2050],{"class":155},"9",[138,2052,905],{"class":162},[138,2054,2055],{"class":155},"137",[138,2057,2058],{"class":162},")])\n",[138,2060,2061,2063,2066],{"class":140,"line":568},[138,2062,329],{"class":151},[138,2064,2065],{"class":249}," test_exit_code_mapping",[138,2067,2068],{"class":162},"(code, expected):\n",[138,2070,2071,2073,2076,2078],{"class":140,"line":581},[138,2072,1733],{"class":151},[138,2074,2075],{"class":162}," exit_code_for(code) ",[138,2077,365],{"class":151},[138,2079,2080],{"class":162}," expected\n",[10,2082,2083,2086,2087,2089,2090,30],{},[13,2084,2085],{},"os.kill(pid, 0)"," sends no signal; it only checks the process exists, raising ",[13,2088,1976],{}," once it is gone. Because the grandchild was re-parented to init after its parent died, it is reaped promptly and the check is reliable. For the patterns behind isolating tests like these, see ",[26,2091,2093],{"href":2092},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fmocking-filesystem-and-network-in-cli-tests\u002F","mocking filesystem and network in CLI tests",[32,2095,2097],{"id":2096},"conclusion","Conclusion",[10,2099,2100,2101,2103,2104,2106,2107,2109],{},"A timeout is only as good as what it stops. Start children in their own process group, give them a short grace period with ",[13,2102,51],{},", then ",[13,2105,55],{}," the group; do the same on Ctrl+C. Read return codes with their sign in mind, convert signal deaths to the ",[13,2108,915],{}," convention, and decide per command whether to pass codes through, map them or collapse them. Your CLI then fails in ways that scripts, CI systems and people can all act on.",[32,2111,2113],{"id":2112},"frequently-asked-questions","Frequently asked questions",[1491,2115,2117,2118,2120],{"id":2116},"why-not-just-use-the-timeout-command-from-coreutils","Why not just use the ",[13,2119,435],{}," command from coreutils?",[10,2122,2123,2126,2127,2130],{},[13,2124,2125],{},"timeout 600 npm run build"," works on Linux and does kill the process group with ",[13,2128,2129],{},"--kill-after",". It is not available on Windows or stock macOS, and it moves the policy out of your code where you cannot report it nicely. Doing it in Python keeps behaviour identical everywhere your CLI runs.",[1491,2132,2134,2135,2137],{"id":2133},"does-start_new_sessiontrue-change-anything-else","Does ",[13,2136,785],{}," change anything else?",[10,2139,2140],{},"Yes: the child is detached from your terminal's foreground process group, so Ctrl+C in the terminal no longer reaches it and it cannot read from the terminal. That is exactly why your CLI must forward interrupts itself. For interactive children, do not start a new session.",[1491,2142,2144,2145,2149],{"id":2143},"what-exit-code-should-my-cli-use-when-it-is-killed-by-a-signal","What exit code should my CLI use when ",[2146,2147,2148],"em",{},"it"," is killed by a signal?",[10,2151,2152,2153,2155,2156,2160],{},"If your process receives ",[13,2154,51],{}," and you handle it, exit with 143 after cleaning up, so a supervisor sees the conventional value. ",[26,2157,2159],{"href":2158},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fhandling-sigterm-and-graceful-shutdown\u002F","Handling SIGTERM and graceful shutdown"," covers the handler.",[1491,2162,2164],{"id":2163},"how-do-i-set-a-timeout-per-step-in-a-multi-step-command","How do I set a timeout per step in a multi-step command?",[10,2166,2167,2168,2171],{},"Give each step its own deadline and, if you want an overall cap too, compute the remaining budget before each step: ",[13,2169,2170],{},"min(step_timeout, deadline - time.monotonic())",". Report which step hit the limit.",[32,2173,2175],{"id":2174},"related","Related",[37,2177,2178,2185,2190,2195,2200],{},[40,2179,2180,2181],{},"Up: ",[26,2182,2184],{"href":2183},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002F","Running subprocesses from Python CLIs",[40,2186,2187],{},[26,2188,2189],{"href":28},"Calling external commands safely with subprocess",[40,2191,2192],{},[26,2193,2194],{"href":797},"Streaming subprocess output in real time",[40,2196,2197],{},[26,2198,2199],{"href":1538},"Choosing exit codes for CLI tools",[40,2201,2202],{},[26,2203,2159],{"href":2158},[2205,2206,2207],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":134,"searchDepth":148,"depth":148,"links":2209},[2210,2211,2213,2214,2217,2218,2219,2220,2229],{"id":34,"depth":148,"text":35},{"id":59,"depth":148,"text":2212},"What timeout= really does",{"id":113,"depth":148,"text":114},{"id":847,"depth":148,"text":848,"children":2215},[2216],{"id":1493,"depth":166,"text":1494},{"id":1542,"depth":148,"text":1543},{"id":1582,"depth":148,"text":1583},{"id":2096,"depth":148,"text":2097},{"id":2112,"depth":148,"text":2113,"children":2221},[2222,2224,2226,2228],{"id":2116,"depth":166,"text":2223},"Why not just use the timeout command from coreutils?",{"id":2133,"depth":166,"text":2225},"Does start_new_session=True change anything else?",{"id":2143,"depth":166,"text":2227},"What exit code should my CLI use when it is killed by a signal?",{"id":2163,"depth":166,"text":2164},{"id":2174,"depth":148,"text":2175},"2026-09-18","Enforce deadlines on child processes from a Python CLI, kill whole process trees, decode negative return codes and map child failures to your own exit codes.","advanced",false,"md",{},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fhandling-subprocess-timeouts-and-exit-codes",{"title":5,"description":2231},"cli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fhandling-subprocess-timeouts-and-exit-codes\u002Findex",[2240,2241,2242,2243],"subprocess","timeouts","exit-codes","signals","dPJ-OH9WOQJ9PwsS1fS07FdlNoRm9HgZ91DUQhSlxqk",[2246,2249,2252,2255,2258,2261,2264,2267,2270,2273,2276,2279,2282,2285,2288,2291,2294,2297,2300,2303,2306,2309,2312,2315,2318,2321,2324,2327,2330,2333,2336,2339,2342,2345,2348,2351,2354,2357,2360,2363,2366,2369,2372,2375,2378,2381,2384,2387,2390,2393,2396,2399,2402,2405,2408,2411,2414,2417,2420,2423,2426,2429,2432,2435,2438,2441,2444,2447,2450,2453,2456,2459,2462,2465,2468,2471,2474,2477,2480,2483,2486,2489,2490,2493,2496,2499,2502,2505,2508,2511,2514,2517,2519,2522,2525,2528,2531,2534,2537,2540,2543,2546,2549,2552,2555,2558,2561,2564,2567,2570,2573,2576,2579,2582,2585,2588,2591,2594,2597,2600,2603,2606,2609,2612,2615,2618,2621,2624,2627,2630,2633,2636,2639,2642,2645,2648,2651,2654,2657,2660,2663,2666,2669,2672,2675,2678,2681,2684,2687,2690,2693,2696,2699,2702,2705,2708,2711,2714,2717,2720,2723,2726,2729,2732,2735,2738,2741,2744,2747,2750,2753,2756,2759,2762,2765,2768,2771,2774,2777,2780,2783,2786,2789],{"path":2247,"title":2248},"\u002Fabout","About Python CLI Toolcraft",{"path":2250,"title":2251},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies","Advanced Argument Validation Strategies",{"path":2253,"title":2254},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fparsing-nested-json-arguments-in-python-clis","Parsing Nested JSON Args in Python CLIs",{"path":2256,"title":2257},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-dependent-and-conflicting-options","Validating Dependent and Conflicting CLI Options",{"path":2259,"title":2260},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-file-and-directory-paths-in-clis","Validating File and Directory Paths in CLIs",{"path":2262,"title":2263},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fwriting-custom-click-parameter-types","Writing Custom Click Parameter Types",{"path":2265,"title":2266},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Fbuilding-your-first-textual-app","Building Your First Textual App for a Python CLI",{"path":2268,"title":2269},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Fchoosing-between-a-cli-a-prompt-flow-and-a-tui","Choosing Between a CLI, a Prompt Flow and a TUI",{"path":2271,"title":2272},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual","Building Terminal UIs with Textual for Python CLIs",{"path":2274,"title":2275},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Ftesting-textual-apps-with-pilot","Testing Textual Apps with Pilot",{"path":2277,"title":2278},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fadding-examples-and-epilogs-to-help-output","Adding Examples and Epilogs to Help Output",{"path":2280,"title":2281},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fgenerating-man-pages-and-docs-from-a-cli","Generating Man Pages and Docs from a CLI",{"path":2283,"title":2284},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation","CLI Help Output and Documentation",{"path":2286,"title":2287},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fversioning-and-deprecating-cli-flags","Versioning and Deprecating CLI Flags",{"path":2289,"title":2290},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fwriting-help-text-users-actually-read","Writing Help Text Users Actually Read",{"path":2292,"title":2293},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fadapting-output-to-terminal-width","Adapting Python CLI Output to Terminal Width",{"path":2295,"title":2296},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fdetecting-ci-environments-and-non-interactive-shells","Detecting CI Environments and Non-Interactive Shells",{"path":2298,"title":2299},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Ffixing-unicode-and-encoding-errors-on-windows","Fixing Unicode and Encoding Errors on Windows in Python CLIs",{"path":2301,"title":2302},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility","Cross-Platform Terminal Compatibility for Python CLIs",{"path":2304,"title":2305},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Frespecting-no-color-and-force-color","Respecting NO_COLOR and FORCE_COLOR in Python CLIs",{"path":2307,"title":2308},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fchoosing-exit-codes-for-cli-tools","Choosing Exit Codes for CLI Tools",{"path":2310,"title":2311},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fdesigning-an-exception-hierarchy-for-a-cli","Designing an Exception Hierarchy for a Python CLI",{"path":2313,"title":2314},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Ffriendly-error-messages-and-tracebacks","Friendly Error Messages and Tracebacks",{"path":2316,"title":2317},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fhandling-keyboard-interrupt-cleanly","Handling Keyboard Interrupt Cleanly",{"path":2319,"title":2320},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes","Error Handling and Exit Codes for CLIs",{"path":2322,"title":2323},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Freporting-machine-readable-errors-in-json-mode","Reporting Machine-Readable Errors in JSON Mode",{"path":2325,"title":2326},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fconfig-precedence-flags-env-files-defaults","Config Precedence: Flags, Env, Files, Defaults",{"path":2328,"title":2329},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fdiscovering-project-config-files-by-walking-up-directories","Discovering Project Config Files by Walking Up Directories",{"path":2331,"title":2332},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars","Handling Config Files and Env Vars in CLIs",{"path":2334,"title":2335},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Floading-yaml-configs-safely-in-cli-apps","Loading YAML configs safely in CLI apps",{"path":2337,"title":2338},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Freading-toml-config-with-tomllib","Reading TOML Config with tomllib in Python CLIs",{"path":2340,"title":2341},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Ftyped-settings-with-pydantic-settings","Typed Settings with pydantic-settings in Python CLIs",{"path":2343,"title":2344},"\u002Fadvanced-input-parsing-user-experience","Advanced Input Parsing for Python CLIs",{"path":2346,"title":2347},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Fadding-progress-bars-and-spinners-to-python-clis","Progress Bars and Spinners for Python CLIs",{"path":2349,"title":2350},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Fbuilding-interactive-prompts-and-menus","Building Interactive Prompts and Menus in Python CLIs",{"path":2352,"title":2353},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich","Interactive Terminal UI with Rich",{"path":2355,"title":2356},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Flive-dashboards-with-rich-live","Live Dashboards with Rich Live in Python CLIs",{"path":2358,"title":2359},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Frendering-tables-and-json-with-rich","Rendering Tables and JSON with Rich",{"path":2361,"title":2362},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Ftheming-rich-output-consistently","Theming Rich Output Consistently in Python CLIs",{"path":2364,"title":2365},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Fdynamic-completion-values-from-apis-and-files","Dynamic Completion Values from APIs and Files",{"path":2367,"title":2368},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Fenabling-tab-completion-in-click-and-typer","Enabling Tab Completion in Click and Typer",{"path":2370,"title":2371},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis","Shell Completion for Python CLIs",{"path":2373,"title":2374},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Finstalling-shell-completion-for-bash-zsh-fish","Installing Shell Completion for bash, zsh, fish",{"path":2376,"title":2377},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Ftesting-shell-completion-in-python-clis","Testing Shell Completion in Python CLIs",{"path":2379,"title":2380},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fadding-trace-ids-and-context-to-cli-logs","Adding Trace IDs and Context to Python CLI Logs",{"path":2382,"title":2383},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fadding-verbose-and-quiet-logging-flags","Adding Verbose and Quiet Logging Flags",{"path":2385,"title":2386},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps","Structured Logging for CLI Apps",{"path":2388,"title":2389},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fstructured-json-logging-in-python-clis","Structured JSON Logging in Python CLIs",{"path":2391,"title":2392},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fwriting-rotating-log-files-from-a-cli","Writing Rotating Log Files from a Python CLI",{"path":2394,"title":2395},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fdetecting-tty-and-adapting-output","Detecting a TTY and Adapting Output",{"path":2397,"title":2398},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Femitting-json-output-for-scripting","Emitting JSON Output for Scripting",{"path":2400,"title":2401},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fhandling-broken-pipe-and-sigpipe","Handling Broken Pipe and SIGPIPE",{"path":2403,"title":2404},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes","Working with stdin, stdout and Pipes",{"path":2406,"title":2407},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fprocessing-large-files-and-ndjson-streams","Processing Large Files and NDJSON Streams in Python CLIs",{"path":2409,"title":2410},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Freading-piped-input-in-python-clis","Reading Piped Input in Python CLIs",{"path":2412,"title":2413},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fbuilding-an-api-client-cli-with-httpx","Building an API Client CLI with httpx",{"path":2415,"title":2416},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fdownloading-files-with-progress-in-python","Downloading Files with Progress in Python CLIs",{"path":2418,"title":2419},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis","Calling HTTP APIs from Python CLIs",{"path":2421,"title":2422},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Foauth-device-flow-login-for-clis","OAuth Device Flow Login for Python CLIs",{"path":2424,"title":2425},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fpaginating-api-results-in-a-cli","Paginating API Results in a Python CLI",{"path":2427,"title":2428},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fretries-and-backoff-for-cli-http-calls","Retries and Backoff for CLI HTTP Calls",{"path":2430,"title":2431},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fcancelling-async-tasks-on-ctrl-c","Cancelling Async Tasks on Ctrl+C in Python CLIs",{"path":2433,"title":2434},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis","Concurrency and Async in Python CLIs",{"path":2436,"title":2437},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fmultiprocessing-for-cpu-bound-cli-tasks","Multiprocessing for CPU-Bound CLI Tasks",{"path":2439,"title":2440},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fparallelising-cli-work-with-thread-pools","Parallelising CLI Work with Thread Pools",{"path":2442,"title":2443},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Frate-limiting-concurrent-requests-in-clis","Rate-Limiting Concurrent Requests in Python CLIs",{"path":2445,"title":2446},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Frunning-async-code-in-typer-and-click","Running Async Code in Typer and Click",{"path":2448,"title":2449},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fcross-platform-paths-with-pathlib","Cross-Platform Paths with pathlib in CLIs",{"path":2451,"title":2452},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Ffile-locking-for-concurrent-cli-runs","File Locking for Concurrent CLI Runs in Python",{"path":2454,"title":2455},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes","Filesystem Paths and Atomic Writes for CLIs",{"path":2457,"title":2458},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fsafe-temporary-files-and-directories","Safe Temporary Files and Directories in CLIs",{"path":2460,"title":2461},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fstoring-app-data-with-platformdirs","Storing CLI App Data with platformdirs",{"path":2463,"title":2464},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fwriting-files-atomically-in-python-clis","Writing Files Atomically in Python CLIs",{"path":2466,"title":2467},"\u002Fcli-runtime-systems-integration","CLI Runtime & Systems Integration for Python",{"path":2469,"title":2470},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fbuilding-a-watch-mode-with-watchfiles","Building a Watch Mode with watchfiles in Python",{"path":2472,"title":2473},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fhandling-sigterm-and-graceful-shutdown","Handling SIGTERM and Graceful Shutdown in CLIs",{"path":2475,"title":2476},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fhealth-checks-and-heartbeats-for-long-running-clis","Health Checks and Heartbeats for Long-Running CLIs",{"path":2478,"title":2479},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis","Long-Running and Watch-Mode Python CLIs",{"path":2481,"title":2482},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Frunning-a-cli-on-a-schedule-with-cron-and-systemd","Running a Python CLI on a Schedule with cron and systemd",{"path":2484,"title":2485},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Favoiding-shell-injection-in-python-clis","Avoiding Shell Injection in Python CLIs",{"path":2487,"title":2488},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fcalling-external-commands-safely-with-subprocess","Calling External Commands Safely with subprocess",{"path":2236,"title":5},{"path":2491,"title":2492},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis","Running Subprocesses from Python CLIs",{"path":2494,"title":2495},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fstreaming-subprocess-output-in-real-time","Streaming Subprocess Output in Real Time",{"path":2497,"title":2498},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fwrapping-git-and-other-tools-from-a-python-cli","Wrapping git and Other Tools from a Python CLI",{"path":2500,"title":2501},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis","Secrets and Credentials in Python CLIs",{"path":2503,"title":2504},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fprompting-for-passwords-securely","Prompting for Passwords Securely in Python CLIs",{"path":2506,"title":2507},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Freading-secrets-from-env-and-files","Reading Secrets from Env Vars and Files in CLIs",{"path":2509,"title":2510},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fredacting-secrets-from-cli-output-and-logs","Redacting Secrets from CLI Output and Logs",{"path":2512,"title":2513},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fstoring-tokens-with-keyring","Storing CLI Tokens Securely with keyring",{"path":2515,"title":2516},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fsupporting-multiple-profiles-and-accounts","Supporting Multiple Profiles and Accounts in CLIs",{"path":1844,"title":2518},"Python CLI Toolcraft",{"path":2520,"title":2521},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Fcaching-expensive-work-between-cli-runs","Caching Expensive Work Between Python CLI Runs",{"path":2523,"title":2524},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading","CLI Startup Performance and Lazy Loading",{"path":2526,"title":2527},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Flazy-loading-subcommands-for-faster-startup","Lazy Loading Subcommands for Faster Startup",{"path":2529,"title":2530},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Fprofiling-python-cli-startup-time","Profiling Python CLI Startup Time",{"path":2532,"title":2533},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Freducing-cli-dependency-weight","Reducing CLI Dependency Weight",{"path":2535,"title":2536},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-subparsers-for-subcommands","argparse Subparsers for Subcommands",{"path":2538,"title":2539},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-vs-click-vs-typer-comparison","argparse vs Click vs Typer Compared",{"path":2541,"title":2542},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse","Command-Line Parsing with argparse",{"path":2544,"title":2545},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmigrating-from-argparse-to-typer","Migrating from argparse to Typer",{"path":2547,"title":2548},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmutually-exclusive-options-in-argparse","Mutually Exclusive Options in argparse",{"path":2550,"title":2551},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fwriting-custom-argparse-actions","Writing Custom argparse Actions in Python",{"path":2553,"title":2554},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fadding-dry-run-and-confirmation-to-destructive-commands","Adding Dry-Run and Confirmation to Destructive Commands",{"path":2556,"title":2557},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Ffollowing-posix-and-gnu-argument-conventions","Following POSIX and GNU Argument Conventions in Python",{"path":2559,"title":2560},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fglobal-options-vs-per-command-options","Global Options vs Per-Command Options in Python CLIs",{"path":2562,"title":2563},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions","Designing CLI Interfaces and Conventions in Python",{"path":2565,"title":2566},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fnaming-commands-and-flags-consistently","Naming Commands and Flags Consistently in Python CLIs",{"path":2568,"title":2569},"\u002Fmodern-python-cli-frameworks-architecture","Python CLI Frameworks and Architecture",{"path":2571,"title":2572},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fdiscovering-plugins-with-entry-points","Discovering Plugins with Entry Points in Python CLIs",{"path":2574,"title":2575},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fhook-based-plugins-with-pluggy","Hook-Based Plugins for Python CLIs with pluggy",{"path":2577,"title":2578},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis","Plugin Architectures for Extensible CLIs",{"path":2580,"title":2581},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fversioning-a-plugin-api","Versioning a Plugin API for a Python CLI",{"path":2583,"title":2584},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fwriting-a-plugin-for-an-existing-cli","Writing a Plugin for an Existing CLI",{"path":2586,"title":2587},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fbest-practices-for-python-cli-entry-points","Best practices for Python CLI entry points",{"path":2589,"title":2590},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fdependency-injection-patterns-for-cli-commands","Dependency Injection Patterns for CLI Commands",{"path":2592,"title":2593},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fhow-to-structure-a-large-python-cli-project","Structuring a Large Python CLI Project",{"path":2595,"title":2596},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis","Structuring Multi-Command Python CLIs",{"path":2598,"title":2599},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-common-options-across-commands","Sharing Common Options Across Python CLI Commands",{"path":2601,"title":2602},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-state-with-click-context-objects","Sharing State with Click Context Objects",{"path":2604,"title":2605},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fend-to-end-testing-an-installed-cli","End-to-End Testing an Installed Python CLI",{"path":2607,"title":2608},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications","Testing Python CLI Applications",{"path":2610,"title":2611},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fmeasuring-cli-test-coverage","Measuring CLI Test Coverage",{"path":2613,"title":2614},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fmocking-filesystem-and-network-in-cli-tests","Mocking the Filesystem and Network in CLI Tests",{"path":2616,"title":2617},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fproperty-based-testing-cli-arguments-with-hypothesis","Property-Based Testing CLI Arguments with Hypothesis",{"path":2619,"title":2620},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fsnapshot-testing-cli-output","Snapshot Testing CLI Output",{"path":2622,"title":2623},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-click-commands-with-clirunner","Testing Click Commands with CliRunner",{"path":2625,"title":2626},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-interactive-prompts-and-stdin","Testing Interactive Prompts and stdin",{"path":2628,"title":2629},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fbuilding-a-cli-with-subcommands-in-click","Building a CLI with subcommands in Click",{"path":2631,"title":2632},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fbuilding-dynamic-commands-in-click","Building Dynamic Commands in Click",{"path":2634,"title":2635},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fconverting-a-click-app-to-typer","Converting a Click App to Typer",{"path":2637,"title":2638},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each","Typer vs Click: When to Use Each",{"path":2640,"title":2641},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Ftyper-callback-functions-explained","Typer callback functions explained",{"path":2643,"title":2644},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fusing-annotated-options-in-typer","Using Annotated Options in Typer",{"path":2646,"title":2647},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fautomating-releases-from-git-tags","Automating Python CLI Releases from Git Tags",{"path":2649,"title":2650},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fcaching-uv-dependencies-in-ci","Caching uv Dependencies in CI for Python CLIs",{"path":2652,"title":2653},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis","CI\u002FCD Pipelines for Python CLIs",{"path":2655,"title":2656},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fpublishing-to-pypi-with-trusted-publishing","Publishing a CLI to PyPI with Trusted Publishing",{"path":2658,"title":2659},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fsmoke-testing-the-built-wheel-in-ci","Smoke-Testing the Built Wheel of a Python CLI in CI",{"path":2661,"title":2662},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Ftesting-a-cli-across-python-versions-with-github-actions","Testing a CLI Across Python Versions in GitHub Actions",{"path":2664,"title":2665},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fbuilding-a-cookiecutter-template-for-typer-clis","Building a Cookiecutter Template for Typer CLIs",{"path":2667,"title":2668},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fcopier-vs-cookiecutter-for-cli-templates","Copier vs Cookiecutter for CLI Templates",{"path":2670,"title":2671},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter","CLI Project Scaffolding with Cookiecutter",{"path":2673,"title":2674},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fpost-generation-hooks-in-cli-templates","Post-Generation Hooks in Python CLI Templates",{"path":2676,"title":2677},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbuilding-cross-platform-release-binaries-in-ci","Building Cross-Platform Release Binaries in CI",{"path":2679,"title":2680},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbundling-a-python-cli-with-pyinstaller","Bundling a Python CLI with PyInstaller",{"path":2682,"title":2683},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fhomebrew-and-scoop-packaging-for-python-clis","Homebrew and Scoop Packaging for Python CLIs",{"path":2685,"title":2686},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries","Distributing CLIs as Standalone Binaries",{"path":2688,"title":2689},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fnuitka-vs-pyinstaller-for-python-clis","Nuitka vs PyInstaller for Python CLI Binaries",{"path":2691,"title":2692},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fshipping-a-cli-as-a-zipapp-with-shiv","Shipping a CLI as a Zipapp with shiv",{"path":2694,"title":2695},"\u002Fproject-setup-dependency-management","Project Setup & Dependency Management",{"path":2697,"title":2698},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Fconfiguring-ruff-for-a-cli-project","Configuring Ruff for a Python CLI Project",{"path":2700,"title":2701},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Fenforcing-import-boundaries-in-a-cli-codebase","Enforcing Import Boundaries in a Python CLI Codebase",{"path":2703,"title":2704},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code","Linting and Type-Checking Python CLI Code",{"path":2706,"title":2707},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Ftype-checking-click-and-typer-code-with-mypy","Type-Checking Click and Typer Code with mypy",{"path":2709,"title":2710},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fautomating-changelogs-with-conventional-commits","Automating Changelogs with Conventional Commits",{"path":2712,"title":2713},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fderiving-versions-from-git-tags-with-hatch-vcs","Deriving CLI Versions from Git Tags with hatch-vcs",{"path":2715,"title":2716},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fexposing-version-info-and-build-metadata","Exposing Version Info and Build Metadata",{"path":2718,"title":2719},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs","Managing CLI Versioning & Changelogs",{"path":2721,"title":2722},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fsemantic-versioning-policy-for-cli-tools","A Semantic Versioning Policy for CLI Tools",{"path":2724,"title":2725},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbuilding-wheels-and-sdists-for-python-clis","Building Wheels and sdists for Python CLIs",{"path":2727,"title":2728},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbundling-data-files-with-importlib-resources","Bundling Data Files with importlib.resources in CLIs",{"path":2730,"title":2731},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution","Packaging Python CLIs for Distribution",{"path":2733,"title":2734},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Finstalling-and-distributing-clis-with-pipx","Installing and Distributing CLIs with pipx",{"path":2736,"title":2737},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fpublishing-a-python-cli-to-pypi","Publishing a Python CLI to PyPI",{"path":2739,"title":2740},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fwriting-pyproject-toml-metadata-for-a-cli","Writing pyproject.toml Metadata for a Python CLI",{"path":2742,"title":2743},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development","Poetry Workflows for CLI Development",{"path":2745,"title":2746},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fmigrating-a-cli-from-poetry-to-uv","Migrating a Python CLI from Poetry to uv",{"path":2748,"title":2749},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-dependency-groups-for-cli-tooling","Poetry Dependency Groups for CLI Tooling",{"path":2751,"title":2752},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-entry-points-and-scripts-for-clis","Poetry Entry Points and Scripts for CLIs",{"path":2754,"title":2755},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects","Pre-commit Hooks for CLI Projects",{"path":2757,"title":2758},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects\u002Fsetting-up-pre-commit-for-python-cli-repos","Setting up pre-commit for Python CLI repos",{"path":2760,"title":2761},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects\u002Fshipping-your-cli-as-a-pre-commit-hook","Shipping Your Python CLI as a pre-commit Hook",{"path":2763,"title":2764},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects\u002Fwriting-local-pre-commit-hooks-in-python","Writing Local pre-commit Hooks in Python",{"path":2766,"title":2767},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management","uv for Python CLI Dependency Management",{"path":2769,"title":2770},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Frunning-one-off-cli-scripts-with-uv-run","Running One-Off CLI Scripts with uv run and PEP 723",{"path":2772,"title":2773},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-init-vs-poetry-init-for-cli-tools","uv init vs poetry init for CLI tools",{"path":2775,"title":2776},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-tool-install-vs-pipx-for-clis","uv tool install vs pipx for CLIs",{"path":2778,"title":2779},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-workspaces-for-multi-package-clis","uv Workspaces for Multi-Package Python CLIs",{"path":2781,"title":2782},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices","Python CLI Env Isolation Best Practices",{"path":2784,"title":2785},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fmanaging-virtual-environments-for-cross-platform-clis","Managing Python CLI Virtual Environments",{"path":2787,"title":2788},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fpinning-the-python-version-for-a-cli","Pinning the Python Version for a CLI",{"path":2790,"title":2791},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fsupporting-multiple-python-versions-with-nox","Supporting Multiple Python Versions with nox",1789736905050]