[{"data":1,"prerenderedAt":2299},["ShallowReactive",2],{"page-\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fautomating-releases-from-git-tags\u002F":3,"content-directory":1751},{"id":4,"title":5,"body":6,"date":1735,"description":1736,"difficulty":1737,"draft":1738,"extension":1739,"meta":1740,"navigation":153,"path":1741,"seo":1742,"stem":1743,"tags":1744,"updated":1735,"__hash__":1750},"content\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fautomating-releases-from-git-tags\u002Findex.md","Automating Python CLI Releases from Git Tags",{"type":7,"value":8,"toc":1714},"minimark",[9,29,34,76,80,87,91,98,102,105,545,548,552,1192,1197,1212,1215,1224,1233,1246,1250,1269,1273,1292,1295,1329,1333,1336,1567,1582,1586,1592,1596,1600,1607,1611,1614,1618,1633,1637,1652,1656,1659,1663,1677,1681,1710],[10,11,12,13,17,18,22,23,28],"p",{},"A manual release of a Python CLI is a checklist of a dozen steps: bump the version in ",[14,15,16],"code",{},"pyproject.toml",", update the changelog, commit, tag, build, check the build, upload to PyPI, write a GitHub release, attach the artefacts, announce it. Each step is simple and each is an opportunity to get something slightly wrong — a version that does not match the tag, an upload built from a dirty working tree, release notes copied from the wrong section. Automating the release around a single action, ",[19,20,21],"strong",{},"pushing a version tag",", removes almost all of it. This guide builds that workflow: the version comes from the tag, CI checks the tag is on the right branch, builds and tests, publishes to PyPI, and creates a GitHub release with notes taken from the changelog and the wheel attached. It is part of the ",[24,25,27],"a",{"href":26},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002F","CI\u002FCD pipelines topic",".",[30,31,33],"h2",{"id":32},"prerequisites","Prerequisites",[35,36,37,54,69],"ul",{},[38,39,40,41,44,45,48,49,53],"li",{},"Version derived from git tags with ",[14,42,43],{},"hatch-vcs"," or ",[14,46,47],{},"setuptools-scm",", as in ",[24,50,52],{"href":51},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fderiving-versions-from-git-tags-with-hatch-vcs\u002F","deriving versions from git tags with hatch-vcs",". (A static version works too, with the guard shown below.)",[38,55,56,57,60,61,64,65,28],{},"A ",[14,58,59],{},"CHANGELOG.md"," with one ",[14,62,63],{},"## [x.y.z]"," section per release, maintained by hand or generated as in ",[24,66,68],{"href":67},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fautomating-changelogs-with-conventional-commits\u002F","automating changelogs with conventional commits",[38,70,71,72,28],{},"Trusted publishing configured on PyPI, as in ",[24,73,75],{"href":74},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fpublishing-to-pypi-with-trusted-publishing\u002F","publishing to PyPI with trusted publishing",[30,77,79],{"id":78},"the-release-end-to-end","The release, end to end",[10,81,82,83,86],{},"The only thing a maintainer does is create and push an annotated tag on a commit that is already on ",[14,84,85],{},"main",". Everything else follows:",[88,89],"inline-diagram",{"name":90},"ci-release-timeline",[10,92,93,94,97],{},"Because the version is read from the tag at build time, the tag, the package version, the PyPI release and the GitHub release all agree by construction. If any job fails before publishing, nothing reaches users: fix the problem, delete the tag (",[14,95,96],{},"git push --delete origin v1.5.0","), and push it again.",[30,99,101],{"id":100},"the-recipe-release-notes-from-the-changelog","The recipe: release notes from the changelog",[10,103,104],{},"Release notes should be the changelog section for the version, not a second, hand-written summary that drifts. A small script extracts it:",[106,107,112],"pre",{"className":108,"code":109,"language":110,"meta":111,"style":111},"language-python shiki shiki-themes github-light github-dark","# scripts\u002Frelease_notes.py\n\"\"\"Print the CHANGELOG.md section for a version: python scripts\u002Frelease_notes.py 1.5.0\"\"\"\nfrom __future__ import annotations\n\nimport re\nimport sys\nfrom pathlib import Path\n\nHEADING = re.compile(r\"^## \\[?v?(?P\u003Cversion>[^\\]\\s]+)\\]?\")\n\n\ndef section(changelog: str, version: str) -> str:\n    lines, capturing = [], False\n    for line in changelog.splitlines():\n        m = HEADING.match(line)\n        if m:\n            if capturing:\n                break\n            capturing = m[\"version\"] == version\n            continue\n        if capturing:\n            lines.append(line)\n    text = \"\\n\".join(lines).strip()\n    if not text:\n        raise SystemExit(f\"no changelog section for {version}\")\n    return text\n\n\nif __name__ == \"__main__\":\n    print(section(Path(\"CHANGELOG.md\").read_text(encoding=\"utf-8\"), sys.argv[1].lstrip(\"v\")))\n","python","",[14,113,114,123,130,148,155,164,172,185,190,260,265,270,299,314,329,343,352,361,367,390,396,403,409,428,440,470,479,484,489,506],{"__ignoreMap":111},[115,116,119],"span",{"class":117,"line":118},"line",1,[115,120,122],{"class":121},"sJ8bj","# scripts\u002Frelease_notes.py\n",[115,124,126],{"class":117,"line":125},2,[115,127,129],{"class":128},"sZZnC","\"\"\"Print the CHANGELOG.md section for a version: python scripts\u002Frelease_notes.py 1.5.0\"\"\"\n",[115,131,133,137,141,144],{"class":117,"line":132},3,[115,134,136],{"class":135},"szBVR","from",[115,138,140],{"class":139},"sj4cs"," __future__",[115,142,143],{"class":135}," import",[115,145,147],{"class":146},"sVt8B"," annotations\n",[115,149,151],{"class":117,"line":150},4,[115,152,154],{"emptyLinePlaceholder":153},true,"\n",[115,156,158,161],{"class":117,"line":157},5,[115,159,160],{"class":135},"import",[115,162,163],{"class":146}," re\n",[115,165,167,169],{"class":117,"line":166},6,[115,168,160],{"class":135},[115,170,171],{"class":146}," sys\n",[115,173,175,177,180,182],{"class":117,"line":174},7,[115,176,136],{"class":135},[115,178,179],{"class":146}," pathlib ",[115,181,160],{"class":135},[115,183,184],{"class":146}," Path\n",[115,186,188],{"class":117,"line":187},8,[115,189,154],{"emptyLinePlaceholder":153},[115,191,193,196,199,202,205,208,211,215,219,222,225,227,230,234,237,239,242,245,248,251,253,255,257],{"class":117,"line":192},9,[115,194,195],{"class":139},"HEADING",[115,197,198],{"class":135}," =",[115,200,201],{"class":146}," re.compile(",[115,203,204],{"class":135},"r",[115,206,207],{"class":128},"\"",[115,209,210],{"class":139},"^",[115,212,214],{"class":213},"sA_wV","## ",[115,216,218],{"class":217},"snhLl","\\[",[115,220,221],{"class":135},"?",[115,223,224],{"class":213},"v",[115,226,221],{"class":135},[115,228,229],{"class":139},"(",[115,231,233],{"class":232},"s9eBZ","?P\u003Cversion>",[115,235,236],{"class":139},"[",[115,238,210],{"class":135},[115,240,241],{"class":217},"\\]",[115,243,244],{"class":139},"\\s]",[115,246,247],{"class":135},"+",[115,249,250],{"class":139},")",[115,252,241],{"class":217},[115,254,221],{"class":135},[115,256,207],{"class":128},[115,258,259],{"class":146},")\n",[115,261,263],{"class":117,"line":262},10,[115,264,154],{"emptyLinePlaceholder":153},[115,266,268],{"class":117,"line":267},11,[115,269,154],{"emptyLinePlaceholder":153},[115,271,273,276,280,283,286,289,291,294,296],{"class":117,"line":272},12,[115,274,275],{"class":135},"def",[115,277,279],{"class":278},"sScJk"," section",[115,281,282],{"class":146},"(changelog: ",[115,284,285],{"class":139},"str",[115,287,288],{"class":146},", version: ",[115,290,285],{"class":139},[115,292,293],{"class":146},") -> ",[115,295,285],{"class":139},[115,297,298],{"class":146},":\n",[115,300,302,305,308,311],{"class":117,"line":301},13,[115,303,304],{"class":146},"    lines, capturing ",[115,306,307],{"class":135},"=",[115,309,310],{"class":146}," [], ",[115,312,313],{"class":139},"False\n",[115,315,317,320,323,326],{"class":117,"line":316},14,[115,318,319],{"class":135},"    for",[115,321,322],{"class":146}," line ",[115,324,325],{"class":135},"in",[115,327,328],{"class":146}," changelog.splitlines():\n",[115,330,332,335,337,340],{"class":117,"line":331},15,[115,333,334],{"class":146},"        m ",[115,336,307],{"class":135},[115,338,339],{"class":139}," HEADING",[115,341,342],{"class":146},".match(line)\n",[115,344,346,349],{"class":117,"line":345},16,[115,347,348],{"class":135},"        if",[115,350,351],{"class":146}," m:\n",[115,353,355,358],{"class":117,"line":354},17,[115,356,357],{"class":135},"            if",[115,359,360],{"class":146}," capturing:\n",[115,362,364],{"class":117,"line":363},18,[115,365,366],{"class":135},"                break\n",[115,368,370,373,375,378,381,384,387],{"class":117,"line":369},19,[115,371,372],{"class":146},"            capturing ",[115,374,307],{"class":135},[115,376,377],{"class":146}," m[",[115,379,380],{"class":128},"\"version\"",[115,382,383],{"class":146},"] ",[115,385,386],{"class":135},"==",[115,388,389],{"class":146}," version\n",[115,391,393],{"class":117,"line":392},20,[115,394,395],{"class":135},"            continue\n",[115,397,399,401],{"class":117,"line":398},21,[115,400,348],{"class":135},[115,402,360],{"class":146},[115,404,406],{"class":117,"line":405},22,[115,407,408],{"class":146},"            lines.append(line)\n",[115,410,412,415,417,420,423,425],{"class":117,"line":411},23,[115,413,414],{"class":146},"    text ",[115,416,307],{"class":135},[115,418,419],{"class":128}," \"",[115,421,422],{"class":139},"\\n",[115,424,207],{"class":128},[115,426,427],{"class":146},".join(lines).strip()\n",[115,429,431,434,437],{"class":117,"line":430},24,[115,432,433],{"class":135},"    if",[115,435,436],{"class":135}," not",[115,438,439],{"class":146}," text:\n",[115,441,443,446,449,451,454,457,460,463,466,468],{"class":117,"line":442},25,[115,444,445],{"class":135},"        raise",[115,447,448],{"class":139}," SystemExit",[115,450,229],{"class":146},[115,452,453],{"class":135},"f",[115,455,456],{"class":128},"\"no changelog section for ",[115,458,459],{"class":139},"{",[115,461,462],{"class":146},"version",[115,464,465],{"class":139},"}",[115,467,207],{"class":128},[115,469,259],{"class":146},[115,471,473,476],{"class":117,"line":472},26,[115,474,475],{"class":135},"    return",[115,477,478],{"class":146}," text\n",[115,480,482],{"class":117,"line":481},27,[115,483,154],{"emptyLinePlaceholder":153},[115,485,487],{"class":117,"line":486},28,[115,488,154],{"emptyLinePlaceholder":153},[115,490,492,495,498,501,504],{"class":117,"line":491},29,[115,493,494],{"class":135},"if",[115,496,497],{"class":139}," __name__",[115,499,500],{"class":135}," ==",[115,502,503],{"class":128}," \"__main__\"",[115,505,298],{"class":146},[115,507,509,512,515,518,521,525,527,530,533,536,539,542],{"class":117,"line":508},30,[115,510,511],{"class":139},"    print",[115,513,514],{"class":146},"(section(Path(",[115,516,517],{"class":128},"\"CHANGELOG.md\"",[115,519,520],{"class":146},").read_text(",[115,522,524],{"class":523},"s4XuR","encoding",[115,526,307],{"class":135},[115,528,529],{"class":128},"\"utf-8\"",[115,531,532],{"class":146},"), sys.argv[",[115,534,535],{"class":139},"1",[115,537,538],{"class":146},"].lstrip(",[115,540,541],{"class":128},"\"v\"",[115,543,544],{"class":146},")))\n",[10,546,547],{},"Failing when the section is missing is deliberate: it stops a release whose changelog was never written.",[30,549,551],{"id":550},"the-recipe-the-workflow","The recipe: the workflow",[106,553,557],{"className":554,"code":555,"language":556,"meta":111,"style":111},"language-yaml shiki shiki-themes github-light github-dark","# .github\u002Fworkflows\u002Frelease.yml\nname: release\non:\n  push:\n    tags: [\"v[0-9]+.[0-9]+.[0-9]+*\"]\n\npermissions:\n  contents: read\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    outputs:\n      version: ${{ steps.meta.outputs.version }}\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0                   # tags and history, for hatch-vcs\n      - name: Tag must be on main\n        run: |\n          git fetch origin main\n          git merge-base --is-ancestor \"$GITHUB_SHA\" origin\u002Fmain || {\n            echo \"::error::$GITHUB_REF_NAME is not on main\"; exit 1; }\n      - uses: astral-sh\u002Fsetup-uv@v6\n      - run: uv sync --locked --group dev\n      - run: uv run pytest -q\n      - run: uv build\n      - name: Version must match the tag\n        id: meta\n        run: |\n          version=\"${GITHUB_REF_NAME#v}\"\n          test -f \"dist\u002Fmytool-${version}-py3-none-any.whl\" || {\n            echo \"::error::built files do not match ${GITHUB_REF_NAME}\"; ls dist; exit 1; }\n          echo \"version=${version}\" >> \"$GITHUB_OUTPUT\"\n      - run: python scripts\u002Frelease_notes.py \"$GITHUB_REF_NAME\" > dist\u002FNOTES.md\n      - uses: actions\u002Fupload-artifact@v4\n        with: { name: dist, path: dist\u002F }\n\n  publish:\n    needs: build\n    runs-on: ubuntu-latest\n    environment: pypi\n    permissions:\n      id-token: write\n    steps:\n      - uses: actions\u002Fdownload-artifact@v4\n        with: { name: dist, path: dist }\n      - run: rm dist\u002FNOTES.md\n      - uses: pypa\u002Fgh-action-pypi-publish@release\u002Fv1\n\n  github-release:\n    needs: [build, publish]\n    runs-on: ubuntu-latest\n    permissions:\n      contents: write\n    steps:\n      - uses: actions\u002Fdownload-artifact@v4\n        with: { name: dist, path: dist }\n      - name: Create the GitHub release\n        env:\n          GH_TOKEN: ${{ github.token }}\n        run: |\n          prerelease=\"\"\n          case \"$GITHUB_REF_NAME\" in *a*|*b*|*rc*) prerelease=\"--prerelease\";; esac\n          gh release create \"$GITHUB_REF_NAME\" dist\u002F*.whl dist\u002F*.tar.gz \\\n            --repo \"$GITHUB_REPOSITORY\" --title \"mytool ${{ needs.build.outputs.version }}\" \\\n            --notes-file dist\u002FNOTES.md $prerelease\n","yaml",[14,558,559,564,575,582,589,603,607,614,624,628,635,642,652,659,669,676,689,696,709,720,730,735,740,745,756,768,779,790,801,811,819,825,831,837,843,855,867,896,901,909,920,929,940,948,959,966,978,1001,1013,1025,1030,1038,1055,1064,1071,1081,1088,1099,1122,1134,1142,1153,1162,1168,1174,1180,1186],{"__ignoreMap":111},[115,560,561],{"class":117,"line":118},[115,562,563],{"class":121},"# .github\u002Fworkflows\u002Frelease.yml\n",[115,565,566,569,572],{"class":117,"line":125},[115,567,568],{"class":232},"name",[115,570,571],{"class":146},": ",[115,573,574],{"class":128},"release\n",[115,576,577,580],{"class":117,"line":132},[115,578,579],{"class":139},"on",[115,581,298],{"class":146},[115,583,584,587],{"class":117,"line":150},[115,585,586],{"class":232},"  push",[115,588,298],{"class":146},[115,590,591,594,597,600],{"class":117,"line":157},[115,592,593],{"class":232},"    tags",[115,595,596],{"class":146},": [",[115,598,599],{"class":128},"\"v[0-9]+.[0-9]+.[0-9]+*\"",[115,601,602],{"class":146},"]\n",[115,604,605],{"class":117,"line":166},[115,606,154],{"emptyLinePlaceholder":153},[115,608,609,612],{"class":117,"line":174},[115,610,611],{"class":232},"permissions",[115,613,298],{"class":146},[115,615,616,619,621],{"class":117,"line":187},[115,617,618],{"class":232},"  contents",[115,620,571],{"class":146},[115,622,623],{"class":128},"read\n",[115,625,626],{"class":117,"line":192},[115,627,154],{"emptyLinePlaceholder":153},[115,629,630,633],{"class":117,"line":262},[115,631,632],{"class":232},"jobs",[115,634,298],{"class":146},[115,636,637,640],{"class":117,"line":267},[115,638,639],{"class":232},"  build",[115,641,298],{"class":146},[115,643,644,647,649],{"class":117,"line":272},[115,645,646],{"class":232},"    runs-on",[115,648,571],{"class":146},[115,650,651],{"class":128},"ubuntu-latest\n",[115,653,654,657],{"class":117,"line":301},[115,655,656],{"class":232},"    outputs",[115,658,298],{"class":146},[115,660,661,664,666],{"class":117,"line":316},[115,662,663],{"class":232},"      version",[115,665,571],{"class":146},[115,667,668],{"class":128},"${{ steps.meta.outputs.version }}\n",[115,670,671,674],{"class":117,"line":331},[115,672,673],{"class":232},"    steps",[115,675,298],{"class":146},[115,677,678,681,684,686],{"class":117,"line":345},[115,679,680],{"class":146},"      - ",[115,682,683],{"class":232},"uses",[115,685,571],{"class":146},[115,687,688],{"class":128},"actions\u002Fcheckout@v4\n",[115,690,691,694],{"class":117,"line":354},[115,692,693],{"class":232},"        with",[115,695,298],{"class":146},[115,697,698,701,703,706],{"class":117,"line":363},[115,699,700],{"class":232},"          fetch-depth",[115,702,571],{"class":146},[115,704,705],{"class":139},"0",[115,707,708],{"class":121},"                   # tags and history, for hatch-vcs\n",[115,710,711,713,715,717],{"class":117,"line":369},[115,712,680],{"class":146},[115,714,568],{"class":232},[115,716,571],{"class":146},[115,718,719],{"class":128},"Tag must be on main\n",[115,721,722,725,727],{"class":117,"line":392},[115,723,724],{"class":232},"        run",[115,726,571],{"class":146},[115,728,729],{"class":135},"|\n",[115,731,732],{"class":117,"line":398},[115,733,734],{"class":128},"          git fetch origin main\n",[115,736,737],{"class":117,"line":405},[115,738,739],{"class":128},"          git merge-base --is-ancestor \"$GITHUB_SHA\" origin\u002Fmain || {\n",[115,741,742],{"class":117,"line":411},[115,743,744],{"class":128},"            echo \"::error::$GITHUB_REF_NAME is not on main\"; exit 1; }\n",[115,746,747,749,751,753],{"class":117,"line":430},[115,748,680],{"class":146},[115,750,683],{"class":232},[115,752,571],{"class":146},[115,754,755],{"class":128},"astral-sh\u002Fsetup-uv@v6\n",[115,757,758,760,763,765],{"class":117,"line":442},[115,759,680],{"class":146},[115,761,762],{"class":232},"run",[115,764,571],{"class":146},[115,766,767],{"class":128},"uv sync --locked --group dev\n",[115,769,770,772,774,776],{"class":117,"line":472},[115,771,680],{"class":146},[115,773,762],{"class":232},[115,775,571],{"class":146},[115,777,778],{"class":128},"uv run pytest -q\n",[115,780,781,783,785,787],{"class":117,"line":481},[115,782,680],{"class":146},[115,784,762],{"class":232},[115,786,571],{"class":146},[115,788,789],{"class":128},"uv build\n",[115,791,792,794,796,798],{"class":117,"line":486},[115,793,680],{"class":146},[115,795,568],{"class":232},[115,797,571],{"class":146},[115,799,800],{"class":128},"Version must match the tag\n",[115,802,803,806,808],{"class":117,"line":491},[115,804,805],{"class":232},"        id",[115,807,571],{"class":146},[115,809,810],{"class":128},"meta\n",[115,812,813,815,817],{"class":117,"line":508},[115,814,724],{"class":232},[115,816,571],{"class":146},[115,818,729],{"class":135},[115,820,822],{"class":117,"line":821},31,[115,823,824],{"class":128},"          version=\"${GITHUB_REF_NAME#v}\"\n",[115,826,828],{"class":117,"line":827},32,[115,829,830],{"class":128},"          test -f \"dist\u002Fmytool-${version}-py3-none-any.whl\" || {\n",[115,832,834],{"class":117,"line":833},33,[115,835,836],{"class":128},"            echo \"::error::built files do not match ${GITHUB_REF_NAME}\"; ls dist; exit 1; }\n",[115,838,840],{"class":117,"line":839},34,[115,841,842],{"class":128},"          echo \"version=${version}\" >> \"$GITHUB_OUTPUT\"\n",[115,844,846,848,850,852],{"class":117,"line":845},35,[115,847,680],{"class":146},[115,849,762],{"class":232},[115,851,571],{"class":146},[115,853,854],{"class":128},"python scripts\u002Frelease_notes.py \"$GITHUB_REF_NAME\" > dist\u002FNOTES.md\n",[115,856,858,860,862,864],{"class":117,"line":857},36,[115,859,680],{"class":146},[115,861,683],{"class":232},[115,863,571],{"class":146},[115,865,866],{"class":128},"actions\u002Fupload-artifact@v4\n",[115,868,870,872,875,877,879,882,885,888,890,893],{"class":117,"line":869},37,[115,871,693],{"class":232},[115,873,874],{"class":146},": { ",[115,876,568],{"class":232},[115,878,571],{"class":146},[115,880,881],{"class":128},"dist",[115,883,884],{"class":146},", ",[115,886,887],{"class":232},"path",[115,889,571],{"class":146},[115,891,892],{"class":128},"dist\u002F",[115,894,895],{"class":146}," }\n",[115,897,899],{"class":117,"line":898},38,[115,900,154],{"emptyLinePlaceholder":153},[115,902,904,907],{"class":117,"line":903},39,[115,905,906],{"class":232},"  publish",[115,908,298],{"class":146},[115,910,912,915,917],{"class":117,"line":911},40,[115,913,914],{"class":232},"    needs",[115,916,571],{"class":146},[115,918,919],{"class":128},"build\n",[115,921,923,925,927],{"class":117,"line":922},41,[115,924,646],{"class":232},[115,926,571],{"class":146},[115,928,651],{"class":128},[115,930,932,935,937],{"class":117,"line":931},42,[115,933,934],{"class":232},"    environment",[115,936,571],{"class":146},[115,938,939],{"class":128},"pypi\n",[115,941,943,946],{"class":117,"line":942},43,[115,944,945],{"class":232},"    permissions",[115,947,298],{"class":146},[115,949,951,954,956],{"class":117,"line":950},44,[115,952,953],{"class":232},"      id-token",[115,955,571],{"class":146},[115,957,958],{"class":128},"write\n",[115,960,962,964],{"class":117,"line":961},45,[115,963,673],{"class":232},[115,965,298],{"class":146},[115,967,969,971,973,975],{"class":117,"line":968},46,[115,970,680],{"class":146},[115,972,683],{"class":232},[115,974,571],{"class":146},[115,976,977],{"class":128},"actions\u002Fdownload-artifact@v4\n",[115,979,981,983,985,987,989,991,993,995,997,999],{"class":117,"line":980},47,[115,982,693],{"class":232},[115,984,874],{"class":146},[115,986,568],{"class":232},[115,988,571],{"class":146},[115,990,881],{"class":128},[115,992,884],{"class":146},[115,994,887],{"class":232},[115,996,571],{"class":146},[115,998,881],{"class":128},[115,1000,895],{"class":146},[115,1002,1004,1006,1008,1010],{"class":117,"line":1003},48,[115,1005,680],{"class":146},[115,1007,762],{"class":232},[115,1009,571],{"class":146},[115,1011,1012],{"class":128},"rm dist\u002FNOTES.md\n",[115,1014,1016,1018,1020,1022],{"class":117,"line":1015},49,[115,1017,680],{"class":146},[115,1019,683],{"class":232},[115,1021,571],{"class":146},[115,1023,1024],{"class":128},"pypa\u002Fgh-action-pypi-publish@release\u002Fv1\n",[115,1026,1028],{"class":117,"line":1027},50,[115,1029,154],{"emptyLinePlaceholder":153},[115,1031,1033,1036],{"class":117,"line":1032},51,[115,1034,1035],{"class":232},"  github-release",[115,1037,298],{"class":146},[115,1039,1041,1043,1045,1048,1050,1053],{"class":117,"line":1040},52,[115,1042,914],{"class":232},[115,1044,596],{"class":146},[115,1046,1047],{"class":128},"build",[115,1049,884],{"class":146},[115,1051,1052],{"class":128},"publish",[115,1054,602],{"class":146},[115,1056,1058,1060,1062],{"class":117,"line":1057},53,[115,1059,646],{"class":232},[115,1061,571],{"class":146},[115,1063,651],{"class":128},[115,1065,1067,1069],{"class":117,"line":1066},54,[115,1068,945],{"class":232},[115,1070,298],{"class":146},[115,1072,1074,1077,1079],{"class":117,"line":1073},55,[115,1075,1076],{"class":232},"      contents",[115,1078,571],{"class":146},[115,1080,958],{"class":128},[115,1082,1084,1086],{"class":117,"line":1083},56,[115,1085,673],{"class":232},[115,1087,298],{"class":146},[115,1089,1091,1093,1095,1097],{"class":117,"line":1090},57,[115,1092,680],{"class":146},[115,1094,683],{"class":232},[115,1096,571],{"class":146},[115,1098,977],{"class":128},[115,1100,1102,1104,1106,1108,1110,1112,1114,1116,1118,1120],{"class":117,"line":1101},58,[115,1103,693],{"class":232},[115,1105,874],{"class":146},[115,1107,568],{"class":232},[115,1109,571],{"class":146},[115,1111,881],{"class":128},[115,1113,884],{"class":146},[115,1115,887],{"class":232},[115,1117,571],{"class":146},[115,1119,881],{"class":128},[115,1121,895],{"class":146},[115,1123,1125,1127,1129,1131],{"class":117,"line":1124},59,[115,1126,680],{"class":146},[115,1128,568],{"class":232},[115,1130,571],{"class":146},[115,1132,1133],{"class":128},"Create the GitHub release\n",[115,1135,1137,1140],{"class":117,"line":1136},60,[115,1138,1139],{"class":232},"        env",[115,1141,298],{"class":146},[115,1143,1145,1148,1150],{"class":117,"line":1144},61,[115,1146,1147],{"class":232},"          GH_TOKEN",[115,1149,571],{"class":146},[115,1151,1152],{"class":128},"${{ github.token }}\n",[115,1154,1156,1158,1160],{"class":117,"line":1155},62,[115,1157,724],{"class":232},[115,1159,571],{"class":146},[115,1161,729],{"class":135},[115,1163,1165],{"class":117,"line":1164},63,[115,1166,1167],{"class":128},"          prerelease=\"\"\n",[115,1169,1171],{"class":117,"line":1170},64,[115,1172,1173],{"class":128},"          case \"$GITHUB_REF_NAME\" in *a*|*b*|*rc*) prerelease=\"--prerelease\";; esac\n",[115,1175,1177],{"class":117,"line":1176},65,[115,1178,1179],{"class":128},"          gh release create \"$GITHUB_REF_NAME\" dist\u002F*.whl dist\u002F*.tar.gz \\\n",[115,1181,1183],{"class":117,"line":1182},66,[115,1184,1185],{"class":128},"            --repo \"$GITHUB_REPOSITORY\" --title \"mytool ${{ needs.build.outputs.version }}\" \\\n",[115,1187,1189],{"class":117,"line":1188},67,[115,1190,1191],{"class":128},"            --notes-file dist\u002FNOTES.md $prerelease\n",[1193,1194,1196],"h3",{"id":1195},"the-guards","The guards",[10,1198,1199,1204,1205,1208,1209,1211],{},[19,1200,1201,1202,28],{},"The tag must be on ",[14,1203,85],{}," Tags can be pushed from any commit, including one on an abandoned branch. ",[14,1206,1207],{},"git merge-base --is-ancestor"," fails unless the tagged commit is reachable from ",[14,1210,85],{},", so a release always contains reviewed code.",[88,1213],{"name":1214},"ci-tag-guard",[10,1216,1217,1220,1221,1223],{},[19,1218,1219],{},"The version must match the tag."," With a tag-derived version this check can never fail; with a static version in ",[14,1222,16],{},", it catches the forgotten bump before anything is uploaded — important because PyPI never allows a version to be re-uploaded.",[10,1225,1226,1229,1230,1232],{},[19,1227,1228],{},"Tests run on the tagged commit."," They already passed on ",[14,1231,85],{},", but running them again in the release job costs a minute and guarantees the artefact was built from a green state.",[10,1234,1235,1238,1239,1241,1242,1245],{},[19,1236,1237],{},"Permissions are per job."," Only ",[14,1240,1052],{}," can mint an OIDC token; only ",[14,1243,1244],{},"github-release"," can write to the repository. The build job, which runs your dependencies' code, can do neither.",[1193,1247,1249],{"id":1248},"pre-releases","Pre-releases",[10,1251,1252,1253,1256,1257,1260,1261,1264,1265,1268],{},"Tags such as ",[14,1254,1255],{},"v1.5.0rc1"," follow the same path. PEP 440 treats them as pre-releases, so ",[14,1258,1259],{},"pip"," and ",[14,1262,1263],{},"uv"," will not install them unless asked (",[14,1266,1267],{},"--pre"," or an exact version), and the workflow marks the GitHub release as a pre-release. That makes release candidates a low-risk way to test the pipeline itself and to let early adopters try a version.",[30,1270,1272],{"id":1271},"ux-considerations","UX considerations",[35,1274,1275],{},[38,1276,1277,1280,1281,1284,1285,1288,1289,1291],{},[19,1278,1279],{},"Make tagging easy to do right."," A short ",[14,1282,1283],{},"scripts\u002Frelease.sh"," or a ",[14,1286,1287],{},"just release 1.5.0"," recipe that checks the working tree is clean, that ",[14,1290,85],{}," is up to date, and that the changelog has a section for the version — then creates an annotated tag and pushes it — removes the last manual mistakes.",[88,1293],{"name":1294},"ci-release-terminal",[35,1296,1297,1307,1313,1323],{},[38,1298,1299,1302,1303,1306],{},[19,1300,1301],{},"Keep the release visible."," ",[14,1304,1305],{},"gh run watch --exit-status"," in the release script follows the workflow from the terminal and exits non-zero if it fails.",[38,1308,1309,1312],{},[19,1310,1311],{},"Attach the artefacts to the GitHub release."," Some users and packagers download from GitHub rather than PyPI; attaching the exact wheel and sdist gives them the same files.",[38,1314,1315,1318,1319,28],{},[19,1316,1317],{},"Announce what changed where users look."," A CLI can also tell users about new versions itself — a gentle \"a new version is available\" check, rate-limited and disabled in CI — as discussed in ",[24,1320,1322],{"href":1321},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fexposing-version-info-and-build-metadata\u002F","exposing version info and build metadata",[38,1324,1325,1328],{},[19,1326,1327],{},"Plan for mistakes."," A broken release cannot be overwritten on PyPI. Yank it (it stays downloadable for pinned installs but is skipped by resolvers) and release a patch version; say so in the changelog.",[30,1330,1332],{"id":1331},"testing-the-behaviour","Testing the behaviour",[10,1334,1335],{},"The release notes script is ordinary Python and deserves ordinary tests:",[106,1337,1339],{"className":108,"code":1338,"language":110,"meta":111,"style":111},"# tests\u002Ftest_release_notes.py\nimport pytest\n\nfrom scripts.release_notes import section\n\nCHANGELOG = \"\"\"# Changelog\n\n## [1.5.0] - 2026-09-18\n### Added\n- `mytool doctor` command.\n\n## [1.4.2] - 2026-08-30\n### Fixed\n- Windows path handling.\n\"\"\"\n\n\ndef test_extracts_one_section():\n    assert section(CHANGELOG, \"1.5.0\") == \"### Added\\n- `mytool doctor` command.\"\n\n\ndef test_accepts_v_prefix_in_headings():\n    assert \"Windows\" in section(CHANGELOG.replace(\"[1.4.2]\", \"[v1.4.2]\"), \"1.4.2\")\n\n\ndef test_missing_section_stops_the_release():\n    with pytest.raises(SystemExit):\n        section(CHANGELOG, \"9.9.9\")\n",[14,1340,1341,1346,1353,1357,1369,1373,1383,1387,1392,1397,1402,1406,1411,1416,1421,1426,1430,1434,1444,1472,1476,1480,1489,1522,1526,1530,1539,1553],{"__ignoreMap":111},[115,1342,1343],{"class":117,"line":118},[115,1344,1345],{"class":121},"# tests\u002Ftest_release_notes.py\n",[115,1347,1348,1350],{"class":117,"line":125},[115,1349,160],{"class":135},[115,1351,1352],{"class":146}," pytest\n",[115,1354,1355],{"class":117,"line":132},[115,1356,154],{"emptyLinePlaceholder":153},[115,1358,1359,1361,1364,1366],{"class":117,"line":150},[115,1360,136],{"class":135},[115,1362,1363],{"class":146}," scripts.release_notes ",[115,1365,160],{"class":135},[115,1367,1368],{"class":146}," section\n",[115,1370,1371],{"class":117,"line":157},[115,1372,154],{"emptyLinePlaceholder":153},[115,1374,1375,1378,1380],{"class":117,"line":166},[115,1376,1377],{"class":139},"CHANGELOG",[115,1379,198],{"class":135},[115,1381,1382],{"class":128}," \"\"\"# Changelog\n",[115,1384,1385],{"class":117,"line":174},[115,1386,154],{"emptyLinePlaceholder":153},[115,1388,1389],{"class":117,"line":187},[115,1390,1391],{"class":128},"## [1.5.0] - 2026-09-18\n",[115,1393,1394],{"class":117,"line":192},[115,1395,1396],{"class":128},"### Added\n",[115,1398,1399],{"class":117,"line":262},[115,1400,1401],{"class":128},"- `mytool doctor` command.\n",[115,1403,1404],{"class":117,"line":267},[115,1405,154],{"emptyLinePlaceholder":153},[115,1407,1408],{"class":117,"line":272},[115,1409,1410],{"class":128},"## [1.4.2] - 2026-08-30\n",[115,1412,1413],{"class":117,"line":301},[115,1414,1415],{"class":128},"### Fixed\n",[115,1417,1418],{"class":117,"line":316},[115,1419,1420],{"class":128},"- Windows path handling.\n",[115,1422,1423],{"class":117,"line":331},[115,1424,1425],{"class":128},"\"\"\"\n",[115,1427,1428],{"class":117,"line":345},[115,1429,154],{"emptyLinePlaceholder":153},[115,1431,1432],{"class":117,"line":354},[115,1433,154],{"emptyLinePlaceholder":153},[115,1435,1436,1438,1441],{"class":117,"line":363},[115,1437,275],{"class":135},[115,1439,1440],{"class":278}," test_extracts_one_section",[115,1442,1443],{"class":146},"():\n",[115,1445,1446,1449,1452,1454,1456,1459,1462,1464,1467,1469],{"class":117,"line":369},[115,1447,1448],{"class":135},"    assert",[115,1450,1451],{"class":146}," section(",[115,1453,1377],{"class":139},[115,1455,884],{"class":146},[115,1457,1458],{"class":128},"\"1.5.0\"",[115,1460,1461],{"class":146},") ",[115,1463,386],{"class":135},[115,1465,1466],{"class":128}," \"### Added",[115,1468,422],{"class":139},[115,1470,1471],{"class":128},"- `mytool doctor` command.\"\n",[115,1473,1474],{"class":117,"line":392},[115,1475,154],{"emptyLinePlaceholder":153},[115,1477,1478],{"class":117,"line":398},[115,1479,154],{"emptyLinePlaceholder":153},[115,1481,1482,1484,1487],{"class":117,"line":405},[115,1483,275],{"class":135},[115,1485,1486],{"class":278}," test_accepts_v_prefix_in_headings",[115,1488,1443],{"class":146},[115,1490,1491,1493,1496,1499,1501,1503,1506,1509,1511,1514,1517,1520],{"class":117,"line":411},[115,1492,1448],{"class":135},[115,1494,1495],{"class":128}," \"Windows\"",[115,1497,1498],{"class":135}," in",[115,1500,1451],{"class":146},[115,1502,1377],{"class":139},[115,1504,1505],{"class":146},".replace(",[115,1507,1508],{"class":128},"\"[1.4.2]\"",[115,1510,884],{"class":146},[115,1512,1513],{"class":128},"\"[v1.4.2]\"",[115,1515,1516],{"class":146},"), ",[115,1518,1519],{"class":128},"\"1.4.2\"",[115,1521,259],{"class":146},[115,1523,1524],{"class":117,"line":430},[115,1525,154],{"emptyLinePlaceholder":153},[115,1527,1528],{"class":117,"line":442},[115,1529,154],{"emptyLinePlaceholder":153},[115,1531,1532,1534,1537],{"class":117,"line":472},[115,1533,275],{"class":135},[115,1535,1536],{"class":278}," test_missing_section_stops_the_release",[115,1538,1443],{"class":146},[115,1540,1541,1544,1547,1550],{"class":117,"line":481},[115,1542,1543],{"class":135},"    with",[115,1545,1546],{"class":146}," pytest.raises(",[115,1548,1549],{"class":139},"SystemExit",[115,1551,1552],{"class":146},"):\n",[115,1554,1555,1558,1560,1562,1565],{"class":117,"line":486},[115,1556,1557],{"class":146},"        section(",[115,1559,1377],{"class":139},[115,1561,884],{"class":146},[115,1563,1564],{"class":128},"\"9.9.9\"",[115,1566,259],{"class":146},[10,1568,1569,1570,1573,1574,1577,1578,1581],{},"For the workflow, the most effective test is a pre-release tag on a real repository — ",[14,1571,1572],{},"v0.0.1rc1"," on a fresh project, or an ",[14,1575,1576],{},"rc"," of your next version. It exercises every job, including the OIDC exchange and the GitHub release, at almost no risk to users. ",[14,1579,1580],{},"actionlint"," catches syntax and expression errors before you push.",[30,1583,1585],{"id":1584},"conclusion","Conclusion",[10,1587,1588,1589,1591],{},"Tag-driven releases reduce shipping a new version to one deliberate act — pushing an annotated tag on ",[14,1590,85],{}," — and let CI do everything else in a fixed order: verify the tag, test, build, check the version, publish with trusted publishing, and create a GitHub release from the changelog. Every artefact comes from the same commit, every step leaves a log, and a failed release is fixed by deleting a tag rather than untangling a half-published version.",[30,1593,1595],{"id":1594},"frequently-asked-questions","Frequently asked questions",[1193,1597,1599],{"id":1598},"should-the-pipeline-create-the-tag-instead-of-a-person","Should the pipeline create the tag instead of a person?",[10,1601,1602,1603,1606],{},"Tools such as ",[14,1604,1605],{},"python-semantic-release"," or release-please compute the next version from commit messages and create the tag and changelog automatically, often through a release pull request. That works well for teams disciplined about conventional commits. A human-pushed tag keeps the decision explicit, which many CLI maintainers prefer.",[1193,1608,1610],{"id":1609},"what-if-i-need-to-re-run-a-failed-release","What if I need to re-run a failed release?",[10,1612,1613],{},"If nothing was published, re-run the failed jobs from the Actions UI, or delete and re-push the tag after a fix. If PyPI already has the version, you cannot upload it again — publish the next patch version instead.",[1193,1615,1617],{"id":1616},"can-i-release-from-a-maintenance-branch","Can I release from a maintenance branch?",[10,1619,1620,1621,1624,1625,1628,1629,1632],{},"Yes: change the ancestor check to accept ",[14,1622,1623],{},"release\u002F*"," branches for patch releases of older lines, and keep the rest of the workflow identical. Tag ",[14,1626,1627],{},"v1.4.3"," on ",[14,1630,1631],{},"release\u002F1.4"," and the same pipeline publishes it.",[1193,1634,1636],{"id":1635},"how-do-users-verify-that-a-release-really-came-from-this-pipeline","How do users verify that a release really came from this pipeline?",[10,1638,1639,1640,1643,1644,1647,1648,1651],{},"Trusted publishing already attaches PEP 740 attestations to every file on PyPI, linking it to the repository and workflow run. For the files attached to the GitHub release, add ",[14,1641,1642],{},"actions\u002Fattest-build-provenance"," to the build job; users can then run ",[14,1645,1646],{},"gh attestation verify mytool-1.5.0-py3-none-any.whl --repo acme\u002Fmytool",". Publishing a ",[14,1649,1650],{},"SHA256SUMS"," file alongside the artefacts gives anyone without the GitHub CLI a simpler integrity check.",[1193,1653,1655],{"id":1654},"what-should-stay-manual","What should stay manual?",[10,1657,1658],{},"Deciding that a release should happen, choosing its version number, and reading the changelog section before tagging. Those are judgement calls that automation handles poorly. Everything after the tag — building, testing, publishing, announcing — is mechanical and should never depend on someone remembering a step.",[1193,1660,1662],{"id":1661},"lightweight-or-annotated-tags","Lightweight or annotated tags?",[10,1664,1665,1666,1669,1670,1673,1674,1676],{},"Annotated (",[14,1667,1668],{},"git tag -a","). They record who created the tag and when, carry a message, and are what ",[14,1671,1672],{},"git describe"," — and therefore ",[14,1675,43],{}," — uses by default.",[30,1678,1680],{"id":1679},"related","Related",[35,1682,1683,1689,1694,1699,1704],{},[38,1684,1685,1686],{},"Up: ",[24,1687,1688],{"href":26},"CI\u002FCD pipelines for Python CLIs",[38,1690,1691],{},[24,1692,1693],{"href":74},"Publishing to PyPI with trusted publishing",[38,1695,1696],{},[24,1697,1698],{"href":51},"Deriving versions from git tags with hatch-vcs",[38,1700,1701],{},[24,1702,1703],{"href":67},"Automating changelogs with conventional commits",[38,1705,1706],{},[24,1707,1709],{"href":1708},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fsemantic-versioning-policy-for-cli-tools\u002F","Semantic versioning policy for CLI tools",[1711,1712,1713],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .sA_wV, html code.shiki .sA_wV{--shiki-default:#032F62;--shiki-dark:#DBEDFF}html pre.shiki code .snhLl, html code.shiki .snhLl{--shiki-default:#22863A;--shiki-default-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}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 .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":111,"searchDepth":125,"depth":125,"links":1715},[1716,1717,1718,1719,1723,1724,1725,1726,1734],{"id":32,"depth":125,"text":33},{"id":78,"depth":125,"text":79},{"id":100,"depth":125,"text":101},{"id":550,"depth":125,"text":551,"children":1720},[1721,1722],{"id":1195,"depth":132,"text":1196},{"id":1248,"depth":132,"text":1249},{"id":1271,"depth":125,"text":1272},{"id":1331,"depth":125,"text":1332},{"id":1584,"depth":125,"text":1585},{"id":1594,"depth":125,"text":1595,"children":1727},[1728,1729,1730,1731,1732,1733],{"id":1598,"depth":132,"text":1599},{"id":1609,"depth":132,"text":1610},{"id":1616,"depth":132,"text":1617},{"id":1635,"depth":132,"text":1636},{"id":1654,"depth":132,"text":1655},{"id":1661,"depth":132,"text":1662},{"id":1679,"depth":125,"text":1680},"2026-09-18","Release a Python CLI by pushing a tag: version from git, guards against wrong commits, release notes from the changelog, PyPI publishing and a GitHub release.","intermediate",false,"md",{},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fautomating-releases-from-git-tags",{"title":5,"description":1736},"project-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fautomating-releases-from-git-tags\u002Findex",[1745,1746,1747,1748,1749],"release","git","github-actions","versioning","changelog","XluXgF9fT_e2EsVj5cuSaDtPK2HDBq-xEpcjhSAHVeI",[1752,1755,1758,1761,1764,1767,1770,1773,1776,1779,1782,1785,1788,1791,1794,1797,1800,1803,1806,1809,1812,1815,1818,1821,1824,1827,1830,1833,1836,1839,1842,1845,1848,1851,1854,1857,1860,1863,1866,1869,1872,1875,1878,1881,1884,1887,1890,1893,1896,1899,1902,1905,1908,1911,1914,1917,1920,1923,1926,1929,1932,1935,1938,1941,1944,1947,1950,1953,1956,1959,1962,1965,1968,1971,1974,1977,1980,1983,1986,1989,1992,1995,1998,2001,2004,2007,2010,2013,2016,2019,2022,2025,2028,2031,2034,2037,2040,2043,2046,2049,2052,2055,2058,2061,2064,2067,2070,2073,2076,2079,2082,2085,2088,2091,2094,2097,2100,2103,2106,2109,2112,2115,2118,2121,2124,2127,2130,2133,2136,2139,2142,2145,2148,2151,2154,2155,2158,2161,2164,2167,2170,2173,2176,2179,2182,2185,2188,2191,2194,2197,2200,2203,2206,2209,2212,2215,2218,2221,2224,2227,2230,2233,2236,2239,2242,2245,2248,2251,2254,2257,2260,2263,2266,2269,2272,2275,2278,2281,2284,2287,2290,2293,2296],{"path":1753,"title":1754},"\u002Fabout","About Python CLI Toolcraft",{"path":1756,"title":1757},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies","Advanced Argument Validation Strategies",{"path":1759,"title":1760},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fparsing-nested-json-arguments-in-python-clis","Parsing Nested JSON Args in Python CLIs",{"path":1762,"title":1763},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-dependent-and-conflicting-options","Validating Dependent and Conflicting CLI Options",{"path":1765,"title":1766},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-file-and-directory-paths-in-clis","Validating File and Directory Paths in CLIs",{"path":1768,"title":1769},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fwriting-custom-click-parameter-types","Writing Custom Click Parameter Types",{"path":1771,"title":1772},"\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":1774,"title":1775},"\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":1777,"title":1778},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual","Building Terminal UIs with Textual for Python CLIs",{"path":1780,"title":1781},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Ftesting-textual-apps-with-pilot","Testing Textual Apps with Pilot",{"path":1783,"title":1784},"\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":1786,"title":1787},"\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":1789,"title":1790},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation","CLI Help Output and Documentation",{"path":1792,"title":1793},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fversioning-and-deprecating-cli-flags","Versioning and Deprecating CLI Flags",{"path":1795,"title":1796},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fwriting-help-text-users-actually-read","Writing Help Text Users Actually Read",{"path":1798,"title":1799},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fadapting-output-to-terminal-width","Adapting Python CLI Output to Terminal Width",{"path":1801,"title":1802},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fdetecting-ci-environments-and-non-interactive-shells","Detecting CI Environments and Non-Interactive Shells",{"path":1804,"title":1805},"\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":1807,"title":1808},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility","Cross-Platform Terminal Compatibility for Python CLIs",{"path":1810,"title":1811},"\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":1813,"title":1814},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fchoosing-exit-codes-for-cli-tools","Choosing Exit Codes for CLI Tools",{"path":1816,"title":1817},"\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":1819,"title":1820},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Ffriendly-error-messages-and-tracebacks","Friendly Error Messages and Tracebacks",{"path":1822,"title":1823},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fhandling-keyboard-interrupt-cleanly","Handling Keyboard Interrupt Cleanly",{"path":1825,"title":1826},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes","Error Handling and Exit Codes for CLIs",{"path":1828,"title":1829},"\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":1831,"title":1832},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fconfig-precedence-flags-env-files-defaults","Config Precedence: Flags, Env, Files, Defaults",{"path":1834,"title":1835},"\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":1837,"title":1838},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars","Handling Config Files and Env Vars in CLIs",{"path":1840,"title":1841},"\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":1843,"title":1844},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Freading-toml-config-with-tomllib","Reading TOML Config with tomllib in Python CLIs",{"path":1846,"title":1847},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Ftyped-settings-with-pydantic-settings","Typed Settings with pydantic-settings in Python CLIs",{"path":1849,"title":1850},"\u002Fadvanced-input-parsing-user-experience","Advanced Input Parsing for Python CLIs",{"path":1852,"title":1853},"\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":1855,"title":1856},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Fbuilding-interactive-prompts-and-menus","Building Interactive Prompts and Menus in Python CLIs",{"path":1858,"title":1859},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich","Interactive Terminal UI with Rich",{"path":1861,"title":1862},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Flive-dashboards-with-rich-live","Live Dashboards with Rich Live in Python CLIs",{"path":1864,"title":1865},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Frendering-tables-and-json-with-rich","Rendering Tables and JSON with Rich",{"path":1867,"title":1868},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Ftheming-rich-output-consistently","Theming Rich Output Consistently in Python CLIs",{"path":1870,"title":1871},"\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":1873,"title":1874},"\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":1876,"title":1877},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis","Shell Completion for Python CLIs",{"path":1879,"title":1880},"\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":1882,"title":1883},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Ftesting-shell-completion-in-python-clis","Testing Shell Completion in Python CLIs",{"path":1885,"title":1886},"\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":1888,"title":1889},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fadding-verbose-and-quiet-logging-flags","Adding Verbose and Quiet Logging Flags",{"path":1891,"title":1892},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps","Structured Logging for CLI Apps",{"path":1894,"title":1895},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fstructured-json-logging-in-python-clis","Structured JSON Logging in Python CLIs",{"path":1897,"title":1898},"\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":1900,"title":1901},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fdetecting-tty-and-adapting-output","Detecting a TTY and Adapting Output",{"path":1903,"title":1904},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Femitting-json-output-for-scripting","Emitting JSON Output for Scripting",{"path":1906,"title":1907},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fhandling-broken-pipe-and-sigpipe","Handling Broken Pipe and SIGPIPE",{"path":1909,"title":1910},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes","Working with stdin, stdout and Pipes",{"path":1912,"title":1913},"\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":1915,"title":1916},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Freading-piped-input-in-python-clis","Reading Piped Input in Python CLIs",{"path":1918,"title":1919},"\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":1921,"title":1922},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fdownloading-files-with-progress-in-python","Downloading Files with Progress in Python CLIs",{"path":1924,"title":1925},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis","Calling HTTP APIs from Python CLIs",{"path":1927,"title":1928},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Foauth-device-flow-login-for-clis","OAuth Device Flow Login for Python CLIs",{"path":1930,"title":1931},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fpaginating-api-results-in-a-cli","Paginating API Results in a Python CLI",{"path":1933,"title":1934},"\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":1936,"title":1937},"\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":1939,"title":1940},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis","Concurrency and Async in Python CLIs",{"path":1942,"title":1943},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fmultiprocessing-for-cpu-bound-cli-tasks","Multiprocessing for CPU-Bound CLI Tasks",{"path":1945,"title":1946},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fparallelising-cli-work-with-thread-pools","Parallelising CLI Work with Thread Pools",{"path":1948,"title":1949},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Frate-limiting-concurrent-requests-in-clis","Rate-Limiting Concurrent Requests in Python CLIs",{"path":1951,"title":1952},"\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":1954,"title":1955},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fcross-platform-paths-with-pathlib","Cross-Platform Paths with pathlib in CLIs",{"path":1957,"title":1958},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Ffile-locking-for-concurrent-cli-runs","File Locking for Concurrent CLI Runs in Python",{"path":1960,"title":1961},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes","Filesystem Paths and Atomic Writes for CLIs",{"path":1963,"title":1964},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fsafe-temporary-files-and-directories","Safe Temporary Files and Directories in CLIs",{"path":1966,"title":1967},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fstoring-app-data-with-platformdirs","Storing CLI App Data with platformdirs",{"path":1969,"title":1970},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fwriting-files-atomically-in-python-clis","Writing Files Atomically in Python CLIs",{"path":1972,"title":1973},"\u002Fcli-runtime-systems-integration","CLI Runtime & Systems Integration for Python",{"path":1975,"title":1976},"\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":1978,"title":1979},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fhandling-sigterm-and-graceful-shutdown","Handling SIGTERM and Graceful Shutdown in CLIs",{"path":1981,"title":1982},"\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":1984,"title":1985},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis","Long-Running and Watch-Mode Python CLIs",{"path":1987,"title":1988},"\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":1990,"title":1991},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Favoiding-shell-injection-in-python-clis","Avoiding Shell Injection in Python CLIs",{"path":1993,"title":1994},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fcalling-external-commands-safely-with-subprocess","Calling External Commands Safely with subprocess",{"path":1996,"title":1997},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fhandling-subprocess-timeouts-and-exit-codes","Handling Subprocess Timeouts and Exit Codes",{"path":1999,"title":2000},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis","Running Subprocesses from Python CLIs",{"path":2002,"title":2003},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fstreaming-subprocess-output-in-real-time","Streaming Subprocess Output in Real Time",{"path":2005,"title":2006},"\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":2008,"title":2009},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis","Secrets and Credentials in Python CLIs",{"path":2011,"title":2012},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fprompting-for-passwords-securely","Prompting for Passwords Securely in Python CLIs",{"path":2014,"title":2015},"\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":2017,"title":2018},"\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":2020,"title":2021},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fstoring-tokens-with-keyring","Storing CLI Tokens Securely with keyring",{"path":2023,"title":2024},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fsupporting-multiple-profiles-and-accounts","Supporting Multiple Profiles and Accounts in CLIs",{"path":2026,"title":2027},"\u002F","Python CLI Toolcraft",{"path":2029,"title":2030},"\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":2032,"title":2033},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading","CLI Startup Performance and Lazy Loading",{"path":2035,"title":2036},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Flazy-loading-subcommands-for-faster-startup","Lazy Loading Subcommands for Faster Startup",{"path":2038,"title":2039},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Fprofiling-python-cli-startup-time","Profiling Python CLI Startup Time",{"path":2041,"title":2042},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Freducing-cli-dependency-weight","Reducing CLI Dependency Weight",{"path":2044,"title":2045},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-subparsers-for-subcommands","argparse Subparsers for Subcommands",{"path":2047,"title":2048},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-vs-click-vs-typer-comparison","argparse vs Click vs Typer Compared",{"path":2050,"title":2051},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse","Command-Line Parsing with argparse",{"path":2053,"title":2054},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmigrating-from-argparse-to-typer","Migrating from argparse to Typer",{"path":2056,"title":2057},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmutually-exclusive-options-in-argparse","Mutually Exclusive Options in argparse",{"path":2059,"title":2060},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fwriting-custom-argparse-actions","Writing Custom argparse Actions in Python",{"path":2062,"title":2063},"\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":2065,"title":2066},"\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":2068,"title":2069},"\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":2071,"title":2072},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions","Designing CLI Interfaces and Conventions in Python",{"path":2074,"title":2075},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fnaming-commands-and-flags-consistently","Naming Commands and Flags Consistently in Python CLIs",{"path":2077,"title":2078},"\u002Fmodern-python-cli-frameworks-architecture","Python CLI Frameworks and Architecture",{"path":2080,"title":2081},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fdiscovering-plugins-with-entry-points","Discovering Plugins with Entry Points in Python CLIs",{"path":2083,"title":2084},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fhook-based-plugins-with-pluggy","Hook-Based Plugins for Python CLIs with pluggy",{"path":2086,"title":2087},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis","Plugin Architectures for Extensible CLIs",{"path":2089,"title":2090},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fversioning-a-plugin-api","Versioning a Plugin API for a Python CLI",{"path":2092,"title":2093},"\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":2095,"title":2096},"\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":2098,"title":2099},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fdependency-injection-patterns-for-cli-commands","Dependency Injection Patterns for CLI Commands",{"path":2101,"title":2102},"\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":2104,"title":2105},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis","Structuring Multi-Command Python CLIs",{"path":2107,"title":2108},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-common-options-across-commands","Sharing Common Options Across Python CLI Commands",{"path":2110,"title":2111},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-state-with-click-context-objects","Sharing State with Click Context Objects",{"path":2113,"title":2114},"\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":2116,"title":2117},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications","Testing Python CLI Applications",{"path":2119,"title":2120},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fmeasuring-cli-test-coverage","Measuring CLI Test Coverage",{"path":2122,"title":2123},"\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":2125,"title":2126},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fproperty-based-testing-cli-arguments-with-hypothesis","Property-Based Testing CLI Arguments with Hypothesis",{"path":2128,"title":2129},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fsnapshot-testing-cli-output","Snapshot Testing CLI Output",{"path":2131,"title":2132},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-click-commands-with-clirunner","Testing Click Commands with CliRunner",{"path":2134,"title":2135},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-interactive-prompts-and-stdin","Testing Interactive Prompts and stdin",{"path":2137,"title":2138},"\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":2140,"title":2141},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fbuilding-dynamic-commands-in-click","Building Dynamic Commands in Click",{"path":2143,"title":2144},"\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":2146,"title":2147},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each","Typer vs Click: When to Use Each",{"path":2149,"title":2150},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Ftyper-callback-functions-explained","Typer callback functions explained",{"path":2152,"title":2153},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fusing-annotated-options-in-typer","Using Annotated Options in Typer",{"path":1741,"title":5},{"path":2156,"title":2157},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fcaching-uv-dependencies-in-ci","Caching uv Dependencies in CI for Python CLIs",{"path":2159,"title":2160},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis","CI\u002FCD Pipelines for Python CLIs",{"path":2162,"title":2163},"\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":2165,"title":2166},"\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":2168,"title":2169},"\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":2171,"title":2172},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fbuilding-a-cookiecutter-template-for-typer-clis","Building a Cookiecutter Template for Typer CLIs",{"path":2174,"title":2175},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fcopier-vs-cookiecutter-for-cli-templates","Copier vs Cookiecutter for CLI Templates",{"path":2177,"title":2178},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter","CLI Project Scaffolding with Cookiecutter",{"path":2180,"title":2181},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fpost-generation-hooks-in-cli-templates","Post-Generation Hooks in Python CLI Templates",{"path":2183,"title":2184},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbuilding-cross-platform-release-binaries-in-ci","Building Cross-Platform Release Binaries in CI",{"path":2186,"title":2187},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbundling-a-python-cli-with-pyinstaller","Bundling a Python CLI with PyInstaller",{"path":2189,"title":2190},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fhomebrew-and-scoop-packaging-for-python-clis","Homebrew and Scoop Packaging for Python CLIs",{"path":2192,"title":2193},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries","Distributing CLIs as Standalone Binaries",{"path":2195,"title":2196},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fnuitka-vs-pyinstaller-for-python-clis","Nuitka vs PyInstaller for Python CLI Binaries",{"path":2198,"title":2199},"\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":2201,"title":2202},"\u002Fproject-setup-dependency-management","Project Setup & Dependency Management",{"path":2204,"title":2205},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Fconfiguring-ruff-for-a-cli-project","Configuring Ruff for a Python CLI Project",{"path":2207,"title":2208},"\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":2210,"title":2211},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code","Linting and Type-Checking Python CLI Code",{"path":2213,"title":2214},"\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":2216,"title":2217},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fautomating-changelogs-with-conventional-commits","Automating Changelogs with Conventional Commits",{"path":2219,"title":2220},"\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":2222,"title":2223},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fexposing-version-info-and-build-metadata","Exposing Version Info and Build Metadata",{"path":2225,"title":2226},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs","Managing CLI Versioning & Changelogs",{"path":2228,"title":2229},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fsemantic-versioning-policy-for-cli-tools","A Semantic Versioning Policy for CLI Tools",{"path":2231,"title":2232},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbuilding-wheels-and-sdists-for-python-clis","Building Wheels and sdists for Python CLIs",{"path":2234,"title":2235},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbundling-data-files-with-importlib-resources","Bundling Data Files with importlib.resources in CLIs",{"path":2237,"title":2238},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution","Packaging Python CLIs for Distribution",{"path":2240,"title":2241},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Finstalling-and-distributing-clis-with-pipx","Installing and Distributing CLIs with pipx",{"path":2243,"title":2244},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fpublishing-a-python-cli-to-pypi","Publishing a Python CLI to PyPI",{"path":2246,"title":2247},"\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":2249,"title":2250},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development","Poetry Workflows for CLI Development",{"path":2252,"title":2253},"\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":2255,"title":2256},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-dependency-groups-for-cli-tooling","Poetry Dependency Groups for CLI Tooling",{"path":2258,"title":2259},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-entry-points-and-scripts-for-clis","Poetry Entry Points and Scripts for CLIs",{"path":2261,"title":2262},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects","Pre-commit Hooks for CLI Projects",{"path":2264,"title":2265},"\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":2267,"title":2268},"\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":2270,"title":2271},"\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":2273,"title":2274},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management","uv for Python CLI Dependency Management",{"path":2276,"title":2277},"\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":2279,"title":2280},"\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":2282,"title":2283},"\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":2285,"title":2286},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-workspaces-for-multi-package-clis","uv Workspaces for Multi-Package Python CLIs",{"path":2288,"title":2289},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices","Python CLI Env Isolation Best Practices",{"path":2291,"title":2292},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fmanaging-virtual-environments-for-cross-platform-clis","Managing Python CLI Virtual Environments",{"path":2294,"title":2295},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fpinning-the-python-version-for-a-cli","Pinning the Python Version for a CLI",{"path":2297,"title":2298},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fsupporting-multiple-python-versions-with-nox","Supporting Multiple Python Versions with nox",1789736907465]