Merge branch 'stable' into bugfix/OptionsAutoCompletion
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Saipraneeth · committed by GitHub · parents 7fc3771, 1c68e53 · Browse files · 114 files·+6464 added−4394 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
114 files+6464 added−4394 removed
- tests:+899 added−92 removed
- other:+5565 added−4302 removed
Provenance
- Commit
11f48e2- Tree
8c8bce4- Author
Saipraneeth <2506664+msaipraneeth@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent 1
7fc3771- Parent 2
1c68e53
114 files changed+6464 added−4394 removed
modified:.github/workflows/lock.yaml+1 added
8 unmodified lines910111213141516177 unmodified lines8 unmodified lines - cron: '0 0 * * *'permissions: issues: write pull-requests: write discussions: writeconcurrency: group: lockjobs: lock:7 unmodified linesmodified:.github/workflows/pre-commit.yaml+16 added-7 removed
5 unmodified lines678910111213141516101112131415161718192021222324255 unmodified linesjobs: main: runs-on: ubuntu-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: 3.x - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 - uses: pre-commit-ci/lite-action@9d882e7a565f7008d4faf128f27d1cb6503d4ebf # v1.0.2 if: ${{ !cancelled() }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0 with: enable-cache: true prune-cache: false - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 id: setup-python with: python-version-file: pyproject.toml - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ~/.cache/pre-commit key: pre-commit|${{ hashFiles('pyproject.toml', '.pre-commit-config.yaml') }} - run: uv run --locked --group pre-commit pre-commit run --show-diff-on-failure --color=always --all-files - uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0 if: ${{ !cancelled() }}modified:.github/workflows/publish.yaml+15 added-43 removed
12345456791089131011151617181912131415161721222324252618192021293031323334353637382240414223242526274728294950515230313233565758343536373839404166674243446945717273name: Publishon: push: tags: - '*' tags: ['*']jobs: build: runs-on: ubuntu-latest outputs: hash: ${{ steps.hash.outputs.hash }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0 with: python-version: '3.x' cache: pip cache-dependency-path: requirements*/*.txt - run: pip install -r requirements/build.txt # Use the commit date instead of the current date during the build. enable-cache: true prune-cache: false - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version-file: pyproject.toml - run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV - run: python -m build # Generate hashes used for provenance. - name: generate hash id: hash run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - run: uv build - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: path: ./dist provenance: needs: [build] permissions: actions: read id-token: write contents: write # Can't pin with hash due to how this workflow works. uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0 with: base64-subjects: ${{ needs.build.outputs.hash }} create-release: # Upload the sdist, wheels, and provenance to a GitHub release. They remain # available as build artifacts for a while as well. needs: [provenance] needs: [build] runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - name: create release run: > gh release create --draft --repo ${{ github.repository }} ${{ github.ref_name }} *.intoto.jsonl/* artifact/* run: gh release create --draft --repo ${{ github.repository }} ${{ github.ref_name }} artifact/* env: GH_TOKEN: ${{ github.token }} publish-pypi: needs: [provenance] # Wait for approval before attempting to upload to PyPI. This allows reviewing the # files in the draft release. needs: [build] environment: name: publish url: https://pypi.org/project/click/${{ github.ref_name }} runs-on: ubuntu-latest permissions: id-token: write steps: - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3 - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 with: repository-url: https://test.pypi.org/legacy/ packages-dir: artifact/ - uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3 with: packages-dir: artifact/modified:.github/workflows/tests.yaml+20 added-21 removed
12345656778910111213141516171819181920212223242223242725262728293031303132333432333435363937384142433940414243444545464748495049name: Testson: pull_request: paths-ignore: ['docs/**', 'README.md'] push: branches: [main, stable] paths-ignore: ['docs/**', '*.md', '*.rst'] pull_request: paths-ignore: [ 'docs/**', '*.md', '*.rst' ] paths-ignore: ['docs/**', 'README.md']jobs: tests: name: ${{ matrix.name || matrix.python }} runs-on: ${{ matrix.os || 'ubuntu-latest' }} strategy: fail-fast: false matrix: include: - {python: '3.13'} - {name: Windows, python: '3.13', os: windows-latest} - {name: Mac, python: '3.13', os: macos-latest} - {python: '3.12'} - {name: Windows, python: '3.12', os: windows-latest} - {name: Mac, python: '3.12', os: macos-latest} - {python: '3.11'} - {python: '3.10'} - {python: '3.9'} - {python: '3.8'} - {name: PyPy, python: 'pypy-3.10', tox: pypy310} - {name: PyPy, python: 'pypy-3.11', tox: pypy3.11} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0 with: enable-cache: true prune-cache: false - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python }} allow-prereleases: true cache: pip cache-dependency-path: requirements*/*.txt - run: pip install tox - run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }} - run: uv run --locked tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }} typing: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0 with: python-version: '3.x' cache: pip cache-dependency-path: requirements*/*.txt enable-cache: true prune-cache: false - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version-file: pyproject.toml - name: cache mypy uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ./.mypy_cache key: mypy|${{ hashFiles('pyproject.toml') }} - run: pip install tox - run: tox run -e typing - run: uv run --locked tox run -e typingdeleted:artwork/logo.svg-75 removed
1-<?xml version="1.0" encoding="UTF-8" standalone="no"?>2-<!-- Created with Inkscape (http://www.inkscape.org/) -->3-4-<svg5- xmlns:dc="http://purl.org/dc/elements/1.1/"6- xmlns:cc="http://creativecommons.org/ns#"7- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"8- xmlns:svg="http://www.w3.org/2000/svg"9- xmlns="http://www.w3.org/2000/svg"10- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"11- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"12- width="237.36929"13- height="110.7928"14- id="svg4837"15- version="1.1"16- inkscape:version="0.48.2 r9819"17- sodipodi:docname="New document 8">18- <defs19- id="defs4839" />20- <sodipodi:namedview21- id="base"22- pagecolor="#ffffff"23- bordercolor="#666666"24- borderopacity="1.0"25- inkscape:pageopacity="0.0"26- inkscape:pageshadow="2"27- inkscape:zoom="0.98994949"28- inkscape:cx="259.76814"29- inkscape:cy="40.769955"30- inkscape:document-units="px"31- inkscape:current-layer="layer1"32- showgrid="false"33- fit-margin-top="10"34- fit-margin-left="10"35- fit-margin-right="10"36- fit-margin-bottom="10"37- inkscape:window-width="1676"38- inkscape:window-height="1006"39- inkscape:window-x="4"40- inkscape:window-y="0"41- inkscape:window-maximized="1" />42- <metadata43- id="metadata4842">44- <rdf:RDF>45- <cc:Work46- rdf:about="">47- <dc:format>image/svg+xml</dc:format>48- <dc:type49- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />50- <dc:title></dc:title>51- </cc:Work>52- </rdf:RDF>53- </metadata>54- <g55- inkscape:label="Layer 1"56- inkscape:groupmode="layer"57- id="layer1"58- transform="translate(-255.43458,-207.38101)">59- <path60- style="fill:#000000"61- d="m 466.33424,306.48462 0,-1.6892 3.16724,0 3.16723,0 0,1.6892 0,1.68919 -3.16723,0 -3.16724,0 0,-1.68919 z m -3.37839,-5.06759 0,-3.37839 1.47804,0 1.47805,0 0,3.37839 0,3.37839 -1.47805,0 -1.47804,0 0,-3.37839 z m 10.13516,0 0,-3.37839 1.47804,0 1.47805,0 0,3.37839 0,3.37839 -1.47805,0 -1.47804,0 0,-3.37839 z m -30.82778,-28.92744 0,-28.92744 1.68919,0 c 1.68919,0 1.68919,0 1.68919,1.68919 0,1.6892 0,1.6892 1.6892,1.6892 1.68919,0 1.68919,0 1.68919,1.68919 0,1.6892 0,1.6892 1.6892,1.6892 1.68919,0 1.68919,0 1.68919,1.68919 0,1.6892 0,1.6892 -1.68919,1.6892 -1.6892,0 -1.6892,0 -1.6892,-1.6892 0,-1.68919 0,-1.68919 -1.68919,-1.68919 l -1.6892,0 0,23.85986 0,23.85985 1.6892,0 c 1.68919,0 1.68919,0 1.68919,1.6892 l 0,1.68919 -3.37839,0 -3.37838,0 0,-28.92744 z m 7.00029,25.22951 c -0.13394,-0.13393 -0.24352,-0.87696 -0.24352,-1.65118 0,-1.36423 0.0529,-1.40766 1.71469,-1.40766 l 1.71468,0 -0.13106,1.58362 c -0.12024,1.45279 -0.24178,1.5892 -1.47117,1.65118 -0.73706,0.0372 -1.44968,-0.042 -1.58362,-0.17596 z m 10.14204,-0.0392 c -0.13814,-0.22352 -0.20454,-1.7545 -0.14756,-3.40219 l 0.10361,-2.99581 1.60373,0 1.60374,0 -0.12334,3.27282 -0.12334,3.27281 -1.33284,0.12938 c -0.73305,0.0712 -1.44586,-0.0535 -1.584,-0.27702 z m 10.30707,-3.03247 0,-3.36553 1.47803,0 1.47805,0 0,3.30997 0,3.30996 -1.47805,0.0556 -1.47803,0.0556 0,-3.36553 z m -17.03271,-0.26872 c -0.15484,-0.15483 -0.28153,-0.91497 -0.28153,-1.68919 0,-1.36073 0.0563,-1.40766 1.68919,-1.40766 1.6892,0 1.6892,0 1.6892,1.6892 0,1.63289 -0.0469,1.68919 -1.40766,1.68919 -0.77422,0 -1.53436,-0.12669 -1.6892,-0.28154 z m 3.09686,-4.99719 c 0,-1.44286 0.0402,-1.47804 1.68919,-1.47804 1.64898,0 1.68919,0.0352 1.68919,1.47804 0,1.44285 -0.0402,1.47805 -1.68919,1.47805 -1.64898,0 -1.68919,-0.0352 -1.68919,-1.47805 z m 10.55746,-1.68919 0,-3.16724 6.75677,0 6.75678,0 0,-1.68919 c 0,-1.64898 0.0351,-1.6892 1.47804,-1.6892 l 1.47804,0 0,3.15652 0,3.15651 -6.6512,0.1163 -6.65119,0.1163 -0.13108,1.58361 c -0.12394,1.49763 -0.20994,1.58363 -1.58361,1.58363 l -1.45255,0 0,-3.16724 z m 10.13516,-8.44597 c 0,-1.40766 0.0704,-1.47804 1.47804,-1.47804 1.40766,0 1.47805,0.0704 1.47805,1.47804 0,1.40766 -0.0704,1.47804 -1.47805,1.47804 -1.40766,0 -1.47804,-0.0704 -1.47804,-1.47804 z m -3.37839,-3.37839 c 0,-1.40766 0.0704,-1.47804 1.47804,-1.47804 1.40767,0 1.47805,0.0704 1.47805,1.47804 0,1.40767 -0.0704,1.47805 -1.47805,1.47805 -1.40765,0 -1.47804,-0.0704 -1.47804,-1.47805 z m -3.37838,-3.37839 c 0,-1.40765 0.0704,-1.47804 1.47803,-1.47804 1.40767,0 1.47805,0.0704 1.47805,1.47804 0,1.40767 -0.0704,1.47805 -1.47805,1.47805 -1.40765,0 -1.47803,-0.0704 -1.47803,-1.47805 z m -3.37839,-3.48871 c 0,-1.52897 0.0553,-1.58931 1.47804,-1.61346 1.43567,-0.0244 1.47804,0.0211 1.47804,1.58838 0,1.56241 -0.0467,1.61345 -1.47804,1.61345 -1.42721,0 -1.47804,-0.0546 -1.47804,-1.58837 z m -3.37839,-3.47921 c 0,-1.64897 0.0351,-1.68919 1.47804,-1.68919 1.44285,0 1.47805,0.0402 1.47805,1.68919 0,1.64898 -0.0352,1.6892 -1.47805,1.6892 -1.44285,0 -1.47804,-0.0403 -1.47804,-1.6892 z m -3.45076,-3.37839 c 0.15328,-1.60738 0.23052,-1.68919 1.59478,-1.68919 1.3911,0 1.43368,0.0502 1.43368,1.68919 0,1.67253 -0.0157,1.6892 -1.59478,1.6892 l -1.59477,0 0.16109,-1.6892 z m -3.30601,-3.37838 c 0,-1.64898 0.0351,-1.6892 1.47804,-1.6892 1.44285,0 1.47804,0.0402 1.47804,1.6892 0,1.64897 -0.0352,1.68919 -1.47804,1.68919 -1.44286,0 -1.47804,-0.0402 -1.47804,-1.68919 z m -3.72061,-3.27282 c 0.12395,-1.49762 0.21706,-1.59073 1.71468,-1.71468 l 1.58363,-0.13107 0,1.71469 0,1.71468 -1.71469,0 -1.71468,0 0.13106,-1.58362 z"62- id="path4856"63- inkscape:connector-curvature="0" />64- <path65- style="fill:#000000"66- d="m 271.34527,247.46047 c 0,-1.32826 -0.94153,-2.12734 -3.05297,-2.59109 -4.04056,-0.88746 -3.19986,-3.08429 1.01754,-2.65894 9.32239,0.94022 10.81407,-3.50307 2.60795,-7.76831 -2.71012,-1.40862 -5.36388,-3.27897 -5.89726,-4.15634 -1.47604,-2.42802 -0.0246,-6.42458 2.80076,-7.7119 1.48697,-0.67751 2.52398,-1.98054 2.52398,-3.17144 0,-1.13017 0.66136,-2.02144 1.5,-2.02144 0.825,0 1.5,0.85122 1.5,1.89159 0,1.19765 0.94321,2.12832 2.57104,2.53688 3.91591,0.98283 2.39946,3.10499 -1.95093,2.73019 -6.99788,-0.60291 -8.93527,3.8291 -2.87011,6.5657 9.0905,4.10163 11.015,9.73021 4.5,13.16112 -1.2375,0.65169 -2.25,2.06905 -2.25,3.1497 0,1.08065 -0.675,1.96482 -1.5,1.96482 -0.825,0 -1.5,-0.86425 -1.5,-1.92054 z m 38.357,-3.07104 c -4.57947,-1.84804 -6.77791,-8.48491 -4.32736,-13.06381 2.11183,-3.94599 10.30093,-6.28597 13.9414,-3.98367 2.2687,1.43477 0.36183,2.48777 -3.94232,2.177 -6.96682,-0.50302 -10.61631,6.27447 -5.91184,10.97894 1.71218,1.71218 2.95483,2.02243 6.5,1.62284 3.13626,-0.35351 4.38312,-0.13272 4.38312,0.77613 0,2.4062 -6.21813,3.27822 -10.643,1.49257 z m 21.1997,-1.23093 c -1.16379,-1.66155 -1.5567,-4.81653 -1.5567,-12.5 l 0,-10.27749 -2.5,0 c -1.55556,0 -2.5,-0.56667 -2.5,-1.5 0,-1.08333 1.11111,-1.5 4,-1.5 l 4,0 0.0153,11.25 c 0.008,6.1875 0.41056,11.87411 0.89363,12.63691 0.54214,0.85607 1.88505,1.19446 3.50856,0.88411 2.94677,-0.56331 4.58181,0.98192 2.46061,2.32547 -2.5829,1.63598 -6.70984,0.98184 -8.32141,-1.319 z m 20.4433,0.22251 c -1.55556,-1.55556 -2,-3.33333 -2,-8 0,-5.73333 -0.11111,-6 -2.5,-6 -1.55556,0 -2.5,-0.56667 -2.5,-1.5 0,-1.08333 1.11111,-1.5 4,-1.5 l 4,0 0.0153,6.75 c 0.0183,8.04891 0.82623,9.70461 4.40219,9.02102 2.94677,-0.56331 4.58181,0.98192 2.46061,2.32547 -2.3358,1.47948 -5.78176,0.99986 -7.87811,-1.09649 z m 18.357,1.00842 c -4.57947,-1.84804 -6.77791,-8.48491 -4.32736,-13.06381 2.11183,-3.94599 10.30093,-6.28597 13.9414,-3.98367 2.2687,1.43477 0.36183,2.48777 -3.94232,2.177 -6.96682,-0.50302 -10.61631,6.27447 -5.91184,10.97894 1.71218,1.71218 2.95483,2.02243 6.5,1.62284 3.13626,-0.35351 4.38312,-0.13272 4.38312,0.77613 0,2.4062 -6.21813,3.27822 -10.643,1.49257 z m 15.86478,-12.67646 c 0.20032,-9.84119 0.6282,-13.78431 1.52822,-14.08333 0.9358,-0.31091 1.25628,1.80502 1.275,8.41804 l 0.025,8.83333 4.01111,-4.25 c 2.32594,-2.46446 4.92367,-4.25 6.18321,-4.25 1.8968,0 1.6121,0.57059 -2.24643,4.50214 l -4.41851,4.50213 4.92271,4.99787 c 3.84161,3.90023 4.49929,4.99786 2.99467,4.99786 -1.06044,0 -4.08102,-2.12058 -6.71241,-4.71241 l -4.78435,-4.71241 0,4.71241 c 0,3.56082 -0.37346,4.71241 -1.52822,4.71241 -1.30999,0 -1.48849,-1.95179 -1.25,-13.66804 z m -37.85759,-9.82527 c -0.34636,-0.90262 -0.15025,-2.12063 0.43581,-2.70669 1.52361,-1.52361 4.41041,-0.13109 4.01242,1.93549 -0.4433,2.30188 -3.64766,2.85743 -4.44823,0.7712 z"67- id="path4887"68- inkscape:connector-curvature="0" />69- <path70- style="fill:#000000;fill-opacity:1;stroke:none"71- d="m 411.32164,243.39982 c 7.38153,0.15924 14.76525,0.0821 22.14736,0.0136 -3.6814,3.83663 -9.42739,1.45689 -14.06576,2.07921 -3.69684,-0.007 -7.3939,0.0151 -11.09,0.0923 1.0029,-0.72825 2.00505,-1.45754 3.0084,-2.18514 z"72- id="path4889"73- inkscape:connector-curvature="0" />74- </g>75-</svg>deleted:docs/_static/click-icon.pngbinary
A binary file, deleted.
added:docs/_static/click-icon.svg+11 added
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>2+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">3+<svg width="100%" height="100%" viewBox="0 0 500 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">4+ <rect id="Icon" x="0" y="0" width="500" height="500" style="fill:none;"/>5+ <g>6+ <path d="M448.569,446.761l-66.389,49.07c-3.528,2.565 -8.018,4.169 -12.508,4.169l-136.626,-0c-19.243,-0 -28.223,-23.733 -14.112,-36.562l54.843,-49.07c3.849,-3.528 8.66,-5.452 14.112,-5.452l147.851,-0c20.526,-0 28.865,25.657 12.829,37.845Z" style="fill:#5c549e;fill-rule:nonzero;"/>7+ <path d="M192.956,406.03l-91.404,84.028c-6.415,6.414 -15.074,9.942 -23.734,9.942c-8.659,-0 -17.318,-3.528 -23.733,-9.942c-13.47,-13.47 -13.47,-34.317 0,-47.467l32.713,-36.561l106.158,-0Z" style="fill:#5c549e;fill-rule:nonzero;"/>8+ <path d="M328.299,216.485l-113.855,-102.309l-109.685,-0l124.118,135.343l-124.118,135.343l108.723,-0.321l114.817,-101.988c8.66,-9.301 13.15,-21.167 12.829,-33.355c0.321,-11.225 -4.169,-23.412 -12.829,-32.713Z" style="fill:#5c549e;fill-rule:nonzero;"/>9+ <path d="M191.994,93.97l-91.405,-84.028c-6.414,-6.414 -15.073,-9.942 -23.733,-9.942c-8.659,0 -17.319,3.528 -23.733,9.942c-13.47,13.47 -13.47,34.317 0,47.467l33.034,36.561l105.837,0Z" style="fill:#5c549e;fill-rule:nonzero;"/>10+ </g>11+</svg>deleted:docs/_static/click-logo-sidebar.pngbinary
A binary file, deleted.
deleted:docs/_static/click-logo.pngbinary
A binary file, deleted.
added:docs/_static/click-logo.svg+18 added
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>2+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">3+<svg width="100%" height="100%" viewBox="0 0 500 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">4+ <rect id="Logo" x="0" y="0" width="500" height="500" style="fill:none;"/>5+ <g>6+ <path id="Box" d="M500,50l0,400c0,27.596 -22.404,50 -50,50l-400,0c-27.596,0 -50,-22.404 -50,-50l0,-400c0,-27.596 22.404,-50 50,-50l400,0c27.596,0 50,22.404 50,50Z" style="fill:url(#_Linear1);"/>7+ <path id="Shadow" d="M500,432.911l0,17.089c0,27.596 -22.404,50 -50,50l-211.576,0l-105.636,-105.637c3.812,3.641 8.857,5.637 13.903,5.637c5.196,0 10.391,-2.117 14.24,-5.965l54.843,-50.417l-40.218,-0l-12.701,-12.701l65.234,-0.192l68.891,-61.193c5.195,-5.581 7.889,-12.701 7.697,-20.013c0.192,-6.735 -2.502,-14.048 -7.697,-19.628l203.02,203.02Zm-284.804,-276.529l12.124,12.123l-63.503,0l-12.123,-12.123l63.502,0Zm153.945,211.674c9.622,-7.312 4.619,-22.706 -7.697,-22.706l-88.711,-0c-3.271,-0 -6.157,1.154 -8.467,3.271l-32.905,29.442c-8.467,7.697 -3.079,21.937 8.467,21.937l81.975,0c2.694,0 5.388,-0.962 7.505,-2.502l39.833,-29.442Z" style="fill:#493e5e;"/>8+ <g id="Icon">9+ <path d="M369.141,368.056l-39.833,29.442c-2.117,1.54 -4.811,2.502 -7.505,2.502l-81.975,0c-11.546,0 -16.934,-14.24 -8.467,-21.937l32.905,-29.442c2.31,-2.117 5.196,-3.271 8.467,-3.271l88.711,-0c12.316,-0 17.319,15.394 7.697,22.706Z" style="fill:#fff;fill-rule:nonzero;"/>10+ <path d="M215.774,343.618l-54.843,50.417c-3.849,3.848 -9.044,5.965 -14.24,5.965c-5.196,0 -10.391,-2.117 -14.24,-5.965c-8.082,-8.082 -8.082,-20.59 0,-28.48l19.628,-21.937l63.695,-0Z" style="fill:#fff;fill-rule:nonzero;"/>11+ <path d="M296.98,229.891l-68.313,-61.386l-65.812,0l74.471,81.206l-74.471,81.206l65.234,-0.192l68.891,-61.193c5.195,-5.581 7.889,-12.701 7.697,-20.013c0.192,-6.735 -2.502,-14.048 -7.697,-19.628Z" style="fill:#fff;fill-rule:nonzero;"/>12+ <path d="M215.196,156.382l-54.842,-50.417c-3.849,-3.848 -9.045,-5.965 -14.24,-5.965c-5.196,0 -10.392,2.117 -14.24,5.965c-8.082,8.082 -8.082,20.59 -0,28.48l19.82,21.937l63.502,0Z" style="fill:#fff;fill-rule:nonzero;"/>13+ </g>14+ </g>15+ <defs>16+ <linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(3.06162e-14,500,-500,3.06162e-14,267.59,0)"><stop offset="0" style="stop-color:#d8a9ca;stop-opacity:1"/><stop offset="1" style="stop-color:#53519b;stop-opacity:1"/></linearGradient>17+ </defs>18+</svg>added:docs/_static/click-name.svg+24 added
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>2+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">3+<svg width="100%" height="100%" viewBox="0 0 679 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">4+ <g>5+ <path id="Name" d="M410.6,166.725l19.35,0c0,13.6 -3.4,24.05 -10.2,31.35c-6.8,7.3 -16.4,10.95 -28.8,10.95c-27.3,0 -40.95,-16.05 -40.95,-48.15l0,-9c0,-25.3 7,-41.15 21,-47.55c5.5,-2.6 12.15,-3.9 19.95,-3.9c11.4,0 20.675,3.125 27.825,9.375c7.15,6.25 10.725,15.275 10.725,27.075l-19.5,0c-1.1,-5.9 -3.05,-10.35 -5.85,-13.35c-2.8,-3 -7.2,-4.5 -13.2,-4.5c-7,0 -12.2,2.2 -15.6,6.6c-2.4,3.1 -3.8,8.4 -4.2,15.9c-0.2,2.4 -0.3,5.65 -0.3,9.75l0,9.3c0,11.5 1.6,19.35 4.8,23.55c3.3,4.2 8.425,6.3 15.375,6.3c6.95,0 11.75,-1.925 14.4,-5.775c2.65,-3.85 4.375,-9.825 5.175,-17.925Z" style="fill-rule:nonzero;"/>6+ <path d="M464.9,208.125l-19.5,0.15l0,-112.95l19.5,0l0,112.8Z" style="fill-rule:nonzero;"/>7+ <path d="M495.8,89.775c4.7,0 7.75,0.725 9.15,2.175c1.4,1.45 2.1,4.5 2.1,9.15c0,4.65 -0.725,7.7 -2.175,9.15c-1.45,1.45 -4.5,2.175 -9.15,2.175c-4.65,0 -7.7,-0.75 -9.15,-2.25c-1.45,-1.5 -2.175,-4.55 -2.175,-9.15c0,-4.6 0.725,-7.625 2.175,-9.075c1.45,-1.45 4.525,-2.175 9.225,-2.175Zm9.6,118.35l-19.5,0l0,-82.5l19.5,0l0,82.5Z" style="fill-rule:nonzero;"/>8+ <path d="M570.95,176.775l17.7,-0.15c-0.1,0.8 -0.2,2.25 -0.3,4.35c-0.1,2.1 -0.175,3.525 -0.225,4.275c-0.05,0.75 -0.175,1.925 -0.375,3.525c-0.2,1.6 -0.425,2.775 -0.675,3.525c-0.25,0.75 -0.575,1.725 -0.975,2.925c-1.8,5.2 -6.7,9.3 -14.7,12.3c-5.1,1.8 -10.425,2.7 -15.975,2.7c-5.55,-0 -10.575,-0.9 -15.075,-2.7c-4.5,-1.8 -8.05,-4.1 -10.65,-6.9c-5.9,-6.2 -8.85,-17.825 -8.85,-34.875c0,-17.05 2.95,-28.675 8.85,-34.875c2.6,-2.8 6.15,-5.1 10.65,-6.9c4.5,-1.8 9.5,-2.7 15,-2.7c10.8,0 19,2.7 24.6,8.1c5.6,5.4 8.4,12.9 8.4,22.5l-17.7,0c0,-4.4 -1.1,-7.675 -3.3,-9.825c-2.2,-2.15 -6.275,-3.225 -12.225,-3.225c-5.95,-0 -9.9,1.85 -11.85,5.55c-1.95,3.7 -2.925,9.25 -2.925,16.65l0,7.8c0,11.9 2.3,19.2 6.9,21.9c2.1,1.3 4.85,1.95 8.25,1.95c3.4,-0 6.175,-0.325 8.325,-0.975c2.15,-0.65 3.7,-1.775 4.65,-3.375c0.95,-1.6 1.575,-3.175 1.875,-4.725c0.3,-1.55 0.5,-3.825 0.6,-6.825Z" style="fill-rule:nonzero;"/>9+ <path d="M678.65,208.125l-23.4,0l-22.5,-30.3l-8.55,12.15l0,18.15l-19.5,0l0,-112.8l19.5,0l0,71.25l27.3,-40.65l22.05,0l-28.05,38.4l33.15,43.8Z" style="fill-rule:nonzero;"/>10+ <g id="Logo">11+ <path id="Box" d="M300,30l0,240c0,16.557 -13.443,30 -30,30l-240,-0c-16.557,-0 -30,-13.443 -30,-30l0,-240c0,-16.557 13.443,-30 30,-30l240,0c16.557,0 30,13.443 30,30Z" style="fill:url(#_Linear1);"/>12+ <path id="Shadow" d="M300,259.747l0,10.253c0,16.557 -13.443,30 -30,30l-126.946,-0l-63.381,-63.382c2.287,2.184 5.314,3.382 8.342,3.382c3.117,0 6.234,-1.27 8.544,-3.579l32.905,-30.25l-24.131,-0l-7.62,-7.621l39.141,-0.115l41.334,-36.716c3.117,-3.348 4.734,-7.62 4.618,-12.008c0.116,-4.041 -1.501,-8.428 -4.618,-11.776l121.812,121.812Zm-170.882,-165.918l7.274,7.274l-38.102,0l-7.273,-7.274l38.101,0Zm92.367,127.005c5.773,-4.388 2.771,-13.624 -4.619,-13.624l-53.226,-0c-1.963,-0 -3.695,0.693 -5.08,1.963l-19.744,17.665c-5.08,4.618 -1.847,13.162 5.081,13.162l49.185,0c1.616,0 3.233,-0.577 4.503,-1.501l23.9,-17.665Z" style="fill:#493e5e;"/>13+ <g id="Icon">14+ <path d="M221.485,220.834l-23.9,17.665c-1.27,0.924 -2.887,1.501 -4.503,1.501l-49.185,0c-6.928,0 -10.161,-8.544 -5.081,-13.162l19.744,-17.665c1.385,-1.27 3.117,-1.963 5.08,-1.963l53.226,-0c7.39,-0 10.392,9.236 4.619,13.624Z" style="fill:#fff;fill-rule:nonzero;"/>15+ <path d="M129.464,206.171l-32.905,30.25c-2.31,2.309 -5.427,3.579 -8.544,3.579c-3.118,0 -6.235,-1.27 -8.544,-3.579c-4.85,-4.849 -4.85,-12.354 -0,-17.088l11.776,-13.162l38.217,-0Z" style="fill:#fff;fill-rule:nonzero;"/>16+ <path d="M178.188,137.935l-40.988,-36.832l-39.487,0l44.683,48.724l-44.683,48.723l39.141,-0.115l41.334,-36.716c3.117,-3.348 4.734,-7.62 4.618,-12.008c0.116,-4.041 -1.501,-8.428 -4.618,-11.776Z" style="fill:#fff;fill-rule:nonzero;"/>17+ <path d="M129.118,93.829l-32.906,-30.25c-2.309,-2.309 -5.426,-3.579 -8.544,-3.579c-3.117,0 -6.235,1.27 -8.544,3.579c-4.849,4.849 -4.849,12.354 0,17.088l11.893,13.162l38.101,0Z" style="fill:#fff;fill-rule:nonzero;"/>18+ </g>19+ </g>20+ </g>21+ <defs>22+ <linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.83697e-14,300,-300,1.83697e-14,160.554,0)"><stop offset="0" style="stop-color:#d8a9ca;stop-opacity:1"/><stop offset="1" style="stop-color:#53519b;stop-opacity:1"/></linearGradient>23+ </defs>24+</svg>modified:docs/advanced.rst+81 added-174 removed
1 unmodified line2 =================3 4 .. currentmodule:: click5 6-In addition to common functionality that is implemented in the library7-itself, there are countless patterns that can be implemented by extending8-Click. This page should give some insight into what can be accomplished.6+In addition to common functionality, Click offers some advanced features.7 8+.. contents::9+ :depth: 110+ :local:11 11-.. _aliases:12+Callbacks and Eager Options13+---------------------------14 13-Command Aliases14----------------15+Sometimes, you want a parameter to completely change the execution flow.16+For instance, this is the case when you want to have a ``--version``17+parameter that prints out the version and then exits the application.18 16-Many tools support aliases for commands. For example, you can configure17-``git`` to accept ``git ci`` as alias for ``git commit``. Other tools also18-support auto-discovery for aliases by automatically shortening them.19+Note: an actual implementation of a ``--version`` parameter that is20+reusable is available in Click as :func:`click.version_option`. The code21+here is merely an example of how to implement such a flag.22 20-It's possible to customize :class:`Group` to provide this functionality. As21-explained in :ref:`custom-groups`, a group provides two methods:22-:meth:`~Group.list_commands` and :meth:`~Group.get_command`. In this particular23-case, you only need to override the latter as you generally don't want to24-enumerate the aliases on the help page in order to avoid confusion.23+In such cases, you need two concepts: eager parameters and a callback. An24+eager parameter is a parameter that is handled before others, and a25+callback is what executes after the parameter is handled. The eagerness26+is necessary so that an earlier required parameter does not produce an27+error message. For instance, if ``--version`` was not eager and a28+parameter ``--foo`` was required and defined before, you would need to29+specify it for ``--version`` to work. For more information, see30+:ref:`callback-evaluation-order`.31 26-The following example implements a subclass of :class:`Group` that accepts a27-prefix for a command. If there was a command called ``push``, it would accept28-``pus`` as an alias (so long as it was unique):32+A callback is a function that is invoked with three parameters: the33+current :class:`Context`, the current :class:`Parameter`, and the value.34+The context provides some useful features such as quitting the35+application and gives access to other already processed parameters.36 37+Here's an example for a ``--version`` flag:38+39 .. click:example::40 32- class AliasedGroup(click.Group):33- def get_command(self, ctx, cmd_name):34- rv = super().get_command(ctx, cmd_name)41+ def print_version(ctx, param, value):42+ if not value or ctx.resilient_parsing:43+ return44+ click.echo('Version 1.0')45+ ctx.exit()46 36- if rv is not None:37- return rv47+ @click.command()48+ @click.option('--version', is_flag=True, callback=print_version,49+ expose_value=False, is_eager=True)50+ def hello():51+ click.echo('Hello World!')52 39- matches = [40- x for x in self.list_commands(ctx)41- if x.startswith(cmd_name)42- ]53+The `expose_value` parameter prevents the pretty pointless ``version``54+parameter from being passed to the callback. If that was not specified, a55+boolean would be passed to the `hello` script. The `resilient_parsing`56+flag is applied to the context if Click wants to parse the command line57+without any destructive behavior that would change the execution flow. In58+this case, because we would exit the program, we instead do nothing.59 44- if not matches:45- return None60+What it looks like:61 47- if len(matches) == 1:48- return click.Group.get_command(self, ctx, matches[0])62+.. click:run::63 50- ctx.fail(f"Too many matches: {', '.join(sorted(matches))}")64+ invoke(hello)65+ invoke(hello, args=['--version'])66 52- def resolve_command(self, ctx, args):53- # always return the full command name54- _, cmd, args = super().resolve_command(ctx, args)55- return cmd.name, cmd, args67+Callbacks for Validation68+------------------------69 57-It can be used like this:70+.. versionchanged:: 2.071 59-.. click:example::72+If you want to apply custom validation logic, you can do this in the73+parameter callbacks. These callbacks can both modify values as well as74+raise errors if the validation does not work. The callback runs after75+type conversion. It is called for all sources, including prompts.76 61- @click.group(cls=AliasedGroup)62- def cli():63- pass77+In Click 1.0, you can only raise the :exc:`UsageError` but starting with78+Click 2.0, you can also raise the :exc:`BadParameter` error, which has the79+added advantage that it will automatically format the error message to80+also contain the parameter name.81 65- @cli.command66- def push():67- pass82+.. click:example::83 69- @cli.command70- def pop():71- pass84+ def validate_rolls(ctx, param, value):85+ if isinstance(value, tuple):86+ return value87 73-See the `alias example`_ in Click's repository for another example.88+ try:89+ rolls, _, dice = value.partition("d")90+ return int(dice), int(rolls)91+ except ValueError:92+ raise click.BadParameter("format must be 'NdM'")93 75-.. _alias example: https://github.com/pallets/click/tree/main/examples/aliases94+ @click.command()95+ @click.option(96+ "--rolls", type=click.UNPROCESSED, callback=validate_rolls,97+ default="1d6", prompt=True,98+ )99+ def roll(rolls):100+ sides, times = rolls101+ click.echo(f"Rolling a {sides}-sided dice {times} time(s)")102 103+.. click:run::104 105+ invoke(roll, args=["--rolls=42"])106+ println()107+ invoke(roll, args=["--rolls=2d12"])108+ println()109+ invoke(roll, input=["42", "2d12"])110+111 Parameter Modifications112 -----------------------113 114 Parameters (options and arguments) are forwarded to the command callbacks115 unmodified lines230 231 invoke(cli, prog_name='cli', args=['dist'])232 233 201-.. _callback-evaluation-order:234 203-Callback Evaluation Order204--------------------------205-206-Click works a bit differently than some other command line parsers in that207-it attempts to reconcile the order of arguments as defined by the208-programmer with the order of arguments as defined by the user before209-invoking any callbacks.210-211-This is an important concept to understand when porting complex212-patterns to Click from optparse or other systems. A parameter213-callback invocation in optparse happens as part of the parsing step,214-whereas a callback invocation in Click happens after the parsing.215-216-The main difference is that in optparse, callbacks are invoked with the raw217-value as it happens, whereas a callback in Click is invoked after the218-value has been fully converted.219-220-Generally, the order of invocation is driven by the order in which the user221-provides the arguments to the script; if there is an option called ``--foo``222-and an option called ``--bar`` and the user calls it as ``--bar223---foo``, then the callback for ``bar`` will fire before the one for ``foo``.224-225-There are three exceptions to this rule which are important to know:226-227-Eagerness:228- An option can be set to be "eager". All eager parameters are229- evaluated before all non-eager parameters, but again in the order as230- they were provided on the command line by the user.231-232- This is important for parameters that execute and exit like ``--help``233- and ``--version``. Both are eager parameters, but whatever parameter234- comes first on the command line will win and exit the program.235-236-Repeated parameters:237- If an option or argument is split up on the command line into multiple238- places because it is repeated -- for instance, ``--exclude foo --include239- baz --exclude bar`` -- the callback will fire based on the position of240- the first option. In this case, the callback will fire for241- ``exclude`` and it will be passed both options (``foo`` and242- ``bar``), then the callback for ``include`` will fire with ``baz``243- only.244-245- Note that even if a parameter does not allow multiple versions, Click246- will still accept the position of the first, but it will ignore every247- value except the last. The reason for this is to allow composability248- through shell aliases that set defaults.249-250-Missing parameters:251- If a parameter is not defined on the command line, the callback will252- still fire. This is different from how it works in optparse where253- undefined values do not fire the callback. Missing parameters fire254- their callbacks at the very end which makes it possible for them to255- default to values from a parameter that came before.256-257-Most of the time you do not need to be concerned about any of this,258-but it is important to know how it works for some advanced cases.259-235 .. _forwarding-unknown-options:236 237 Forwarding Unknown Options238 --------------------------88 unmodified lines327 everything below a subcommand be forwarded to another application than to328 handle some arguments yourself.329 330 356-Global Context Access357----------------------358-359-.. versionadded:: 5.0360-361-Starting with Click 5.0 it is possible to access the current context from362-anywhere within the same thread through the use of the363-:func:`get_current_context` function which returns it. This is primarily364-useful for accessing the context bound object as well as some flags that365-are stored on it to customize the runtime behavior. For instance the366-:func:`echo` function does this to infer the default value of the `color`367-flag.368-369-Example usage::370-371- def get_current_command_name():372- return click.get_current_context().info_name373-374-It should be noted that this only works within the current thread. If you375-spawn additional threads then those threads will not have the ability to376-refer to the current context. If you want to give another thread the377-ability to refer to this context you need to use the context within the378-thread as a context manager::379-380- def spawn_thread(ctx, func):381- def wrapper():382- with ctx:383- func()384- t = threading.Thread(target=wrapper)385- t.start()386- return t387-388-Now the thread function can access the context like the main thread would389-do. However if you do use this for threading you need to be very careful390-as the vast majority of the context is not thread safe! You are only391-allowed to read from the context, but not to perform any modifications on392-it.393-394-395-Detecting the Source of a Parameter396------------------------------------397-398-In some situations it's helpful to understand whether or not an option399-or parameter came from the command line, the environment, the default400-value, or :attr:`Context.default_map`. The401-:meth:`Context.get_parameter_source` method can be used to find this402-out. It will return a member of the :class:`~click.core.ParameterSource`403-enum.404-405-.. click:example::406-407- @click.command()408- @click.argument('port', nargs=1, default=8080, envvar="PORT")409- @click.pass_context410- def cli(ctx, port):411- source = ctx.get_parameter_source("port")412- click.echo(f"Port came from {source.name}")413-414-.. click:run::415-416- invoke(cli, prog_name='cli', args=['8080'])417- println()418- invoke(cli, prog_name='cli', args=[], env={"PORT": "8080"})419- println()420- invoke(cli, prog_name='cli', args=[])421- println()422-423-331 Managing Resources332 ------------------333 334 It can be useful to open a resource in a group, to be made available to74 unmodified linesmodified:docs/api.rst+7 added
4 unmodified lines5 6 This part of the documentation lists the full API reference of all public7 classes and functions.8 9+.. contents::10+ :depth: 111+ :local:12+13 Decorators14 ----------15 16 .. autofunction:: command99 unmodified lines116 .. autoclass:: click.core.ParameterSource117 :members:118 :member-order: bysource119 120+.. _click-api-types:121 122 Types123 -----124 77 unmodified lines202 203 .. autofunction:: add_completion_class204 205 206+.. _testing:207+208 Testing209 -------210 211 .. currentmodule:: click.testing6 unmodified linesmodified:docs/arguments.rst+63 added-171 removed
3 unmodified lines4 =========5 6 .. currentmodule:: click7 8-Arguments work similarly to :ref:`options <options>` but are positional.9-They also only support a subset of the features of options due to their10-syntactical nature. Click will also not attempt to document arguments for11-you and wants you to :ref:`document them manually <documenting-arguments>`12-in order to avoid ugly help pages.8+Arguments are:9 10+* Are positional in nature.11+* Similar to a limited version of :ref:`options <options>` that can take an arbitrary number of inputs12+* :ref:`Documented manually <documenting-arguments>`.13+14+Useful and often used kwargs are:15+16+* ``default``: Passes a default.17+* ``nargs``: Sets the number of arguments. Set to -1 to take an arbitrary number.18+19 Basic Arguments20 ---------------21 17-The most basic option is a simple string argument of one value. If no18-type is provided, the type of the default value is used, and if no default19-value is provided, the type is assumed to be :data:`STRING`.22+A minimal :class:`click.Argument` solely takes one string argument: the name of the argument. This will assume the argument is required, has no default, and is of the type ``str``.23 24 Example:25 26 .. click:example::27 28 @click.command()29 @click.argument('filename')27- def touch(filename):30+ def touch(filename: str):31 """Print FILENAME."""32 click.echo(filename)33 31-And what it looks like:34+And from the command line:35 36 .. click:run::37 38 invoke(touch, args=['foo.txt'])39 37-Variadic Arguments38-------------------40 40-The second most common version is variadic arguments where a specific (or41-unlimited) number of arguments is accepted. This can be controlled with42-the ``nargs`` parameter. If it is set to ``-1``, then an unlimited number43-of arguments is accepted.41+An argument may be assigned a :ref:`parameter type <parameter-types>`. If no type is provided, the type of the default value is used. If no default value is provided, the type is assumed to be :data:`STRING`.42 45-The value is then passed as a tuple. Note that only one argument can be46-set to ``nargs=-1``, as it will eat up all arguments.43+.. admonition:: Note on Required Arguments44 48-Example:45+ It is possible to make an argument required by setting ``required=True``. It is not recommended since we think command line tools should gracefully degrade into becoming no ops. We think this because command line tools are often invoked with wildcard inputs and they should not error out if the wildcard is empty.46 47+Multiple Arguments48+-----------------------------------49+50+To set the number of argument use the ``nargs`` kwarg. It can be set to any positive integer and -1. Setting it to -1, makes the number of arguments arbitrary (which is called variadic) and can only be used once. The arguments are then packed as a tuple and passed to the function.51+52 .. click:example::53 54 @click.command()53- @click.argument('src', nargs=-1)54- @click.argument('dst', nargs=1)55- def copy(src, dst):55+ @click.argument('src', nargs=1)56+ @click.argument('dsts', nargs=-1)57+ def copy(src: str, dsts: tuple[str, ...]):58 """Move file SRC to DST."""57- for fn in src:58- click.echo(f"move {fn} to folder {dst}")59+ for destination in dsts:60+ click.echo(f"Copy {src} to folder {destination}")61 60-And what it looks like:62+And from the command line:63 64 .. click:run::65 64- invoke(copy, args=['foo.txt', 'bar.txt', 'my_folder'])66+ invoke(copy, args=['foo.txt', 'usr/david/foo.txt', 'usr/mitsuko/foo.txt'])67 66-Note that this is not how you would write this application. The reason67-for this is that in this particular example the arguments are defined as68-strings. Filenames, however, are not strings! They might be on certain69-operating systems, but not necessarily on all. For better ways to write70-this, see the next sections.68+.. admonition:: Note on Handling Files69 72-.. admonition:: Note on Non-Empty Variadic Arguments70+ This is not how you should handle files and files paths. This merely used as a simple example. See :ref:`handling-files` to learn more about how to handle files in parameters.71 74- If you come from ``argparse``, you might be missing support for setting75- ``nargs`` to ``+`` to indicate that at least one argument is required.72+Argument Escape Sequences73+---------------------------74 77- This is supported by setting ``required=True``. However, this should78- not be used if you can avoid it as we believe scripts should gracefully79- degrade into becoming noops if a variadic argument is empty. The80- reason for this is that very often, scripts are invoked with wildcard81- inputs from the command line and they should not error out if the82- wildcard is empty.75+If you want to process arguments that look like options, like a file named ``-foo.txt`` or ``--foo.txt`` , you must pass the ``--`` separator first. After you pass the ``--``, you may only pass arguments. This is a common feature for POSIX command line tools.76 84-.. _file-args:77+Example usage:78 86-File Arguments87---------------88-89-Since all the examples have already worked with filenames, it makes sense90-to explain how to deal with files properly. Command line tools are more91-fun if they work with files the Unix way, which is to accept ``-`` as a92-special file that refers to stdin/stdout.93-94-Click supports this through the :class:`click.File` type which95-intelligently handles files for you. It also deals with Unicode and bytes96-correctly for all versions of Python so your script stays very portable.97-98-Example:99-79 .. click:example::80 81 @click.command()103- @click.argument('input', type=click.File('rb'))104- @click.argument('output', type=click.File('wb'))105- def inout(input, output):106- """Copy contents of INPUT to OUTPUT."""107- while True:108- chunk = input.read(1024)109- if not chunk:110- break111- output.write(chunk)82+ @click.argument('files', nargs=-1, type=click.Path())83+ def touch(files):84+ """Print all FILES file names."""85+ for filename in files:86+ click.echo(filename)87 113-And what it does:88+And from the command line:89 90 .. click:run::91 117- with isolated_filesystem():118- invoke(inout, args=['-', 'hello.txt'], input=['hello'],119- terminate_input=True)120- invoke(inout, args=['hello.txt', '-'])92+ invoke(touch, ['--', '-foo.txt', 'bar.txt'])93 122-File Path Arguments123--------------------94+If you don't like the ``--`` marker, you can set ignore_unknown_options to True to avoid checking unknown options:95 125-In the previous example, the files were opened immediately. But what if126-we just want the filename? The naïve way is to use the default string127-argument type. The :class:`Path` type has several checks available which raise nice128-errors if they fail, such as existence. Filenames in these error messages are formatted129-with :func:`format_filename`, so any undecodable bytes will be printed nicely.130-131-Example:132-96 .. click:example::97 135- @click.command()136- @click.argument('filename', type=click.Path(exists=True))137- def touch(filename):138- """Print FILENAME if the file exists."""139- click.echo(click.format_filename(filename))98+ @click.command(context_settings={"ignore_unknown_options": True})99+ @click.argument('files', nargs=-1, type=click.Path())100+ def touch(files):101+ """Print all FILES file names."""102+ for filename in files:103+ click.echo(filename)104 141-And what it does:105+And from the command line:106 107 .. click:run::108 145- with isolated_filesystem():146- with open('hello.txt', 'w') as f:147- f.write('Hello World!\n')148- invoke(touch, args=['hello.txt'])109+ invoke(touch, ['-foo.txt', 'bar.txt'])149- println()150- invoke(touch, args=['missing.txt'])110 111 153-File Opening Safety154--------------------155-156-The :class:`FileType` type has one problem it needs to deal with, and that157-is to decide when to open a file. The default behavior is to be158-"intelligent" about it. What this means is that it will open stdin/stdout159-and files opened for reading immediately. This will give the user direct160-feedback when a file cannot be opened, but it will only open files161-for writing the first time an IO operation is performed by automatically162-wrapping the file in a special wrapper.163-164-This behavior can be forced by passing ``lazy=True`` or ``lazy=False`` to165-the constructor. If the file is opened lazily, it will fail its first IO166-operation by raising an :exc:`FileError`.167-168-Since files opened for writing will typically immediately empty the file,169-the lazy mode should only be disabled if the developer is absolutely sure170-that this is intended behavior.171-172-Forcing lazy mode is also very useful to avoid resource handling173-confusion. If a file is opened in lazy mode, it will receive a174-``close_intelligently`` method that can help figure out if the file175-needs closing or not. This is not needed for parameters, but is176-necessary for manually prompting with the :func:`prompt` function as you177-do not know if a stream like stdout was opened (which was already open178-before) or a real file that needs closing.179-180-Starting with Click 2.0, it is also possible to open files in atomic mode by181-passing ``atomic=True``. In atomic mode, all writes go into a separate182-file in the same folder, and upon completion, the file will be moved over to183-the original location. This is useful if a file regularly read by other184-users is modified.185-186-112 .. _environment-variables:113 114 Environment Variables115 ---------------------116 192-Like options, arguments can also grab values from an environment variable.193-Unlike options, however, this is only supported for explicitly named194-environment variables.117+Arguments can use environment variables. To do so, pass the name(s) of the environment variable(s) via `envvar` in ``click.argument``.118 196-Example usage:119+Checking one environment variable:120 121 .. click:example::122 123 @click.command()6 unmodified lines130 131 .. click:run::132 133 with isolated_filesystem():134+ # Writing the file in the filesystem.135 with open('hello.txt', 'w') as f:136 f.write('Hello World!')137 invoke(echo, env={'SRC': 'hello.txt'})138 215-In that case, it can also be a list of different environment variables216-where the first one is picked.139 218-Generally, this feature is not recommended because it can cause the user219-a lot of confusion.140+Checking multiple environment variables:141 221-Option-Like Arguments222----------------------223-224-Sometimes, you want to process arguments that look like options. For225-instance, imagine you have a file named ``-foo.txt``. If you pass this as226-an argument in this manner, Click will treat it as an option.227-228-To solve this, Click does what any POSIX style command line script does,229-and that is to accept the string ``--`` as a separator for options and230-arguments. After the ``--`` marker, all further parameters are accepted as231-arguments.232-233-Example usage:234-142 .. click:example::143 144 @click.command()238- @click.argument('files', nargs=-1, type=click.Path())239- def touch(files):240- """Print all FILES file names."""241- for filename in files:242- click.echo(filename)145+ @click.argument('src', envvar=['SRC', 'SRC_2'], type=click.File('r'))146+ def echo(src):147+ """Print value of SRC environment variable."""148+ click.echo(src.read())149 150 And from the command line:151 152 .. click:run::153 248- invoke(touch, ['--', '-foo.txt', 'bar.txt'])249-250-If you don't like the ``--`` marker, you can set ignore_unknown_options to251-True to avoid checking unknown options:252-253-.. click:example::254-255- @click.command(context_settings={"ignore_unknown_options": True})256- @click.argument('files', nargs=-1, type=click.Path())257- def touch(files):258- """Print all FILES file names."""259- for filename in files:260- click.echo(filename)261-262-And from the command line:263-264-.. click:run::265-266- invoke(touch, ['-foo.txt', 'bar.txt'])154+ with isolated_filesystem():155+ # Writing the file in the filesystem.156+ with open('hello.txt', 'w') as f:157+ f.write('Hello World from second variable!')158+ invoke(echo, env={'SRC_2': 'hello.txt'})added:docs/click-concepts.rst+67 added
1+Click Concepts2+================3+4+This section covers concepts about Click's design.5+6+.. contents::7+ :depth: 18+ :local:9+10+.. _callback-evaluation-order:11+12+Callback Evaluation Order13+-------------------------14+15+Click works a bit differently than some other command line parsers in that16+it attempts to reconcile the order of arguments as defined by the17+programmer with the order of arguments as defined by the user before18+invoking any callbacks.19+20+This is an important concept to understand when porting complex21+patterns to Click from optparse or other systems. A parameter22+callback invocation in optparse happens as part of the parsing step,23+whereas a callback invocation in Click happens after the parsing.24+25+The main difference is that in optparse, callbacks are invoked with the raw26+value as it happens, whereas a callback in Click is invoked after the27+value has been fully converted.28+29+Generally, the order of invocation is driven by the order in which the user30+provides the arguments to the script; if there is an option called ``--foo``31+and an option called ``--bar`` and the user calls it as ``--bar32+--foo``, then the callback for ``bar`` will fire before the one for ``foo``.33+34+There are three exceptions to this rule which are important to know:35+36+Eagerness:37+ An option can be set to be "eager". All eager parameters are38+ evaluated before all non-eager parameters, but again in the order as39+ they were provided on the command line by the user.40+41+ This is important for parameters that execute and exit like ``--help``42+ and ``--version``. Both are eager parameters, but whatever parameter43+ comes first on the command line will win and exit the program.44+45+Repeated parameters:46+ If an option or argument is split up on the command line into multiple47+ places because it is repeated -- for instance, ``--exclude foo --include48+ baz --exclude bar`` -- the callback will fire based on the position of49+ the first option. In this case, the callback will fire for50+ ``exclude`` and it will be passed both options (``foo`` and51+ ``bar``), then the callback for ``include`` will fire with ``baz``52+ only.53+54+ Note that even if a parameter does not allow multiple versions, Click55+ will still accept the position of the first, but it will ignore every56+ value except the last. The reason for this is to allow composability57+ through shell aliases that set defaults.58+59+Missing parameters:60+ If a parameter is not defined on the command line, the callback will61+ still fire. This is different from how it works in optparse where62+ undefined values do not fire the callback. Missing parameters fire63+ their callbacks at the very end which makes it possible for them to64+ default to values from a parameter that came before.65+66+Most of the time you do not need to be concerned about any of this,67+but it is important to know how it works for some advanced cases.added:docs/commands-and-groups.rst+342 added
1+Basic Commands, Groups, Context2+================================3+4+.. currentmodule:: click5+6+Commands and Groups are the building blocks for Click applications. :class:`Command` wraps a function to make it into a cli command. :class:`Group` wraps Commands and Groups to make them into applications. :class:`Context` is how groups and commands communicate.7+8+.. contents::9+ :depth: 210+ :local:11+12+Commands13+--------------------14+15+Basic Command Example16+^^^^^^^^^^^^^^^^^^^^^^^17+A simple command decorator takes no arguments.18+19+.. click:example::20+ @click.command()21+ @click.option('--count', default=1)22+ def hello(count):23+ for x in range(count):24+ click.echo("Hello!")25+26+.. click:run::27+ invoke(hello, args=['--count', '2',])28+29+Renaming Commands30+^^^^^^^^^^^^^^^^^^^31+By default the command is the function name with underscores replaced by dashes. To change this pass the desired name into the first positional argument.32+33+.. click:example::34+ @click.command('say-hello')35+ @click.option('--count', default=1)36+ def hello(count):37+ for x in range(count):38+ click.echo("Hello!")39+40+.. click:run::41+ invoke(hello, args=['--count', '2',])42+43+Deprecating Commands44+^^^^^^^^^^^^^^^^^^^^^^45+To mark a command as deprecated pass in ``deprecated=True``46+47+.. click:example::48+ @click.command('say-hello', deprecated=True)49+ @click.option('--count', default=1)50+ def hello(count):51+ for x in range(count):52+ click.echo("Hello!")53+54+.. click:run::55+ invoke(hello, args=['--count', '2',])56+57+Groups58+------------59+60+Basic Group Example61+^^^^^^^^^^^^^^^^^^^^^62+A group wraps one or more commands. After being wrapped, the commands are nested under that group. You can see that on the help pages and in the execution. By default, invoking the group with no command shows the help page.63+64+.. click:example::65+ @click.group()66+ def greeting():67+ click.echo('Starting greeting ...')68+69+ @greeting.command('say-hello')70+ @click.option('--count', default=1)71+ def hello(count):72+ for x in range(count):73+ click.echo("Hello!")74+75+At the top level:76+77+.. click:run::78+79+ invoke(greeting)80+81+At the command level:82+83+.. click:run::84+85+ invoke(greeting, args=['say-hello'])86+ invoke(greeting, args=['say-hello', '--help'])87+88+As you can see from the above example, the function wrapped by the group decorator executes unless it is interrupted (for example by calling the help).89+90+Renaming Groups91+^^^^^^^^^^^^^^^^^92+To have a name other than the decorated function name as the group name, pass it in as the first positional argument.93+94+.. click:example::95+ @click.group('greet-someone')96+ def greeting():97+ click.echo('Starting greeting ...')98+99+ @greeting.command('say-hello')100+ @click.option('--count', default=1)101+ def hello(count):102+ for x in range(count):103+ click.echo("Hello!")104+105+.. click:run::106+107+ invoke(greeting, args=['say-hello'])108+109+Group Invocation Without Command110+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^111+112+By default, if a group is passed without a command, the group is not invoked and a command automatically passes ``--help``. To change this, pass ``invoke_without_command=True`` to the group. The context object also includes information about whether or not the group invocation would go to a command nested under it.113+114+.. click:example::115+116+ @click.group(invoke_without_command=True)117+ @click.pass_context118+ def cli(ctx):119+ if ctx.invoked_subcommand is None:120+ click.echo('I was invoked without subcommand')121+ else:122+ click.echo(f"I am about to invoke {ctx.invoked_subcommand}")123+124+ @cli.command()125+ def sync():126+ click.echo('The subcommand')127+128+.. click:run::129+130+ invoke(cli, prog_name='tool', args=[])131+ invoke(cli, prog_name='tool', args=['sync'])132+133+134+135+Group Separation136+^^^^^^^^^^^^^^^^^^^137+Command :ref:`parameters` attached to a command belong only to that command.138+139+.. click:example::140+ @click.group()141+ def greeting():142+ pass143+144+ @greeting.command()145+ @click.option('--count', default=1)146+ def hello(count):147+ for x in range(count):148+ click.echo("Hello!")149+150+ @greeting.command()151+ @click.option('--count', default=1)152+ def goodbye(count):153+ for x in range(count):154+ click.echo("Goodbye!")155+156+.. click:run::157+158+ invoke(greeting, args=['hello', '--count', '2'])159+ invoke(greeting, args=['goodbye', '--count', '2'])160+ invoke(greeting)161+162+Additionally parameters for a given group belong only to that group and not to the commands under it. What this means is that options and arguments for a specific command have to be specified *after* the command name itself, but *before* any other command names.163+164+This behavior is observable with the ``--help`` option. Suppose we have a group called ``tool`` containing a command called ``sub``.165+166+- ``tool --help`` returns the help for the whole program (listing subcommands).167+- ``tool sub --help`` returns the help for the ``sub`` subcommand.168+- But ``tool --help sub`` treats ``--help`` as an argument for the main program. Click then invokes the callback for ``--help``, which prints the help and aborts the program before click can process the subcommand.169+170+Arbitrary Nesting171+^^^^^^^^^^^^^^^^^^^172+:class:`Commands <Command>` are attached to a :class:`Group`. Multiple groups can be attached to another group. Groups containing multiple groups can be attached to a group, and so on. To invoke a command nested under multiple groups, all the groups under which it is nested must be invoked.173+174+.. click:example::175+176+ @click.group()177+ def cli():178+ pass179+180+ # Not @click so that the group is registered now.181+ @cli.group()182+ def session():183+ click.echo('Starting session')184+185+ @session.command()186+ def initdb():187+ click.echo('Initialized the database')188+189+ @session.command()190+ def dropdb():191+ click.echo('Dropped the database')192+193+.. click:run::194+195+ invoke(cli, args=['session', 'initdb'])196+197+Lazily Attaching Commands198+^^^^^^^^^^^^^^^^^^^^^^^^^^^199+Most examples so far have attached the commands to a group immediately, but commands may be registered later. This could be used to split commands into multiple Python modules. Regardless of how they are attached, the commands are invoked identically.200+201+.. click:example::202+203+ @click.group()204+ def cli():205+ pass206+207+ @cli.command()208+ def initdb():209+ click.echo('Initialized the database')210+211+ @click.command()212+ def dropdb():213+ click.echo('Dropped the database')214+215+ cli.add_command(dropdb)216+217+.. click:run::218+219+ invoke(cli, args=['initdb'])220+ invoke(cli, args=['dropdb'])221+222+Context Object223+-------------------224+The :class:`Context` object is how commands and groups communicate.225+226+Auto Envvar Prefix227+^^^^^^^^^^^^^^^^^^^^228+Automatically built environment variables are supported for options only. To enable this feature, the ``auto_envvar_prefix`` parameter needs to be passed to the script that is invoked. Each command and parameter is then added as an uppercase underscore-separated variable. If you have a subcommand229+called ``run`` taking an option called ``reload`` and the prefix is ``WEB``, then the variable is ``WEB_RUN_RELOAD``.230+231+Example usage:232+233+.. click:example::234+235+ @click.command()236+ @click.option('--username')237+ def greet(username):238+ click.echo(f'Hello {username}!')239+240+ if __name__ == '__main__':241+ greet(auto_envvar_prefix='GREETER')242+243+And from the command line:244+245+.. click:run::246+247+ invoke(greet, env={'GREETER_USERNAME': 'john'},248+ auto_envvar_prefix='GREETER')249+250+When using ``auto_envvar_prefix`` with command groups, the command name251+needs to be included in the environment variable, between the prefix and252+the parameter name, *i.e.* ``PREFIX_COMMAND_VARIABLE``. If you have a253+subcommand called ``run-server`` taking an option called ``host`` and254+the prefix is ``WEB``, then the variable is ``WEB_RUN_SERVER_HOST``.255+256+.. click:example::257+258+ @click.group()259+ @click.option('--debug/--no-debug')260+ def cli(debug):261+ click.echo(f"Debug mode is {'on' if debug else 'off'}")262+263+ @cli.command()264+ @click.option('--username')265+ def greet(username):266+ click.echo(f"Hello {username}!")267+268+ if __name__ == '__main__':269+ cli(auto_envvar_prefix='GREETER')270+271+.. click:run::272+273+ invoke(cli, args=['greet',],274+ env={'GREETER_GREET_USERNAME': 'John', 'GREETER_DEBUG': 'false'},275+ auto_envvar_prefix='GREETER')276+277+Global Context Access278+^^^^^^^^^^^^^^^^^^^^^^279+280+.. versionadded:: 5.0281+282+Starting with Click 5.0 it is possible to access the current context from283+anywhere within the same thread through the use of the284+:func:`get_current_context` function which returns it. This is primarily285+useful for accessing the context bound object as well as some flags that286+are stored on it to customize the runtime behavior. For instance the287+:func:`echo` function does this to infer the default value of the `color`288+flag.289+290+Example usage::291+292+ def get_current_command_name():293+ return click.get_current_context().info_name294+295+It should be noted that this only works within the current thread. If you296+spawn additional threads then those threads will not have the ability to297+refer to the current context. If you want to give another thread the298+ability to refer to this context you need to use the context within the299+thread as a context manager::300+301+ def spawn_thread(ctx, func):302+ def wrapper():303+ with ctx:304+ func()305+ t = threading.Thread(target=wrapper)306+ t.start()307+ return t308+309+Now the thread function can access the context like the main thread would310+do. However if you do use this for threading you need to be very careful311+as the vast majority of the context is not thread safe! You are only312+allowed to read from the context, but not to perform any modifications on313+it.314+315+316+Detecting the Source of a Parameter317+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^318+319+In some situations it's helpful to understand whether or not an option320+or parameter came from the command line, the environment, the default321+value, or :attr:`Context.default_map`. The322+:meth:`Context.get_parameter_source` method can be used to find this323+out. It will return a member of the :class:`~click.core.ParameterSource`324+enum.325+326+.. click:example::327+328+ @click.command()329+ @click.argument('port', nargs=1, default=8080, envvar="PORT")330+ @click.pass_context331+ def cli(ctx, port):332+ source = ctx.get_parameter_source("port")333+ click.echo(f"Port came from {source.name}")334+335+.. click:run::336+337+ invoke(cli, prog_name='cli', args=['8080'])338+ println()339+ invoke(cli, prog_name='cli', args=[], env={"PORT": "8080"})340+ println()341+ invoke(cli, prog_name='cli', args=[])342+ println()modified:docs/commands.rst+6 added-117 removed
1-Commands and Groups2-===================1+Advanced Groups and Context2+=============================3 4 .. currentmodule:: click5 6-The structure of a Click application is defined with :class:`Command`, which7-defines an individual named command, and :class:`Group`, which defines a nested8-collection of commands (or more groups) under a name.6+In addition to the capabilities covered in the previous section, Groups have more advanced capabilities that leverage the Context.7 8+.. contents::9+ :depth: 110+ :local:11 12 Callback Invocation13 -------------------14 24 unmodified lines39 invoke(cli, prog_name='tool.py')40 println()41 invoke(cli, prog_name='tool.py', args=['--debug', 'sync'])42 42-Passing Parameters43-------------------44-45-Click strictly separates parameters between commands and subcommands. What this46-means is that options and arguments for a specific command have to be specified47-*after* the command name itself, but *before* any other command names.48-49-This behavior is already observable with the predefined ``--help`` option.50-Suppose we have a program called ``tool.py``, containing a subcommand called51-``sub``.52-53-- ``tool.py --help`` will return the help for the whole program (listing54- subcommands).55-56-- ``tool.py sub --help`` will return the help for the ``sub`` subcommand.57-58-- But ``tool.py --help sub`` will treat ``--help`` as an argument for the main59- program. Click then invokes the callback for ``--help``, which prints the60- help and aborts the program before click can process the subcommand.61-43 Nested Handling and Contexts44 ----------------------------45 46 As you can see from the earlier example, the basic command group accepts a77 unmodified lines124 125 This is a very powerful concept that can be used to build very complex126 nested applications; see :ref:`complex-guide` for more information.127 147-148-Group Invocation Without Command149---------------------------------150-151-By default, a group is not invoked unless a subcommand is passed. In fact, not152-providing a command automatically passes ``--help`` by default. This behavior153-can be changed by passing ``invoke_without_command=True`` to a group. In that154-case, the callback is always invoked instead of showing the help page. The155-context object also includes information about whether or not the invocation156-would go to a subcommand.157-158-.. click:example::159-160- @click.group(invoke_without_command=True)161- @click.pass_context162- def cli(ctx):163- if ctx.invoked_subcommand is None:164- click.echo('I was invoked without subcommand')165- else:166- click.echo(f"I am about to invoke {ctx.invoked_subcommand}")167-168- @cli.command()169- def sync():170- click.echo('The subcommand')171-172-.. click:run::173-174- invoke(cli, prog_name='tool', args=[])175- invoke(cli, prog_name='tool', args=['sync'])176-177-178-.. _custom-groups:179-180-Custom Groups181--------------182-183-You can customize the behavior of a group beyond the arguments it accepts by184-subclassing :class:`click.Group`.185-186-The most common methods to override are :meth:`~click.Group.get_command` and187-:meth:`~click.Group.list_commands`.188-189-The following example implements a basic plugin system that loads commands from190-Python files in a folder. The command is lazily loaded to avoid slow startup.191-192-.. code-block:: python193-194- import importlib.util195- import os196- import click197-198- class PluginGroup(click.Group):199- def __init__(self, name=None, plugin_folder="commands", **kwargs):200- super().__init__(name=name, **kwargs)201- self.plugin_folder = plugin_folder202-203- def list_commands(self, ctx):204- rv = []205-206- for filename in os.listdir(self.plugin_folder):207- if filename.endswith(".py"):208- rv.append(filename[:-3])209-210- rv.sort()211- return rv212-213- def get_command(self, ctx, name):214- path = os.path.join(self.plugin_folder, f"{name}.py")215- spec = importlib.util.spec_from_file_location(name, path)216- module = importlib.util.module_from_spec(spec)217- spec.loader.exec_module(module)218- return module.cli219-220- cli = PluginGroup(221- plugin_folder=os.path.join(os.path.dirname(__file__), "commands")222- )223-224- if __name__ == "__main__":225- cli()226-227-Custom classes can also be used with decorators:228-229-.. code-block:: python230-231- @click.group(232- cls=PluginGroup,233- plugin_folder=os.path.join(os.path.dirname(__file__), "commands")234- )235- def cli():236- pass237-238-128 .. _command-chaining:129 130 Command Chaining131 ----------------297 unmodified linesmodified:docs/complex.rst+4 added
14 unmodified lines15 In a theoretical world of two separate Click command line utilities, they16 could solve this problem by nesting one inside the other. For instance, the17 web framework could also load the commands for the message queue framework.18 19+.. contents::20+ :depth: 121+ :local:22+23 Basic Concepts24 --------------25 26 To understand how this works, you need to understand two concepts: contexts367 unmodified linesmodified:docs/conf.py+4 added-2 removed
8 unmodified lines9 release, version = get_version("Click")10 11 # General --------------------------------------------------------------12 13+master_doc = "index"14 default_role = "code"15 extensions = [16 "sphinx.ext.autodoc",17 "sphinx.ext.extlinks",18 "sphinx.ext.intersphinx",19 "sphinx_tabs.tabs",20 "sphinxcontrib.log_cabinet",21 "pallets_sphinx_themes",22+ "myst_parser",23 ]24 autodoc_member_order = "bysource"25 autodoc_typehints = "description"26 autodoc_preserve_defaults = True23 unmodified lines50 "**": ["localtoc.html", "relations.html", "searchbox.html", "ethicalads.html"],51 }52 singlehtml_sidebars = {"index": ["project.html", "localtoc.html", "ethicalads.html"]}53 html_static_path = ["_static"]52-html_favicon = "_static/click-icon.png"53-html_logo = "_static/click-logo-sidebar.png"54+html_favicon = "_static/click-icon.svg"55+html_logo = "_static/click-logo.svg"56 html_title = f"Click Documentation ({version})"57 html_show_sourcelink = Falseadded:docs/contrib.md+45 added
1+(contrib)=2+3+# click-contrib4+5+As the user number of Click grows, more and more major feature requests are6+made. To users, it may seem reasonable to include those features with Click;7+however, many of them are experimental or aren't practical to support8+generically. Maintainers have to choose what is reasonable to maintain in Click9+core.10+11+The [click-contrib](https://github.com/click-contrib/) GitHub organization exists as a place to collect third-party12+packages that extend Click's features. It is also meant to ease the effort of13+searching for such extensions.14+15+Please note that the quality and stability of those packages may be different16+from Click itself. While published under a common organization, they are still17+separate from Click and the Pallets maintainers.18+19+## Third-party projects20+21+Other projects that extend Click's features are available outside the22+[click-contrib](https://github.com/click-contrib/) organization.23+24+Some of the most popular and actively maintained are listed below:25+26+| Project | Description | Popularity | Activity |27+|---------------------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|28+| [Typer](https://github.com/fastapi/typer) | Use Python type hints to create CLI apps. |  |  |29+| [rich-click](https://github.com/ewels/rich-click) | Format help output with Rich. |  |  |30+| [click-app](https://github.com/simonw/click-app) | Cookiecutter template for creating new CLIs. |  |  |31+| [Cloup](https://github.com/janluke/cloup) | Adds option groups, constraints, command aliases, help themes, suggestions and more. |  |  |32+| [Click Extra](https://github.com/kdeldycke/click-extra) | Cloup + colorful `--help`, `--config`, `--show-params`, `--verbosity` options, etc. |  |  |33+34+```{note}35+To make it into the list above, a project:36+37+- must be actively maintained (at least one commit in the last year)38+- must have a reasonable number of stars (at least 20)39+40+If you have a project that meets these criteria, please open a pull request41+to add it to the list.42+43+If a project is no longer maintained or does not meet the criteria above,44+please open a pull request to remove it from the list.45+```deleted:docs/contrib.rst-21 removed
1-.. _contrib:2-3-=============4-click-contrib5-=============6-7-As the number of users of Click grows, more and more major feature requests are8-made. To users it may seem reasonable to include those features with Click;9-however, many of them are experimental or aren't practical to support10-generically. Maintainers have to choose what is reasonable to maintain in Click11-core.12-13-The click-contrib_ GitHub organization exists as a place to collect third-party14-packages that extend Click's features. It is also meant to ease the effort of15-searching for such extensions.16-17-Please note that the quality and stability of those packages may be different18-than Click itself. While published under a common organization, they are still19-separate from Click and the Pallets maintainers.20-21-.. _click-contrib: https://github.com/click-contrib/added:docs/documentation.md+277 added
1+# Help Pages2+3+```{currentmodule} click4+```5+6+Click makes it very easy to document your command line tools. For most things Click automatically generates help pages for you. By design the text is customizable, but the layout is not.7+8+## Help Texts9+10+Commands and options accept help arguments. For commands, the docstring of the function is automatically used if provided.11+12+Simple example:13+14+```{eval-rst}15+.. click:example::16+17+ @click.command()18+ @click.argument('name')19+ @click.option('--count', default=1, help='number of greetings')20+ def hello(name: str, count: int):21+ """This script prints hello and a name one or more times."""22+ for x in range(count):23+ if name:24+ click.echo(f"Hello {name}!")25+ else:26+ click.echo("Hello!")27+28+.. click:run::29+ invoke(hello, args=['--help'])30+```31+32+## Command Short Help33+34+For subcommands, a short help snippet is generated. By default, it's the first sentence of the docstring. If too long, then it will ellipsize what cannot be fit on a single line with `...`. The short help snippet can also be overridden with `short_help`:35+36+```{eval-rst}37+.. click:example::38+39+ import click40+41+ @click.group()42+ def cli():43+ """A simple command line tool."""44+45+ @cli.command('init', short_help='init the repo')46+ def init():47+ """Initializes the repository."""48+49+.. click:run::50+ invoke(cli, args=['--help'])51+```52+53+## Command Epilog Help54+55+The help epilog is printed at the end of the help and is useful for showing example command usages or referencing additional help resources.56+57+```{eval-rst}58+.. click:example::59+60+ import click61+62+ @click.command(63+ epilog='See https://example.com for more details',64+ )65+ def init():66+ """Initializes the repository."""67+68+.. click:run::69+ invoke(init, args=['--help'])70+```71+72+(documenting-arguments)=73+74+## Documenting Arguments75+76+{class}`click.argument` does not take a `help` parameter. This follows the Unix Command Line Tools convention of using arguments only for necessary things and documenting them in the command help text77+by name. This should then be done via the docstring.78+79+A brief example:80+81+```{eval-rst}82+.. click:example::83+84+ @click.command()85+ @click.argument('filename')86+ def touch(filename):87+ """Print FILENAME."""88+ click.echo(filename)89+90+.. click:run::91+ invoke(touch, args=['--help'])92+```93+94+Or more explicitly:95+96+```{eval-rst}97+.. click:example::98+99+ @click.command()100+ @click.argument('filename')101+ def touch(filename):102+ """Print FILENAME.103+104+ FILENAME is the name of the file to check.105+ """106+ click.echo(filename)107+108+.. click:run::109+ invoke(touch, args=['--help'])110+```111+112+## Showing Defaults113+114+To control the appearance of defaults pass `show_default`.115+116+```{eval-rst}117+.. click:example::118+119+ @click.command()120+ @click.option('--n', default=1, show_default=False, help='number of dots')121+ def dots(n):122+ click.echo('.' * n)123+124+.. click:run::125+ invoke(dots, args=['--help'])126+```127+128+For single option boolean flags, the default remains hidden if the default value is False, even if show default is set to true.129+130+```{eval-rst}131+.. click:example::132+133+ @click.command()134+ @click.option('--n', default=1, show_default=True)135+ @click.option("--gr", is_flag=True, show_default=True, default=False, help="Greet the world.")136+ @click.option("--br", is_flag=True, show_default=True, default=True, help="Add a thematic break")137+ def dots(n, gr, br):138+ if gr:139+ click.echo('Hello world!')140+ click.echo('.' * n)141+ if br:142+ click.echo('-' * n)143+144+.. click:run::145+ invoke(dots, args=['--help'])146+```147+148+## Click's Wrapping Behavior149+150+Click's default wrapping ignores single new lines and rewraps the text based on the width of the terminal, to a maximum of 80 characters. In the example notice how the second grouping of three lines is rewrapped into a single paragraph.151+152+```{eval-rst}153+.. click:example::154+155+ import click156+157+ @click.command()158+ def cli():159+ """160+ This is a very long paragraph and as you161+ can see wrapped very early in the source text162+ but will be rewrapped to the terminal width in163+ the final output.164+165+ This is166+ a paragraph167+ that is compacted.168+ """169+170+.. click:run::171+ invoke(cli, args=['--help'])172+```173+174+## Escaping Click's Wrapping175+176+Sometimes Click's wrapping can be a problem, such as when showing code examples where new lines are significant. This behavior can be escaped on a per-paragraph basis by adding a line with only `\b` . The `\b` is removed from the rendered help text.177+178+Example:179+180+```{eval-rst}181+.. click:example::182+183+ import click184+185+ @click.command()186+ def cli():187+ """First paragraph.188+189+ \b190+ This is191+ a paragraph192+ without rewrapping.193+194+ And this is a paragraph195+ that will be rewrapped again.196+ """197+198+.. click:run::199+ invoke(cli, args=['--help'])200+```201+202+To change the rendering maximum width, pass `max_content_width` when calling the command.203+204+```bash205+cli(max_content_width=120)206+```207+208+## Truncating Help Texts209+210+Click gets {class}`Command` help text from the docstring. If you do not want to include part of the docstring, add the `\f` escape marker to have Click truncate the help text after the marker.211+212+Example:213+214+```{eval-rst}215+.. click:example::216+217+ import click218+219+ @click.command()220+ def cli():221+ """First paragraph.222+ \f223+224+ Words to not be included.225+ """226+227+.. click:run::228+ invoke(cli, args=['--help'])229+```230+231+(doc-meta-variables)=232+233+## Placeholder / Meta Variable234+235+The default placeholder variable ([meta variable](https://en.wikipedia.org/wiki/Metasyntactic_variable#IETF_Requests_for_Comments)) in the help pages is the parameter name in uppercase with underscores. This can be changed for Commands and Parameters with the `options_metavar` and `metavar` kwargs.236+237+```{eval-rst}238+.. click:example::239+240+ # This controls entry on the usage line.241+ @click.command(options_metavar='[[options]]')242+ @click.option('--count', default=1, help='number of greetings',243+ metavar='<int>')244+ @click.argument('name', metavar='<name>')245+ def hello(name: str, count: int) -> None:246+ """This script prints 'hello <name>' a total of <count> times."""247+ for x in range(count):248+ click.echo(f"Hello {name}!")249+250+# Example usage:251+252+.. click:run::253+ invoke(hello, args=['--help'])254+255+```256+257+## Help Parameter Customization258+259+Help parameters are automatically added by Click for any command. The default is `--help` but can be overridden by the context setting {attr}`~Context.help_option_names`. Click also performs automatic conflict resolution on the default help parameter, so if a command itself implements a parameter named `help` then the default help will not be run.260+261+This example changes the default parameters to `-h` and `--help`262+instead of just `--help`:263+264+```{eval-rst}265+.. click:example::266+267+ import click268+269+ CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])270+271+ @click.command(context_settings=CONTEXT_SETTINGS)272+ def cli():273+ pass274+275+.. click:run::276+ invoke(cli, ['-h'])277+```deleted:docs/documentation.rst-267 removed
1-Documenting Scripts2-===================3-4-.. currentmodule:: click5-6-Click makes it very easy to document your command line tools. First of7-all, it automatically generates help pages for you. While these are8-currently not customizable in terms of their layout, all of the text9-can be changed.10-11-Help Texts12-----------13-14-Commands and options accept help arguments. In the case of commands, the15-docstring of the function is automatically used if provided.16-17-Simple example:18-19-.. click:example::20-21- @click.command()22- @click.option('--count', default=1, help='number of greetings')23- @click.argument('name')24- def hello(count, name):25- """This script prints hello NAME COUNT times."""26- for x in range(count):27- click.echo(f"Hello {name}!")28-29-And what it looks like:30-31-.. click:run::32-33- invoke(hello, args=['--help'])34-35-36-.. _documenting-arguments:37-38-Documenting Arguments39-----------------------40-41-:func:`click.argument` does not take a ``help`` parameter. This is to42-follow the general convention of Unix tools of using arguments for only43-the most necessary things, and to document them in the command help text44-by referring to them by name.45-46-You might prefer to reference the argument in the description:47-48-.. click:example::49-50- @click.command()51- @click.argument('filename')52- def touch(filename):53- """Print FILENAME."""54- click.echo(filename)55-56-And what it looks like:57-58-.. click:run::59-60- invoke(touch, args=['--help'])61-62-Or you might prefer to explicitly provide a description of the argument:63-64-.. click:example::65-66- @click.command()67- @click.argument('filename')68- def touch(filename):69- """Print FILENAME.70-71- FILENAME is the name of the file to check.72- """73- click.echo(filename)74-75-And what it looks like:76-77-.. click:run::78-79- invoke(touch, args=['--help'])80-81-For more examples, see the examples in :doc:`/arguments`.82-83-84-Preventing Rewrapping85----------------------86-87-The default behavior of Click is to rewrap text based on the width of the88-terminal, to a maximum 80 characters. In some circumstances, this can become89-a problem. The main issue is when showing code examples, where newlines are90-significant.91-92-Rewrapping can be disabled on a per-paragraph basis by adding a line with93-solely the ``\b`` escape marker in it. This line will be removed from the94-help text and rewrapping will be disabled.95-96-Example:97-98-.. click:example::99-100- @click.command()101- def cli():102- """First paragraph.103-104- This is a very long second paragraph and as you105- can see wrapped very early in the source text106- but will be rewrapped to the terminal width in107- the final output.108-109- \b110- This is111- a paragraph112- without rewrapping.113-114- And this is a paragraph115- that will be rewrapped again.116- """117-118-And what it looks like:119-120-.. click:run::121-122- invoke(cli, args=['--help'])123-124-To change the maximum width, pass ``max_content_width`` when calling the command.125-126-.. code-block:: python127-128- cli(max_content_width=120)129-130-131-.. _doc-meta-variables:132-133-Truncating Help Texts134----------------------135-136-Click gets command help text from function docstrings. However if you137-already use docstrings to document function arguments you may not want138-to see :param: and :return: lines in your help text.139-140-You can use the ``\f`` escape marker to have Click truncate the help text141-after the marker.142-143-Example:144-145-.. click:example::146-147- @click.command()148- @click.pass_context149- def cli(ctx):150- """First paragraph.151-152- This is a very long second153- paragraph and not correctly154- wrapped but it will be rewrapped.155- \f156-157- :param click.core.Context ctx: Click context.158- """159-160-And what it looks like:161-162-.. click:run::163-164- invoke(cli, args=['--help'])165-166-167-Meta Variables168---------------169-170-Options and parameters accept a ``metavar`` argument that can change the171-meta variable in the help page. The default version is the parameter name172-in uppercase with underscores, but can be annotated differently if173-desired. This can be customized at all levels:174-175-.. click:example::176-177- @click.command(options_metavar='<options>')178- @click.option('--count', default=1, help='number of greetings',179- metavar='<int>')180- @click.argument('name', metavar='<name>')181- def hello(count, name):182- """This script prints hello <name> <int> times."""183- for x in range(count):184- click.echo(f"Hello {name}!")185-186-Example:187-188-.. click:run::189-190- invoke(hello, args=['--help'])191-192-193-Command Short Help194-------------------195-196-For commands, a short help snippet is generated. By default, it's the first197-sentence of the help message of the command, unless it's too long. This can198-also be overridden:199-200-.. click:example::201-202- @click.group()203- def cli():204- """A simple command line tool."""205-206- @cli.command('init', short_help='init the repo')207- def init():208- """Initializes the repository."""209-210- @cli.command('delete', short_help='delete the repo')211- def delete():212- """Deletes the repository."""213-214-And what it looks like:215-216-.. click:run::217-218- invoke(cli, prog_name='repo.py')219-220-Command Epilog Help221--------------------222-223-The help epilog is like the help string but it's printed at the end of the help224-page after everything else. Useful for showing example command usages or225-referencing additional help resources.226-227-.. click:example::228-229- @click.command(epilog='Check out our docs at https://click.palletsprojects.com/ for more details')230- def init():231- """Initializes the repository."""232-233-And what it looks like:234-235-.. click:run::236-237- invoke(init, prog_name='repo.py', args=['--help'])238-239-Help Parameter Customization240-----------------------------241-242-.. versionadded:: 2.0243-244-The help parameter is implemented in Click in a very special manner.245-Unlike regular parameters it's automatically added by Click for any246-command and it performs automatic conflict resolution. By default it's247-called ``--help``, but this can be changed. If a command itself implements248-a parameter with the same name, the default help parameter stops accepting249-it. There is a context setting that can be used to override the names of250-the help parameters called :attr:`~Context.help_option_names`.251-252-This example changes the default parameters to ``-h`` and ``--help``253-instead of just ``--help``:254-255-.. click:example::256-257- CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])258-259- @click.command(context_settings=CONTEXT_SETTINGS)260- def cli():261- pass262-263-And what it looks like:264-265-.. click:run::266-267- invoke(cli, ['-h'])modified:docs/entry-points.rst+3 added-2 removed
1 Packaging Entry Points2 ======================3 4 It's recommended to write command line utilities as installable packages with5-entry points instead telling users to run ``python hello.py``.5+entry points instead of telling users to run ``python hello.py``.6 7 A distribution package is a ``.whl`` file you install with pip or another Python8 installer. You use a ``pyproject.toml`` file to describe the project and how it9 is built into a package. You might upload this package to PyPI, or distribute it16 unmodified lines26 hello-project/27 src/28 hello/29 __init__.py30+ hello.py31 pyproject.toml32 33 Contents of ``hello.py``:34 19 unmodified lines54 "click>=8.1",55 ]56 57 [project.scripts]57- hello = "hello:cli"58+ hello = "hello.hello:cli"59 60 [build-system]61 requires = ["flit_core<4"]62 build-backend = "flit_core.buildapi"25 unmodified linesadded:docs/extending-click.rst+138 added
1+Extending Click2+=================3+4+.. currentmodule:: click5+6+In addition to common functionality that is implemented in the library7+itself, there are countless patterns that can be implemented by extending8+Click. This page should give some insight into what can be accomplished.9+10+.. contents::11+ :depth: 212+ :local:13+14+.. _custom-groups:15+16+Custom Groups17+-------------18+19+You can customize the behavior of a group beyond the arguments it accepts by20+subclassing :class:`click.Group`.21+22+The most common methods to override are :meth:`~click.Group.get_command` and23+:meth:`~click.Group.list_commands`.24+25+The following example implements a basic plugin system that loads commands from26+Python files in a folder. The command is lazily loaded to avoid slow startup.27+28+.. code-block:: python29+30+ import importlib.util31+ import os32+ import click33+34+ class PluginGroup(click.Group):35+ def __init__(self, name=None, plugin_folder="commands", **kwargs):36+ super().__init__(name=name, **kwargs)37+ self.plugin_folder = plugin_folder38+39+ def list_commands(self, ctx):40+ rv = []41+42+ for filename in os.listdir(self.plugin_folder):43+ if filename.endswith(".py"):44+ rv.append(filename[:-3])45+46+ rv.sort()47+ return rv48+49+ def get_command(self, ctx, name):50+ path = os.path.join(self.plugin_folder, f"{name}.py")51+ spec = importlib.util.spec_from_file_location(name, path)52+ module = importlib.util.module_from_spec(spec)53+ spec.loader.exec_module(module)54+ return module.cli55+56+ cli = PluginGroup(57+ plugin_folder=os.path.join(os.path.dirname(__file__), "commands")58+ )59+60+ if __name__ == "__main__":61+ cli()62+63+Custom classes can also be used with decorators:64+65+.. code-block:: python66+67+ @click.group(68+ cls=PluginGroup,69+ plugin_folder=os.path.join(os.path.dirname(__file__), "commands")70+ )71+ def cli():72+ pass73+74+.. _aliases:75+76+Command Aliases77+---------------78+79+Many tools support aliases for commands. For example, you can configure80+``git`` to accept ``git ci`` as alias for ``git commit``. Other tools also81+support auto-discovery for aliases by automatically shortening them.82+83+It's possible to customize :class:`Group` to provide this functionality. As84+explained in :ref:`custom-groups`, a group provides two methods:85+:meth:`~Group.list_commands` and :meth:`~Group.get_command`. In this particular86+case, you only need to override the latter as you generally don't want to87+enumerate the aliases on the help page in order to avoid confusion.88+89+The following example implements a subclass of :class:`Group` that accepts a90+prefix for a command. If there was a command called ``push``, it would accept91+``pus`` as an alias (so long as it was unique):92+93+.. click:example::94+95+ class AliasedGroup(click.Group):96+ def get_command(self, ctx, cmd_name):97+ rv = super().get_command(ctx, cmd_name)98+99+ if rv is not None:100+ return rv101+102+ matches = [103+ x for x in self.list_commands(ctx)104+ if x.startswith(cmd_name)105+ ]106+107+ if not matches:108+ return None109+110+ if len(matches) == 1:111+ return click.Group.get_command(self, ctx, matches[0])112+113+ ctx.fail(f"Too many matches: {', '.join(sorted(matches))}")114+115+ def resolve_command(self, ctx, args):116+ # always return the full command name117+ _, cmd, args = super().resolve_command(ctx, args)118+ return cmd.name, cmd, args119+120+It can be used like this:121+122+.. click:example::123+124+ @click.group(cls=AliasedGroup)125+ def cli():126+ pass127+128+ @cli.command129+ def push():130+ pass131+132+ @cli.command133+ def pop():134+ pass135+136+See the `alias example`_ in Click's repository for another example.137+138+.. _alias example: https://github.com/pallets/click/tree/main/examples/aliasesadded:docs/faqs.md+39 added
1+# Frequently Asked Questions2+3+```{contents}4+:depth: 25+:local: true6+```7+8+## General9+10+### Shell Variable Expansion On Windows11+12+I have a simple Click app :13+14+```15+import click16+17+@click.command()18+@click.argument('message')19+def main(message: str):20+ click.echo(message)21+22+if __name__ == '__main__':23+ main()24+25+```26+27+When you pass an environment variable in the argument, it expands it:28+29+```{code-block} powershell30+> Desktop python foo.py '$M0/.viola/2025-01-25-17-20-23-307878'31+> M:/home/ramrachum/.viola/2025-01-25-17-20-23-30787832+>33+```34+Note that I used single quotes above, so my shell is not expanding the environment variable, Click does. How do I get Click to not expand it?35+36+#### Answer37+38+If you don't want Click to emulate (as best it can) unix expansion on Windows, pass windows_expand_args=False when calling the CLI.39+Windows command line doesn't do any *, ~, or $ENV expansion. It also doesn't distinguish between double quotes and single quotes (where the later means "don't expand here"). Click emulates the expansion so that the app behaves similarly on both platforms, but doesn't receive information about what quotes were used.added:docs/handling-files.rst+90 added
1+.. _handling-files:2+3+Handling Files4+================5+6+.. currentmodule:: click7+8+Click has built in features to support file and file path handling. The examples use arguments but the same principle applies to options as well.9+10+.. _file-args:11+12+File Arguments13+-----------------14+15+Click supports working with files with the :class:`File` type. Some notable features are:16+17+* Support for ``-`` to mean a special file that refers to stdin when used for reading, and stdout when used for writing. This is a common pattern for POSIX command line utilities.18+* Deals with ``str`` and ``bytes`` correctly for all versions of Python.19+20+Example:21+22+.. click:example::23+24+ @click.command()25+ @click.argument('input', type=click.File('rb'))26+ @click.argument('output', type=click.File('wb'))27+ def inout(input, output):28+ """Copy contents of INPUT to OUTPUT."""29+ while True:30+ chunk = input.read(1024)31+ if not chunk:32+ break33+ output.write(chunk)34+35+And from the command line:36+37+.. click:run::38+39+ with isolated_filesystem():40+ invoke(inout, args=['-', 'hello.txt'], input=['hello'],41+ terminate_input=True)42+ invoke(inout, args=['hello.txt', '-'])43+44+File Path Arguments45+----------------------46+47+For handling paths, the :class:`Path` type is better than a ``str``. Some notable features are:48+49+* The ``exists`` argument will verify whether the path exists.50+* ``readable``, ``writable``, and ``executable`` can perform permission checks.51+* ``file_okay`` and ``dir_okay`` allow specifying whether files/directories are accepted.52+* Error messages are nicely formatted using :func:`format_filename` so any undecodable bytes will be printed nicely.53+54+See :class:`Path` for all features.55+56+Example:57+58+.. click:example::59+60+ @click.command()61+ @click.argument('filename', type=click.Path(exists=True))62+ def touch(filename):63+ """Print FILENAME if the file exists."""64+ click.echo(click.format_filename(filename))65+66+And from the command line:67+68+.. click:run::69+70+ with isolated_filesystem():71+ with open('hello.txt', 'w') as f:72+ f.write('Hello World!\n')73+ invoke(touch, args=['hello.txt'])74+ println()75+ invoke(touch, args=['missing.txt'])76+77+78+File Opening Behaviors79+-----------------------------80+81+The :class:`File` type attempts to be "intelligent" about when to open a file. Stdin/stdout and files opened for reading will be opened immediately. This will give the user direct feedback when a file cannot be opened. Files opened for writing will only be open on the first IO operation. This is done by automatically wrapping the file in a special wrapper.82+83+File open behavior can be controlled by the boolean kwarg ``lazy``. If a file is opened lazily:84+85+* A failure at first IO operation will happen by raising an :exc:`FileError`.86+* It can help minimize resource handling confusion. If a file is opened in lazy mode, it will call :meth:`LazyFile.close_intelligently` to help figure out if the file needs closing or not. This is not needed for parameters, but is necessary for manually prompting. For manual prompts with the :func:`prompt` function you do not know if a stream like stdout was opened (which was already open before) or a real file was opened (that needs closing).87+88+Since files opened for writing will typically empty the file, the lazy mode should only be disabled if the developer is absolutely sure that this is intended behavior.89+90+It is also possible to open files in atomic mode by passing ``atomic=True``. In atomic mode, all writes go into a separate file in the same folder, and upon completion, the file will be moved over to the original location. This is useful if a file regularly read by other users is modified.modified:docs/index.rst+52 added-18 removed
1 unmodified line2 3 Welcome to Click4 ================5 6-.. image:: _static/click-logo.png6+.. image:: _static/click-name.svg7 :align: center8- :scale: 50%9- :target: https://palletsprojects.com/p/click/8+ :height: 200px9 10 Click is a Python package for creating beautiful command line interfaces11 in a composable way with as little code as necessary. It's the "Command12 Line Interface Creation Kit". It's highly configurable but comes with43 unmodified lines56 57 pip install click58 59 Documentation61--------------60+==============61 63-This part of the documentation guides you through all of the library's64-usage patterns.65-62 .. toctree::63 :maxdepth: 264 69- why65+ faqs66+67+Tutorials68+------------69+.. toctree::70+ :maxdepth: 171+72 quickstart71- entry-points73 virtualenv74+75+How to Guides76+---------------77+.. toctree::78+ :maxdepth: 179+80+ entry-points81 setuptools82+ support-multiple-versions83+84+Conceptual Guides85+-------------------86+.. toctree::87+ :maxdepth: 188+89+ why90+ click-concepts91+92+General Reference93+--------------------94+95+.. toctree::96+ :maxdepth: 197+98 parameters99+ parameter-types100 options101+ option-decorators102 arguments103+ commands-and-groups104 commands78- prompts105 documentation80- complex106+ prompts107+ handling-files108 advanced109+ complex110+ extending-click111 testing112 utils113 shell-completion114 exceptions115 unicode-support116 wincmd117 118 API Reference90--------------119+-------------------120 92-If you are looking for information on a specific function, class, or93-method, this part of the documentation is for you.94-121 .. toctree::122 :maxdepth: 2123 124 api125 100-Miscellaneous Pages101--------------------126+About Project127+===============128 129+* This documentation is structured according to `Diataxis <https://diataxis.fr/>`_130+131+* `Version Policy <https://palletsprojects.com/versions>`_132+133+* `Contributing <https://palletsprojects.com/contributing/>`_134+135+* `Donate <https://palletsprojects.com/donate>`_136+137 .. toctree::104- :maxdepth: 2138+ :maxdepth: 1139 140 contrib141 license142 changesdeleted:docs/make.bat-36 removed
1-@ECHO OFF2-3-pushd %~dp04-5-REM Command file for Sphinx documentation6-7-if "%SPHINXBUILD%" == "" (8- set SPHINXBUILD=sphinx-build9-)10-set SOURCEDIR=.11-set BUILDDIR=_build12-set SPHINXPROJ=Jinja13-14-if "%1" == "" goto help15-16-%SPHINXBUILD% >NUL 2>NUL17-if errorlevel 9009 (18- echo.19- echo.The 'sphinx-build' command was not found. Make sure you have Sphinx20- echo.installed, then set the SPHINXBUILD environment variable to point21- echo.to the full path of the 'sphinx-build' executable. Alternatively you22- echo.may add the Sphinx directory to PATH.23- echo.24- echo.If you don't have Sphinx installed, grab it from25- echo.http://sphinx-doc.org/26- exit /b 127-)28-29-%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%30-goto end31-32-:help33-%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%34-35-:end36-popddeleted:docs/Makefile-20 removed
1-# Minimal makefile for Sphinx documentation2-#3-4-# You can set these variables from the command line.5-SPHINXOPTS =6-SPHINXBUILD = sphinx-build7-SPHINXPROJ = Jinja8-SOURCEDIR = .9-BUILDDIR = _build10-11-# Put it first so that "make" without argument is like "make help".12-help:13- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)14-15-.PHONY: help Makefile16-17-# Catch-all target: route all unknown targets to Sphinx using the new18-# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).19-%: Makefile20- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)added:docs/option-decorators.rst+84 added
1+Options Shortcut Decorators2+===========================3+4+.. currentmodule:: click5+6+For convenience commonly used combinations of options arguments are available as their own decorators.7+8+.. contents::9+ :depth: 210+ :local:11+12+Password Option13+------------------14+15+Click supports hidden prompts and asking for confirmation. This is16+useful for password input:17+18+.. click:example::19+20+ import codecs21+22+ @click.command()23+ @click.option(24+ "--password", prompt=True, hide_input=True,25+ confirmation_prompt=True26+ )27+ def encode(password):28+ click.echo(f"encoded: {codecs.encode(password, 'rot13')}")29+30+.. click:run::31+32+ invoke(encode, input=['secret', 'secret'])33+34+Because this combination of parameters is quite common, this can also be35+replaced with the :func:`password_option` decorator:36+37+.. code-block:: python38+39+ @click.command()40+ @click.password_option()41+ def encrypt(password):42+ click.echo(f"encoded: to {codecs.encode(password, 'rot13')}")43+44+Confirmation Option45+--------------------46+47+For dangerous operations, it's very useful to be able to ask a user for48+confirmation. This can be done by adding a boolean ``--yes`` flag and49+asking for confirmation if the user did not provide it and to fail in a50+callback:51+52+.. click:example::53+54+ def abort_if_false(ctx, param, value):55+ if not value:56+ ctx.abort()57+58+ @click.command()59+ @click.option('--yes', is_flag=True, callback=abort_if_false,60+ expose_value=False,61+ prompt='Are you sure you want to drop the db?')62+ def dropdb():63+ click.echo('Dropped all tables!')64+65+And what it looks like on the command line:66+67+.. click:run::68+69+ invoke(dropdb, input=['n'])70+ invoke(dropdb, args=['--yes'])71+72+Because this combination of parameters is quite common, this can also be73+replaced with the :func:`confirmation_option` decorator:74+75+.. click:example::76+77+ @click.command()78+ @click.confirmation_option(prompt='Are you sure you want to drop the db?')79+ def dropdb():80+ click.echo('Dropped all tables!')81+82+Version Option83+----------------84+:func:`version_option` adds a ``--version`` option which immediately prints the version number and exits the program.added:docs/options.md+476 added
1+(options)=2+3+# Options4+5+```{eval-rst}6+.. currentmodule:: click7+```8+9+Adding options to commands can be accomplished with the {func}`option`10+decorator. At runtime the decorator invokes the {class}`Option` class. Options in Click are distinct from {ref}`positional arguments <arguments>`.11+12+Useful and often used kwargs are:13+14+- `default`: Passes a default.15+- `help`: Sets help message.16+- `nargs`: Sets the number of arguments.17+- `required`: Makes option required.18+- `type`: Sets {ref}`parameter type <parameter-types>`19+20+```{contents}21+:depth: 222+:local: true23+```24+25+## Option Decorator26+27+Click expects you to pass at least two positional arguments to the option decorator. They are option name and function argument name.28+29+```{eval-rst}30+.. click:example::31+32+ @click.command()33+ @click.option('--string-to-echo', 'string_to_echo')34+ def echo(string_to_echo):35+ click.echo(string_to_echo)36+37+38+.. click:run::39+40+ invoke(echo, args=['--help'])41+```42+43+However, if you don't pass in the function argument name, then Click will try to infer it. A simple way to name your option is by taking the function argument, adding two dashes to the front and converting underscores to dashes. In this case, Click will infer the function argument name correctly so you can add only the option name.44+45+```{eval-rst}46+.. click:example::47+48+ @click.command()49+ @click.option('--string-to-echo')50+ def echo(string_to_echo):51+ click.echo(string_to_echo)52+53+.. click:run::54+55+ invoke(echo, args=['--string-to-echo', 'Hi!'])56+```57+58+More formally, Click will try to infer the function argument name by:59+60+1. If a positional argument name does not have a prefix, it is chosen.61+2. If a positional argument name starts with with two dashes, the first one given is chosen.62+3. The first positional argument prefixed with one dash is chosen otherwise.63+64+The chosen positional argument is converted to lower case, up to two dashes are removed from the beginning, and other dashes are converted to underscores to get the function argument name.65+66+```{eval-rst}67+.. list-table:: Examples68+ :widths: 15 1069+ :header-rows: 170+71+ * - Decorator Arguments72+ - Function Name73+ * - ``"-f", "--foo-bar"``74+ - foo_bar75+ * - ``"-x"``76+ - x77+ * - ``"-f", "--filename", "dest"``78+ - dest79+ * - ``"--CamelCase"``80+ - camelcase81+ * - ``"-f", "-fb"``82+ - f83+ * - ``"--f", "--foo-bar"``84+ - f85+ * - ``"---f"``86+ - _f87+```88+89+## Basic Example90+91+A simple {class}`click.Option` takes one argument. This will assume the argument is not required. If the decorated function takes an positional argument then None is passed it. This will also assume the type is `str`.92+93+```{eval-rst}94+.. click:example::95+96+ @click.command()97+ @click.option('--text')98+ def print_this(text):99+ click.echo(text)100+101+102+.. click:run::103+104+ invoke(print_this, args=['--text=this'])105+106+ invoke(print_this, args=[])107+108+109+.. click:run::110+111+ invoke(print_this, args=['--help'])112+113+```114+115+## Setting a Default116+117+Instead of setting the `type`, you may set a default and Click will try to infer the type.118+119+```{eval-rst}120+.. click:example::121+122+ @click.command()123+ @click.option('--n', default=1)124+ def dots(n):125+ click.echo('.' * n)126+127+.. click:run::128+129+ invoke(dots, args=['--help'])130+```131+132+## Multi Value Options133+134+To make an option take multiple values, pass in `nargs`. Note only a fixed number of arguments is supported. The values are passed to the underlying function as a tuple.135+136+```{eval-rst}137+.. click:example::138+139+ @click.command()140+ @click.option('--pos', nargs=2, type=float)141+ def findme(pos):142+ a, b = pos143+ click.echo(f"{a} / {b}")144+145+.. click:run::146+147+ invoke(findme, args=['--pos', '2.0', '3.0'])148+149+```150+151+(tuple-type)=152+153+## Multi Value Options as Tuples154+155+```{versionadded} 4.0156+```157+158+As you can see that by using `nargs` set to a specific number each item in159+the resulting tuple is of the same type. This might not be what you want.160+Commonly you might want to use different types for different indexes in161+the tuple. For this you can directly specify a tuple as type:162+163+```{eval-rst}164+.. click:example::165+166+ @click.command()167+ @click.option('--item', type=(str, int))168+ def putitem(item):169+ name, id = item170+ click.echo(f"name={name} id={id}")171+172+173+And on the command line:174+175+.. click:run::176+177+ invoke(putitem, args=['--item', 'peter', '1338'])178+```179+180+By using a tuple literal as type, `nargs` gets automatically set to the181+length of the tuple and the {class}`click.Tuple` type is automatically182+used. The above example is thus equivalent to this:183+184+```{eval-rst}185+.. click:example::186+187+ @click.command()188+ @click.option('--item', nargs=2, type=click.Tuple([str, int]))189+ def putitem(item):190+ name, id = item191+ click.echo(f"name={name} id={id}")192+```193+194+(multiple-options)=195+196+## Multiple Options197+198+The multiple options format allows you to call the underlying function multiple times with one command line entry. If set, the default must be a list or tuple. Setting a string as a default will be interpreted as list of characters.199+200+```{eval-rst}201+.. click:example::202+203+ @click.command()204+ @click.option('--message', '-m', multiple=True)205+ def commit(message):206+ click.echo('\n'.join(message))207+208+.. click:run::209+210+ invoke(commit, args=['-m', 'foo', '-m', 'bar', '-m', 'here'])211+```212+213+## Counting214+215+To count the occurrence of an option pass in `count=True`. If the option is not passed in, then the count is 0. Counting is commonly used for verbosity.216+217+```{eval-rst}218+.. click:example::219+220+ @click.command()221+ @click.option('-v', '--verbose', count=True)222+ def log(verbose):223+ click.echo(f"Verbosity: {verbose}")224+225+.. click:run::226+227+ invoke(log, args=[])228+ invoke(log, args=['-vvv'])229+```230+231+(option-boolean-flag)=232+233+## Boolean234+235+Boolean options (boolean flags) take the value True or False. The simplest case sets the default value to `False` if the flag is not passed, and `True` if it is.236+237+```{eval-rst}238+.. click:example::239+240+ import sys241+242+ @click.command()243+ @click.option('--shout', is_flag=True)244+ def info(shout):245+ rv = sys.platform246+ if shout:247+ rv = rv.upper() + '!!!!111'248+ click.echo(rv)249+250+251+.. click:run::252+253+ invoke(info)254+ invoke(info, args=['--shout'])255+256+```257+258+To implement this more explicitly, pass in on-option `/` off-option. Click will automatically set `is_flag=True`. Click always wants you to provide an enable259+and disable flag so that you can change the default later.260+261+```{eval-rst}262+.. click:example::263+264+ import sys265+266+ @click.command()267+ @click.option('--shout/--no-shout', default=False)268+ def info(shout):269+ rv = sys.platform270+ if shout:271+ rv = rv.upper() + '!!!!111'272+ click.echo(rv)273+274+.. click:run::275+276+ invoke(info)277+ invoke(info, args=['--shout'])278+ invoke(info, args=['--no-shout'])279+```280+281+If a forward slash(`/`) is contained in your option name already, you can split the parameters using `;`. In Windows `/` is commonly used as the prefix character.282+283+```{eval-rst}284+.. click:example::285+286+ @click.command()287+ @click.option('/debug;/no-debug')288+ def log(debug):289+ click.echo(f"debug={debug}")290+```291+292+```{versionchanged} 6.0293+```294+295+If you want to define an alias for the second option only, then you will need to use leading whitespace to disambiguate the format string.296+297+```{eval-rst}298+.. click:example::299+300+ import sys301+302+ @click.command()303+ @click.option('--shout/--no-shout', ' /-N', default=False)304+ def info(shout):305+ rv = sys.platform306+ if shout:307+ rv = rv.upper() + '!!!!111'308+ click.echo(rv)309+310+.. click:run::311+312+ invoke(info, args=['--help'])313+```314+315+## Flag Value316+317+To have an flag pass a value to the underlying function set `flag_value`. This automatically sets `is_flag=True`. To set a default flag, set `default=True`. Setting flag values can be used to create patterns like this:318+319+```{eval-rst}320+.. click:example::321+322+ import sys323+324+ @click.command()325+ @click.option('--upper', 'transformation', flag_value='upper', default=True)326+ @click.option('--lower', 'transformation', flag_value='lower')327+ def info(transformation):328+ click.echo(getattr(sys.platform, transformation)())329+330+.. click:run::331+332+ invoke(info, args=['--help'])333+ invoke(info, args=['--upper'])334+ invoke(info, args=['--lower'])335+ invoke(info)336+```337+338+## Values from Environment Variables339+340+To pass in a value in from a specific environment variable use `envvar`.341+342+```{eval-rst}343+.. click:example::344+345+ @click.command()346+ @click.option('--username', envvar='USERNAME')347+ def greet(username):348+ click.echo(f"Hello {username}!")349+350+.. click:run::351+352+ invoke(greet, env={'USERNAME': 'john'})353+```354+355+If a list is passed to `envvar`, the first environment variable found is picked.356+357+```{eval-rst}358+.. click:example::359+360+ @click.command()361+ @click.option('--username', envvar=['ALT_USERNAME', 'USERNAME'])362+ def greet(username):363+ click.echo(f"Hello {username}!")364+365+.. click:run::366+367+ invoke(greet, env={'ALT_USERNAME': 'Bill', 'USERNAME': 'john'})368+369+```370+371+Variable names are:372+ - [Case-insensitive on Windows but not on other platforms](https://github.com/python/cpython/blob/aa9eb5f757ceff461e6e996f12c89e5d9b583b01/Lib/os.py#L777-L789).373+ - Not stripped of whitespaces and should match the exact name provided to the `envvar` argument.374+375+For flag options, there is two concepts to consider: the activation of the flag driven by the environment variable, and the value of the flag if it is activated.376+377+The environment variable need to be interpreted, because values read from them are always strings. We need to transform these strings into boolean values that will determine if the flag is activated or not.378+379+Here are the rules used to parse environment variable values for flag options:380+ - `true`, `1`, `yes`, `on`, `t`, `y` are interpreted as activating the flag381+ - `false`, `0`, `no`, `off`, `f`, `n` are interpreted as deactivating the flag382+ - The presence of the environment variable without value is interpreted as deactivating the flag383+ - Empty strings are interpreted as deactivating the flag384+ - Values are case-insensitive, so the `True`, `TRUE`, `tRuE` strings are all activating the flag385+ - Values are stripped of leading and trailing whitespaces before being interpreted, so the `" True "` string is transformed to `"true"` and so activates the flag386+ - If the flag option has a `flag_value` argument, passing that value in the environment variable will activate the flag, in addition to all the cases described above387+ - Any other value is interpreted as deactivating the flag388+389+.. caution::390+ For boolean flags with a pair of values, the only recognized environment variable is the one provided to the `envvar` argument.391+392+ So an option defined as `--flag\--no-flag`, with a `envvar="FLAG"` parameter, there is no magical `NO_FLAG=<anything>` variable that is recognized. Only the `FLAG=<anything>` environment variable is recognized.393+394+Once the status of the flag has been determine to be activated or not, the `flag_value` is used as the value of the flag if it is activated. If the flag is not activated, the value of the flag is set to `None` by default.395+396+## Multiple Options from Environment Values397+398+As options can accept multiple values, pulling in such values from399+environment variables (which are strings) is a bit more complex. The way400+Click solves this is by leaving it up to the type to customize this401+behavior. For both `multiple` and `nargs` with values other than402+`1`, Click will invoke the {meth}`ParamType.split_envvar_value` method to403+perform the splitting.404+405+The default implementation for all types is to split on whitespace. The406+exceptions to this rule are the {class}`File` and {class}`Path` types407+which both split according to the operating system's path splitting rules.408+On Unix systems like Linux and OS X, the splitting happens on409+every colon (`:`), and for Windows, splitting on every semicolon (`;`).410+411+```{eval-rst}412+.. click:example::413+414+ @click.command()415+ @click.option('paths', '--path', envvar='PATHS', multiple=True,416+ type=click.Path())417+ def perform(paths):418+ for path in paths:419+ click.echo(path)420+421+ if __name__ == '__main__':422+ perform()423+424+.. click:run::425+426+ import os427+ invoke(perform, env={"PATHS": f"./foo/bar{os.path.pathsep}./test"})428+```429+430+## Other Prefix Characters431+432+Click can deal with prefix characters besides `-` for options. Click can use433+`/`, `+` as well as others. Note that alternative prefix characters are generally used very sparingly if at all within POSIX.434+435+```{eval-rst}436+.. click:example::437+438+ @click.command()439+ @click.option('+w/-w')440+ def chmod(w):441+ click.echo(f"writable={w}")442+443+.. click:run::444+445+ invoke(chmod, args=['+w'])446+ invoke(chmod, args=['-w'])447+```448+449+There are special considerations for using `/` as prefix character, see {ref}`option-boolean-flag` for more.450+451+(optional-value)=452+453+## Optional Value454+455+Providing the value to an option can be made optional, in which case456+providing only the option's flag without a value will either show a457+prompt or use its `flag_value`.458+459+Setting `is_flag=False, flag_value=value` tells Click that the option460+can still be passed a value, but if only the flag is given, the461+value will be `flag_value`.462+463+```{eval-rst}464+.. click:example::465+466+ @click.command()467+ @click.option("--name", is_flag=False, flag_value="Flag", default="Default")468+ def hello(name):469+ click.echo(f"Hello, {name}!")470+471+.. click:run::472+473+ invoke(hello, args=[])474+ invoke(hello, args=["--name", "Value"])475+ invoke(hello, args=["--name"])476+```deleted:docs/options.rst-927 removed
1-.. _options:2-3-Options4-=======5-6-.. currentmodule:: click7-8-Adding options to commands can be accomplished by the :func:`option`9-decorator. Since options can come in various different versions, there10-are a ton of parameters to configure their behavior. Options in click are11-distinct from :ref:`positional arguments <arguments>`.12-13-Name Your Options14------------------15-16-Options have a name that will be used as the Python argument name when17-calling the decorated function. This can be inferred from the option18-names or given explicitly. Names are given as position arguments to the19-decorator.20-21-A name is chosen in the following order22-23-1. If a name is not prefixed, it is used as the Python argument name24- and not treated as an option name on the command line.25-2. If there is at least one name prefixed with two dashes, the first26- one given is used as the name.27-3. The first name prefixed with one dash is used otherwise.28-29-To get the Python argument name, the chosen name is converted to lower30-case, up to two dashes are removed as the prefix, and other dashes are31-converted to underscores.32-33-.. code-block:: python34-35- @click.command()36- @click.option('-s', '--string-to-echo')37- def echo(string_to_echo):38- click.echo(string_to_echo)39-40-.. code-block:: python41-42- @click.command()43- @click.option('-s', '--string-to-echo', 'string')44- def echo(string):45- click.echo(string)46-47-- ``"-f", "--foo-bar"``, the name is ``foo_bar``48-- ``"-x"``, the name is ``x``49-- ``"-f", "--filename", "dest"``, the name is ``dest``50-- ``"--CamelCase"``, the name is ``camelcase``51-- ``"-f", "-fb"``, the name is ``f``52-- ``"--f", "--foo-bar"``, the name is ``f``53-- ``"---f"``, the name is ``_f``54-55-Basic Value Options56--------------------57-58-The most basic option is a value option. These options accept one59-argument which is a value. If no type is provided, the type of the default60-value is used. If no default value is provided, the type is assumed to be61-:data:`STRING`. Unless a name is explicitly specified, the name of the62-parameter is the first long option defined; otherwise the first short one is63-used. By default, options are not required, however to make an option required,64-simply pass in `required=True` as an argument to the decorator.65-66-.. click:example::67-68- @click.command()69- @click.option('--n', default=1)70- def dots(n):71- click.echo('.' * n)72-73-.. click:example::74-75- # How to make an option required76- @click.command()77- @click.option('--n', required=True, type=int)78- def dots(n):79- click.echo('.' * n)80-81-.. click:example::82-83- # How to use a Python reserved word such as `from` as a parameter84- @click.command()85- @click.option('--from', '-f', 'from_')86- @click.option('--to', '-t')87- def reserved_param_name(from_, to):88- click.echo(f"from {from_} to {to}")89-90-And on the command line:91-92-.. click:run::93-94- invoke(dots, args=['--n=2'])95-96-In this case the option is of type :data:`INT` because the default value97-is an integer.98-99-To show the default values when showing command help, use ``show_default=True``100-101-.. click:example::102-103- @click.command()104- @click.option('--n', default=1, show_default=True)105- def dots(n):106- click.echo('.' * n)107-108-.. click:run::109-110- invoke(dots, args=['--help'])111-112-For single option boolean flags, the default remains hidden if the default113-value is False.114-115-.. click:example::116-117- @click.command()118- @click.option('--n', default=1, show_default=True)119- @click.option("--gr", is_flag=True, show_default=True, default=False, help="Greet the world.")120- @click.option("--br", is_flag=True, show_default=True, default=True, help="Add a thematic break")121- def dots(n, gr, br):122- if gr:123- click.echo('Hello world!')124- click.echo('.' * n)125- if br:126- click.echo('-' * n)127-128-.. click:run::129-130- invoke(dots, args=['--help'])131-132-133-Multi Value Options134--------------------135-136-Sometimes, you have options that take more than one argument. For options,137-only a fixed number of arguments is supported. This can be configured by138-the ``nargs`` parameter. The values are then stored as a tuple.139-140-.. click:example::141-142- @click.command()143- @click.option('--pos', nargs=2, type=float)144- def findme(pos):145- a, b = pos146- click.echo(f"{a} / {b}")147-148-And on the command line:149-150-.. click:run::151-152- invoke(findme, args=['--pos', '2.0', '3.0'])153-154-.. _tuple-type:155-156-Tuples as Multi Value Options157------------------------------158-159-.. versionadded:: 4.0160-161-As you can see that by using `nargs` set to a specific number each item in162-the resulting tuple is of the same type. This might not be what you want.163-Commonly you might want to use different types for different indexes in164-the tuple. For this you can directly specify a tuple as type:165-166-.. click:example::167-168- @click.command()169- @click.option('--item', type=(str, int))170- def putitem(item):171- name, id = item172- click.echo(f"name={name} id={id}")173-174-And on the command line:175-176-.. click:run::177-178- invoke(putitem, args=['--item', 'peter', '1338'])179-180-By using a tuple literal as type, `nargs` gets automatically set to the181-length of the tuple and the :class:`click.Tuple` type is automatically182-used. The above example is thus equivalent to this:183-184-.. click:example::185-186- @click.command()187- @click.option('--item', nargs=2, type=click.Tuple([str, int]))188- def putitem(item):189- name, id = item190- click.echo(f"name={name} id={id}")191-192-.. _multiple-options:193-194-Multiple Options195-----------------196-197-Similarly to ``nargs``, there is also the case of wanting to support a198-parameter being provided multiple times and have all the values recorded --199-not just the last one. For instance, ``git commit -m foo -m bar`` would200-record two lines for the commit message: ``foo`` and ``bar``. This can be201-accomplished with the ``multiple`` flag:202-203-Example:204-205-.. click:example::206-207- @click.command()208- @click.option('--message', '-m', multiple=True)209- def commit(message):210- click.echo('\n'.join(message))211-212-And on the command line:213-214-.. click:run::215-216- invoke(commit, args=['-m', 'foo', '-m', 'bar'])217-218-When passing a ``default`` with ``multiple=True``, the default value219-must be a list or tuple, otherwise it will be interpreted as a list of220-single characters.221-222-.. code-block:: python223-224- @click.option("--format", multiple=True, default=["json"])225-226-227-Counting228---------229-230-In some very rare circumstances, it is interesting to use the repetition231-of options to count an integer up. This can be used for verbosity flags,232-for instance:233-234-.. click:example::235-236- @click.command()237- @click.option('-v', '--verbose', count=True)238- def log(verbose):239- click.echo(f"Verbosity: {verbose}")240-241-And on the command line:242-243-.. click:run::244-245- invoke(log, args=['-vvv'])246-247-Boolean Flags248--------------249-250-Boolean flags are options that can be enabled or disabled. This can be251-accomplished by defining two flags in one go separated by a slash (``/``)252-for enabling or disabling the option. (If a slash is in an option string,253-Click automatically knows that it's a boolean flag and will pass254-``is_flag=True`` implicitly.) Click always wants you to provide an enable255-and disable flag so that you can change the default later.256-257-Example:258-259-.. click:example::260-261- import sys262-263- @click.command()264- @click.option('--shout/--no-shout', default=False)265- def info(shout):266- rv = sys.platform267- if shout:268- rv = rv.upper() + '!!!!111'269- click.echo(rv)270-271-And on the command line:272-273-.. click:run::274-275- invoke(info, args=['--shout'])276- invoke(info, args=['--no-shout'])277- invoke(info)278-279-If you really don't want an off-switch, you can just define one and280-manually inform Click that something is a flag:281-282-.. click:example::283-284- import sys285-286- @click.command()287- @click.option('--shout', is_flag=True)288- def info(shout):289- rv = sys.platform290- if shout:291- rv = rv.upper() + '!!!!111'292- click.echo(rv)293-294-And on the command line:295-296-.. click:run::297-298- invoke(info, args=['--shout'])299- invoke(info)300-301-Note that if a slash is contained in your option already (for instance, if302-you use Windows-style parameters where ``/`` is the prefix character), you303-can alternatively split the parameters through ``;`` instead:304-305-.. click:example::306-307- @click.command()308- @click.option('/debug;/no-debug')309- def log(debug):310- click.echo(f"debug={debug}")311-312- if __name__ == '__main__':313- log()314-315-.. versionchanged:: 6.0316-317-If you want to define an alias for the second option only, then you will318-need to use leading whitespace to disambiguate the format string:319-320-Example:321-322-.. click:example::323-324- import sys325-326- @click.command()327- @click.option('--shout/--no-shout', ' /-S', default=False)328- def info(shout):329- rv = sys.platform330- if shout:331- rv = rv.upper() + '!!!!111'332- click.echo(rv)333-334-.. click:run::335-336- invoke(info, args=['--help'])337-338-Feature Switches339-----------------340-341-In addition to boolean flags, there are also feature switches. These are342-implemented by setting multiple options to the same parameter name and343-defining a flag value. Note that by providing the ``flag_value`` parameter,344-Click will implicitly set ``is_flag=True``.345-346-To set a default flag, assign a value of `True` to the flag that should be347-the default.348-349-.. click:example::350-351- import sys352-353- @click.command()354- @click.option('--upper', 'transformation', flag_value='upper',355- default=True)356- @click.option('--lower', 'transformation', flag_value='lower')357- def info(transformation):358- click.echo(getattr(sys.platform, transformation)())359-360-And on the command line:361-362-.. click:run::363-364- invoke(info, args=['--upper'])365- invoke(info, args=['--lower'])366- invoke(info)367-368-.. _choice-opts:369-370-Choice Options371---------------372-373-Sometimes, you want to have a parameter be a choice of a list of values.374-In that case you can use :class:`Choice` type. It can be instantiated375-with a list of valid values. The originally passed choice will be returned,376-not the str passed on the command line. Token normalization functions and377-``case_sensitive=False`` can cause the two to be different but still match.378-379-Example:380-381-.. click:example::382-383- @click.command()384- @click.option('--hash-type',385- type=click.Choice(['MD5', 'SHA1'], case_sensitive=False))386- def digest(hash_type):387- click.echo(hash_type)388-389-What it looks like:390-391-.. click:run::392-393- invoke(digest, args=['--hash-type=MD5'])394- println()395- invoke(digest, args=['--hash-type=md5'])396- println()397- invoke(digest, args=['--hash-type=foo'])398- println()399- invoke(digest, args=['--help'])400-401-Only pass the choices as list or tuple. Other iterables (like402-generators) may lead to unexpected results.403-404-Choices work with options that have ``multiple=True``. If a ``default``405-value is given with ``multiple=True``, it should be a list or tuple of406-valid choices.407-408-Choices should be unique after considering the effects of409-``case_sensitive`` and any specified token normalization function.410-411-.. versionchanged:: 7.1412- The resulting value from an option will always be one of the413- originally passed choices regardless of ``case_sensitive``.414-415-.. _option-prompting:416-417-Prompting418----------419-420-In some cases, you want parameters that can be provided from the command line,421-but if not provided, ask for user input instead. This can be implemented with422-Click by defining a prompt string.423-424-Example:425-426-.. click:example::427-428- @click.command()429- @click.option('--name', prompt=True)430- def hello(name):431- click.echo(f"Hello {name}!")432-433-And what it looks like:434-435-.. click:run::436-437- invoke(hello, args=['--name=John'])438- invoke(hello, input=['John'])439-440-If you are not happy with the default prompt string, you can ask for441-a different one:442-443-.. click:example::444-445- @click.command()446- @click.option('--name', prompt='Your name please')447- def hello(name):448- click.echo(f"Hello {name}!")449-450-What it looks like:451-452-.. click:run::453-454- invoke(hello, input=['John'])455-456-It is advised that prompt not be used in conjunction with the multiple457-flag set to True. Instead, prompt in the function interactively.458-459-By default, the user will be prompted for an input if one was not passed460-through the command line. To turn this behavior off, see461-:ref:`optional-value`.462-463-464-Password Prompts465-----------------466-467-Click also supports hidden prompts and asking for confirmation. This is468-useful for password input:469-470-.. click:example::471-472- import codecs473-474- @click.command()475- @click.option(476- "--password", prompt=True, hide_input=True,477- confirmation_prompt=True478- )479- def encode(password):480- click.echo(f"encoded: {codecs.encode(password, 'rot13')}")481-482-.. click:run::483-484- invoke(encode, input=['secret', 'secret'])485-486-Because this combination of parameters is quite common, this can also be487-replaced with the :func:`password_option` decorator:488-489-.. code-block:: python490-491- @click.command()492- @click.password_option()493- def encrypt(password):494- click.echo(f"encoded: to {codecs.encode(password, 'rot13')}")495-496-497-Dynamic Defaults for Prompts498-----------------------------499-500-The ``auto_envvar_prefix`` and ``default_map`` options for the context501-allow the program to read option values from the environment or a502-configuration file. However, this overrides the prompting mechanism, so503-that the user does not get the option to change the value interactively.504-505-If you want to let the user configure the default value, but still be506-prompted if the option isn't specified on the command line, you can do so507-by supplying a callable as the default value. For example, to get a default508-from the environment:509-510-.. code-block:: python511-512- import os513-514- @click.command()515- @click.option(516- "--username", prompt=True,517- default=lambda: os.environ.get("USER", "")518- )519- def hello(username):520- click.echo(f"Hello, {username}!")521-522-To describe what the default value will be, set it in ``show_default``.523-524-.. click:example::525-526- import os527-528- @click.command()529- @click.option(530- "--username", prompt=True,531- default=lambda: os.environ.get("USER", ""),532- show_default="current user"533- )534- def hello(username):535- click.echo(f"Hello, {username}!")536-537-.. click:run::538-539- invoke(hello, args=["--help"])540-541-542-Callbacks and Eager Options543----------------------------544-545-Sometimes, you want a parameter to completely change the execution flow.546-For instance, this is the case when you want to have a ``--version``547-parameter that prints out the version and then exits the application.548-549-Note: an actual implementation of a ``--version`` parameter that is550-reusable is available in Click as :func:`click.version_option`. The code551-here is merely an example of how to implement such a flag.552-553-In such cases, you need two concepts: eager parameters and a callback. An554-eager parameter is a parameter that is handled before others, and a555-callback is what executes after the parameter is handled. The eagerness556-is necessary so that an earlier required parameter does not produce an557-error message. For instance, if ``--version`` was not eager and a558-parameter ``--foo`` was required and defined before, you would need to559-specify it for ``--version`` to work. For more information, see560-:ref:`callback-evaluation-order`.561-562-A callback is a function that is invoked with three parameters: the563-current :class:`Context`, the current :class:`Parameter`, and the value.564-The context provides some useful features such as quitting the565-application and gives access to other already processed parameters.566-567-Here's an example for a ``--version`` flag:568-569-.. click:example::570-571- def print_version(ctx, param, value):572- if not value or ctx.resilient_parsing:573- return574- click.echo('Version 1.0')575- ctx.exit()576-577- @click.command()578- @click.option('--version', is_flag=True, callback=print_version,579- expose_value=False, is_eager=True)580- def hello():581- click.echo('Hello World!')582-583-The `expose_value` parameter prevents the pretty pointless ``version``584-parameter from being passed to the callback. If that was not specified, a585-boolean would be passed to the `hello` script. The `resilient_parsing`586-flag is applied to the context if Click wants to parse the command line587-without any destructive behavior that would change the execution flow. In588-this case, because we would exit the program, we instead do nothing.589-590-What it looks like:591-592-.. click:run::593-594- invoke(hello)595- invoke(hello, args=['--version'])596-597-598-Yes Parameters599---------------600-601-For dangerous operations, it's very useful to be able to ask a user for602-confirmation. This can be done by adding a boolean ``--yes`` flag and603-asking for confirmation if the user did not provide it and to fail in a604-callback:605-606-.. click:example::607-608- def abort_if_false(ctx, param, value):609- if not value:610- ctx.abort()611-612- @click.command()613- @click.option('--yes', is_flag=True, callback=abort_if_false,614- expose_value=False,615- prompt='Are you sure you want to drop the db?')616- def dropdb():617- click.echo('Dropped all tables!')618-619-And what it looks like on the command line:620-621-.. click:run::622-623- invoke(dropdb, input=['n'])624- invoke(dropdb, args=['--yes'])625-626-Because this combination of parameters is quite common, this can also be627-replaced with the :func:`confirmation_option` decorator:628-629-.. click:example::630-631- @click.command()632- @click.confirmation_option(prompt='Are you sure you want to drop the db?')633- def dropdb():634- click.echo('Dropped all tables!')635-636-637-Values from Environment Variables638----------------------------------639-640-A very useful feature of Click is the ability to accept parameters from641-environment variables in addition to regular parameters. This allows642-tools to be automated much easier. For instance, you might want to pass643-a configuration file with a ``--config`` parameter but also support exporting644-a ``TOOL_CONFIG=hello.cfg`` key-value pair for a nicer development645-experience.646-647-This is supported by Click in two ways. One is to automatically build648-environment variables which is supported for options only. To enable this649-feature, the ``auto_envvar_prefix`` parameter needs to be passed to the650-script that is invoked. Each command and parameter is then added as an651-uppercase underscore-separated variable. If you have a subcommand652-called ``run`` taking an option called ``reload`` and the prefix is653-``WEB``, then the variable is ``WEB_RUN_RELOAD``.654-655-Example usage:656-657-.. click:example::658-659- @click.command()660- @click.option('--username')661- def greet(username):662- click.echo(f'Hello {username}!')663-664- if __name__ == '__main__':665- greet(auto_envvar_prefix='GREETER')666-667-And from the command line:668-669-.. click:run::670-671- invoke(greet, env={'GREETER_USERNAME': 'john'},672- auto_envvar_prefix='GREETER')673-674-When using ``auto_envvar_prefix`` with command groups, the command name675-needs to be included in the environment variable, between the prefix and676-the parameter name, *i.e.* ``PREFIX_COMMAND_VARIABLE``. If you have a677-subcommand called ``run-server`` taking an option called ``host`` and678-the prefix is ``WEB``, then the variable is ``WEB_RUN_SERVER_HOST``.679-680-Example:681-682-.. click:example::683-684- @click.group()685- @click.option('--debug/--no-debug')686- def cli(debug):687- click.echo(f"Debug mode is {'on' if debug else 'off'}")688-689- @cli.command()690- @click.option('--username')691- def greet(username):692- click.echo(f"Hello {username}!")693-694- if __name__ == '__main__':695- cli(auto_envvar_prefix='GREETER')696-697-.. click:run::698-699- invoke(cli, args=['greet',],700- env={'GREETER_GREET_USERNAME': 'John', 'GREETER_DEBUG': 'false'},701- auto_envvar_prefix='GREETER')702-703-704-The second option is to manually pull values in from specific environment705-variables by defining the name of the environment variable on the option.706-707-Example usage:708-709-.. click:example::710-711- @click.command()712- @click.option('--username', envvar='USERNAME')713- def greet(username):714- click.echo(f"Hello {username}!")715-716- if __name__ == '__main__':717- greet()718-719-And from the command line:720-721-.. click:run::722-723- invoke(greet, env={'USERNAME': 'john'})724-725-In that case it can also be a list of different environment variables726-where the first one is picked.727-728-Multiple Values from Environment Values729----------------------------------------730-731-As options can accept multiple values, pulling in such values from732-environment variables (which are strings) is a bit more complex. The way733-Click solves this is by leaving it up to the type to customize this734-behavior. For both ``multiple`` and ``nargs`` with values other than735-``1``, Click will invoke the :meth:`ParamType.split_envvar_value` method to736-perform the splitting.737-738-The default implementation for all types is to split on whitespace. The739-exceptions to this rule are the :class:`File` and :class:`Path` types740-which both split according to the operating system's path splitting rules.741-On Unix systems like Linux and OS X, the splitting happens for those on742-every colon (``:``), and for Windows, on every semicolon (``;``).743-744-Example usage:745-746-.. click:example::747-748- @click.command()749- @click.option('paths', '--path', envvar='PATHS', multiple=True,750- type=click.Path())751- def perform(paths):752- for path in paths:753- click.echo(path)754-755- if __name__ == '__main__':756- perform()757-758-And from the command line:759-760-.. click:run::761-762- import os763- invoke(perform, env={"PATHS": f"./foo/bar{os.path.pathsep}./test"})764-765-Other Prefix Characters766------------------------767-768-Click can deal with alternative prefix characters other than ``-`` for769-options. This is for instance useful if you want to handle slashes as770-parameters ``/`` or something similar. Note that this is strongly771-discouraged in general because Click wants developers to stay close to772-POSIX semantics. However in certain situations this can be useful:773-774-.. click:example::775-776- @click.command()777- @click.option('+w/-w')778- def chmod(w):779- click.echo(f"writable={w}")780-781- if __name__ == '__main__':782- chmod()783-784-And from the command line:785-786-.. click:run::787-788- invoke(chmod, args=['+w'])789- invoke(chmod, args=['-w'])790-791-Note that if you are using ``/`` as prefix character and you want to use a792-boolean flag you need to separate it with ``;`` instead of ``/``:793-794-.. click:example::795-796- @click.command()797- @click.option('/debug;/no-debug')798- def log(debug):799- click.echo(f"debug={debug}")800-801- if __name__ == '__main__':802- log()803-804-.. _ranges:805-806-Range Options807--------------808-809-The :class:`IntRange` type extends the :data:`INT` type to ensure the810-value is contained in the given range. The :class:`FloatRange` type does811-the same for :data:`FLOAT`.812-813-If ``min`` or ``max`` is omitted, that side is *unbounded*. Any value in814-that direction is accepted. By default, both bounds are *closed*, which815-means the boundary value is included in the accepted range. ``min_open``816-and ``max_open`` can be used to exclude that boundary from the range.817-818-If ``clamp`` mode is enabled, a value that is outside the range is set819-to the boundary instead of failing. For example, the range ``0, 5``820-would return ``5`` for the value ``10``, or ``0`` for the value ``-1``.821-When using :class:`FloatRange`, ``clamp`` can only be enabled if both822-bounds are *closed* (the default).823-824-.. click:example::825-826- @click.command()827- @click.option("--count", type=click.IntRange(0, 20, clamp=True))828- @click.option("--digit", type=click.IntRange(0, 9))829- def repeat(count, digit):830- click.echo(str(digit) * count)831-832-.. click:run::833-834- invoke(repeat, args=['--count=100', '--digit=5'])835- invoke(repeat, args=['--count=6', '--digit=12'])836-837-838-Callbacks for Validation839-------------------------840-841-.. versionchanged:: 2.0842-843-If you want to apply custom validation logic, you can do this in the844-parameter callbacks. These callbacks can both modify values as well as845-raise errors if the validation does not work. The callback runs after846-type conversion. It is called for all sources, including prompts.847-848-In Click 1.0, you can only raise the :exc:`UsageError` but starting with849-Click 2.0, you can also raise the :exc:`BadParameter` error, which has the850-added advantage that it will automatically format the error message to851-also contain the parameter name.852-853-.. click:example::854-855- def validate_rolls(ctx, param, value):856- if isinstance(value, tuple):857- return value858-859- try:860- rolls, _, dice = value.partition("d")861- return int(dice), int(rolls)862- except ValueError:863- raise click.BadParameter("format must be 'NdM'")864-865- @click.command()866- @click.option(867- "--rolls", type=click.UNPROCESSED, callback=validate_rolls,868- default="1d6", prompt=True,869- )870- def roll(rolls):871- sides, times = rolls872- click.echo(f"Rolling a {sides}-sided dice {times} time(s)")873-874-.. click:run::875-876- invoke(roll, args=["--rolls=42"])877- println()878- invoke(roll, args=["--rolls=2d12"])879- println()880- invoke(roll, input=["42", "2d12"])881-882-883-.. _optional-value:884-885-Optional Value886---------------887-888-Providing the value to an option can be made optional, in which case889-providing only the option's flag without a value will either show a890-prompt or use its ``flag_value``.891-892-Setting ``is_flag=False, flag_value=value`` tells Click that the option893-can still be passed a value, but if only the flag is given the894-``flag_value`` is used.895-896-.. click:example::897-898- @click.command()899- @click.option("--name", is_flag=False, flag_value="Flag", default="Default")900- def hello(name):901- click.echo(f"Hello, {name}!")902-903-.. click:run::904-905- invoke(hello, args=[])906- invoke(hello, args=["--name", "Value"])907- invoke(hello, args=["--name"])908-909-If the option has ``prompt`` enabled, then setting910-``prompt_required=False`` tells Click to only show the prompt if the911-option's flag is given, instead of if the option is not provided at all.912-913-.. click:example::914-915- @click.command()916- @click.option('--name', prompt=True, prompt_required=False, default="Default")917- def hello(name):918- click.echo(f"Hello {name}!")919-920-.. click:run::921-922- invoke(hello)923- invoke(hello, args=["--name", "Value"])924- invoke(hello, args=["--name"], input="Prompt")925-926-If ``required=True``, then the option will still prompt if it is not927-given, but it will also prompt if only the flag is given.added:docs/parameter-types.rst+181 added
1+.. _parameter-types:2+3+Parameter Types4+==================5+6+.. currentmodule:: click7+8+When the parameter type is set using ``type``, Click will leverage the type to make your life easier, for example adding data to your help pages. Most examples are done with options, but types are available to options and arguments.9+10+.. contents::11+ :depth: 212+ :local:13+14+Built-in Types Examples15+------------------------16+17+.. _choice-opts:18+19+Choice20+^^^^^^^^^^^^^^^^^^^^^^21+22+Sometimes, you want to have a parameter be a choice of a list of values.23+In that case you can use :class:`Choice` type. It can be instantiated24+with a list of valid values. The originally passed choice will be returned,25+not the str passed on the command line. Token normalization functions and26+``case_sensitive=False`` can cause the two to be different but still match.27+:meth:`Choice.normalize_choice` for more info.28+29+Example:30+31+.. click:example::32+33+ import enum34+35+ class HashType(enum.Enum):36+ MD5 = enum.auto()37+ SHA1 = enum.auto()38+39+ @click.command()40+ @click.option('--hash-type',41+ type=click.Choice(HashType, case_sensitive=False))42+ def digest(hash_type: HashType):43+ click.echo(hash_type)44+45+What it looks like:46+47+.. click:run::48+49+ invoke(digest, args=['--hash-type=MD5'])50+ println()51+ invoke(digest, args=['--hash-type=md5'])52+ println()53+ invoke(digest, args=['--hash-type=foo'])54+ println()55+ invoke(digest, args=['--help'])56+57+Any iterable may be passed to :class:`Choice`. If an ``Enum`` is passed, the58+names of the enum members will be used as valid choices.59+60+Choices work with options that have ``multiple=True``. If a ``default``61+value is given with ``multiple=True``, it should be a list or tuple of62+valid choices.63+64+Choices should be unique after normalization, see65+:meth:`Choice.normalize_choice` for more info.66+67+.. versionchanged:: 7.168+ The resulting value from an option will always be one of the69+ originally passed choices regardless of ``case_sensitive``.70+71+.. _ranges:72+73+Int and Float Ranges74+^^^^^^^^^^^^^^^^^^^^^^^75+76+The :class:`IntRange` type extends the :data:`INT` type to ensure the77+value is contained in the given range. The :class:`FloatRange` type does78+the same for :data:`FLOAT`.79+80+If ``min`` or ``max`` is omitted, that side is *unbounded*. Any value in81+that direction is accepted. By default, both bounds are *closed*, which82+means the boundary value is included in the accepted range. ``min_open``83+and ``max_open`` can be used to exclude that boundary from the range.84+85+If ``clamp`` mode is enabled, a value that is outside the range is set86+to the boundary instead of failing. For example, the range ``0, 5``87+would return ``5`` for the value ``10``, or ``0`` for the value ``-1``.88+When using :class:`FloatRange`, ``clamp`` can only be enabled if both89+bounds are *closed* (the default).90+91+.. click:example::92+93+ @click.command()94+ @click.option("--count", type=click.IntRange(0, 20, clamp=True))95+ @click.option("--digit", type=click.IntRange(0, 9))96+ def repeat(count, digit):97+ click.echo(str(digit) * count)98+99+.. click:run::100+101+ invoke(repeat, args=['--count=100', '--digit=5'])102+ invoke(repeat, args=['--count=6', '--digit=12'])103+104+105+Built-in Types Listing106+-----------------------107+The supported parameter :ref:`click-api-types` are:108+109+* ``str`` / :data:`click.STRING`: The default parameter type which indicates unicode strings.110+111+* ``int`` / :data:`click.INT`: A parameter that only accepts integers.112+113+* ``float`` / :data:`click.FLOAT`: A parameter that only accepts floating point values.114+115+* ``bool`` / :data:`click.BOOL`: A parameter that accepts boolean values. This is automatically used116+ for boolean flags. The string values "1", "true", "t", "yes", "y",117+ and "on" convert to ``True``. "0", "false", "f", "no", "n", and118+ "off" convert to ``False``.119+120+* :data:`click.UUID`:121+ A parameter that accepts UUID values. This is not automatically122+ guessed but represented as :class:`uuid.UUID`.123+124+* .. autoclass:: Choice125+ :noindex:126+127+* .. autoclass:: DateTime128+ :noindex:129+130+* .. autoclass:: File131+ :noindex:132+133+* .. autoclass:: FloatRange134+ :noindex:135+136+* .. autoclass:: IntRange137+ :noindex:138+139+* .. autoclass:: Path140+ :noindex:141+142+How to Implement Custom Types143+-------------------------------144+145+To implement a custom type, you need to subclass the :class:`ParamType` class. For simple cases, passing a Python function that fails with a `ValueError` is also supported, though discouraged. Override the :meth:`~ParamType.convert` method to convert the value from a string to the correct type.146+147+The following code implements an integer type that accepts hex and octal148+numbers in addition to normal integers, and converts them into regular149+integers.150+151+.. code-block:: python152+153+ import click154+155+ class BasedIntParamType(click.ParamType):156+ name = "integer"157+158+ def convert(self, value, param, ctx):159+ if isinstance(value, int):160+ return value161+162+ try:163+ if value[:2].lower() == "0x":164+ return int(value[2:], 16)165+ elif value[:1] == "0":166+ return int(value, 8)167+ return int(value, 10)168+ except ValueError:169+ self.fail(f"{value!r} is not a valid integer", param, ctx)170+171+ BASED_INT = BasedIntParamType()172+173+The :attr:`~ParamType.name` attribute is optional and is used for174+documentation. Call :meth:`~ParamType.fail` if conversion fails. The175+``param`` and ``ctx`` arguments may be ``None`` in some cases such as176+prompts.177+178+Values from user input or the command line will be strings, but default179+values and Python arguments may already be the correct type. The custom180+type should check at the top if the value is already valid and pass it181+through to support those cases.added:docs/parameters.md+55 added
1+(parameters)=2+3+# Parameters4+5+```{currentmodule} click6+```7+8+Click supports only two principle types of parameters for scripts (by design): options and arguments.9+10+## Options11+12+- Are optional.13+- Recommended to use for everything except subcommands, urls, or files.14+- Can take a fixed number of arguments. The default is 1. They may be specified multiple times using {ref}`multiple-options`.15+- Are fully documented by the help page.16+- Have automatic prompting for missing input.17+- Can act as flags (boolean or otherwise).18+- Can be pulled from environment variables.19+20+## Arguments21+22+- Are optional with in reason, but not entirely so.23+- Recommended to use for subcommands, urls, or files.24+- Can take an arbitrary number of arguments.25+- Are not fully documented by the help page since they may be too specific to be automatically documented. For more see {ref}`documenting-arguments`.26+- Can be pulled from environment variables but only explicitly named ones. For more see {ref}`environment-variables`.27+28+On each principle type you can specify {ref}`parameter-types`. Specifying these types helps Click add details to your help pages and help with the handling of those types.29+30+(parameter-names)=31+32+## Parameter Names33+34+Parameters (options and arguments) have a name that will be used as35+the Python argument name when calling the decorated function with36+values.37+38+In the example, the argument's name is `filename`. The name must match the python arg name. To provide a different name for use in help text, see {ref}`doc-meta-variables`.39+The option's names are `-t` and `--times`. More names are available for options and are covered in {ref}`options`.40+41+```{eval-rst}42+.. click:example::43+44+ @click.command()45+ @click.argument('filename')46+ @click.option('-t', '--times', type=int)47+ def multi_echo(filename, times):48+ """Print value filename multiple times."""49+ for x in range(times):50+ click.echo(filename)51+52+.. click:run::53+54+ invoke(multi_echo, ['--times=3', 'index.txt'], prog_name='multi_echo')55+```deleted:docs/parameters.rst-137 removed
1-Parameters2-==========3-4-.. currentmodule:: click5-6-Click supports only two types of parameters for scripts (by design): options and arguments.7-8-Options9-----------------10-11-* Are optional.12-* Recommended to use for everything except subcommands, urls, or files.13-* Can take a fixed number of arguments. The default is 1. They may be specified multiple times using :ref:`multiple-options`.14-* Are fully documented by the help page.15-* Have automatic prompting for missing input.16-* Can act as flags (boolean or otherwise).17-* Can be pulled from environment variables.18-19-Arguments20-----------------21-22-* Are optional with in reason, but not entirely so.23-* Recommended to use for subcommands, urls, or files.24-* Can take an arbitrary number of arguments.25-* Are not fully documented by the help page since they may be too specific to be automatically documented. For more see :ref:`documenting-arguments`.26-* Can be pulled from environment variables but only explicitly named ones. For more see :ref:`environment-variables`.27-28-.. _parameter_names:29-30-Parameter Names31----------------32-33-Parameters (options and arguments) have a name that will be used as34-the Python argument name when calling the decorated function with35-values.36-37-.. click:example::38-39- @click.command()40- @click.argument('filename')41- @click.option('-t', '--times', type=int)42- def multi_echo(filename, times):43- """Print value filename multiple times."""44- for x in range(times):45- click.echo(filename)46-47-In the above example the argument's name is ``filename``. The name must match the python arg name. To provide a different name for use in help text, see :ref:`doc-meta-variables`.48-The option's names are ``-t`` and ``--times``. More names are available for options and are covered in :ref:`options`.49-50-And what it looks like when run:51-52-.. click:run::53-54- invoke(multi_echo, ['--times=3', 'index.txt'], prog_name='multi_echo')55-56-Parameter Types57----------------58-59-The supported parameter types are:60-61-``str`` / :data:`click.STRING`:62- The default parameter type which indicates unicode strings.63-64-``int`` / :data:`click.INT`:65- A parameter that only accepts integers.66-67-``float`` / :data:`click.FLOAT`:68- A parameter that only accepts floating point values.69-70-``bool`` / :data:`click.BOOL`:71- A parameter that accepts boolean values. This is automatically used72- for boolean flags. The string values "1", "true", "t", "yes", "y",73- and "on" convert to ``True``. "0", "false", "f", "no", "n", and74- "off" convert to ``False``.75-76-:data:`click.UUID`:77- A parameter that accepts UUID values. This is not automatically78- guessed but represented as :class:`uuid.UUID`.79-80-.. autoclass:: File81- :noindex:82-83-.. autoclass:: Path84- :noindex:85-86-.. autoclass:: Choice87- :noindex:88-89-.. autoclass:: IntRange90- :noindex:91-92-.. autoclass:: FloatRange93- :noindex:94-95-.. autoclass:: DateTime96- :noindex:97-98-How to Implement Custom Types99--------------------------------100-101-To implement a custom type, you need to subclass the :class:`ParamType` class. For simple cases, passing a Python function that fails with a `ValueError` is also supported, though discouraged. Override the :meth:`~ParamType.convert` method to convert the value from a string to the correct type.102-103-The following code implements an integer type that accepts hex and octal104-numbers in addition to normal integers, and converts them into regular105-integers.106-107-.. code-block:: python108-109- import click110-111- class BasedIntParamType(click.ParamType):112- name = "integer"113-114- def convert(self, value, param, ctx):115- if isinstance(value, int):116- return value117-118- try:119- if value[:2].lower() == "0x":120- return int(value[2:], 16)121- elif value[:1] == "0":122- return int(value, 8)123- return int(value, 10)124- except ValueError:125- self.fail(f"{value!r} is not a valid integer", param, ctx)126-127- BASED_INT = BasedIntParamType()128-129-The :attr:`~ParamType.name` attribute is optional and is used for130-documentation. Call :meth:`~ParamType.fail` if conversion fails. The131-``param`` and ``ctx`` arguments may be ``None`` in some cases such as132-prompts.133-134-Values from user input or the command line will be strings, but default135-values and Python arguments may already be the correct type. The custom136-type should check at the top if the value is already valid and pass it137-through to support those cases.modified:docs/prompts.rst+116 added-2 removed
9 unmodified lines10 This can be accomplished with the :func:`prompt` function, which asks for11 valid input according to a type, or the :func:`confirm` function, which asks12 for confirmation (yes/no).13 14+.. contents::15+ :depth: 216+ :local:17+18+.. _option-prompting:19+20 Option Prompts21 --------------22 17-Option prompts are integrated into the option interface. See18-:ref:`option-prompting` for more information. Internally, it23+Option prompts are integrated into the option interface. Internally, it24 automatically calls either :func:`prompt` or :func:`confirm` as necessary.25 26+In some cases, you want parameters that can be provided from the command line,27+but if not provided, ask for user input instead. This can be implemented with28+Click by defining a prompt string.29+30+Example:31+32+.. click:example::33+34+ @click.command()35+ @click.option('--name', prompt=True)36+ def hello(name):37+ click.echo(f"Hello {name}!")38+39+And what it looks like:40+41+.. click:run::42+43+ invoke(hello, args=['--name=John'])44+ invoke(hello, input=['John'])45+46+If you are not happy with the default prompt string, you can ask for47+a different one:48+49+.. click:example::50+51+ @click.command()52+ @click.option('--name', prompt='Your name please')53+ def hello(name):54+ click.echo(f"Hello {name}!")55+56+What it looks like:57+58+.. click:run::59+60+ invoke(hello, input=['John'])61+62+It is advised that prompt not be used in conjunction with the multiple63+flag set to True. Instead, prompt in the function interactively.64+65+By default, the user will be prompted for an input if one was not passed66+through the command line. To turn this behavior off, see67+:ref:`optional-value`.68+69 Input Prompts70 -------------71 72 To manually ask for user input, you can use the :func:`prompt` function.6 unmodified lines79 provided. For instance, the following will only accept floats::80 81 value = click.prompt('Please enter a number', default=42.0)82 83+Optional Prompts84+------------------85+If the option has ``prompt`` enabled, then setting86+``prompt_required=False`` tells Click to only show the prompt if the87+option's flag is given, instead of if the option is not provided at all.88+89+.. click:example::90+91+ @click.command()92+ @click.option('--name', prompt=True, prompt_required=False, default="Default")93+ def hello(name):94+ click.echo(f"Hello {name}!")95+96+.. click:run::97+98+ invoke(hello)99+ invoke(hello, args=["--name", "Value"])100+ invoke(hello, args=["--name"], input="Prompt")101+102+If ``required=True``, then the option will still prompt if it is not103+given, but it will also prompt if only the flag is given.104+105 Confirmation Prompts106 --------------------107 108 To ask if a user wants to continue with an action, the :func:`confirm`6 unmodified lines115 There is also the option to make the function automatically abort the116 execution of the program if it does not return ``True``::117 118 click.confirm('Do you want to continue?', abort=True)119+120+Dynamic Defaults for Prompts121+----------------------------122+123+The ``auto_envvar_prefix`` and ``default_map`` options for the context124+allow the program to read option values from the environment or a125+configuration file. However, this overrides the prompting mechanism, so126+that the user does not get the option to change the value interactively.127+128+If you want to let the user configure the default value, but still be129+prompted if the option isn't specified on the command line, you can do so130+by supplying a callable as the default value. For example, to get a default131+from the environment:132+133+.. code-block:: python134+135+ import os136+137+ @click.command()138+ @click.option(139+ "--username", prompt=True,140+ default=lambda: os.environ.get("USER", "")141+ )142+ def hello(username):143+ click.echo(f"Hello, {username}!")144+145+To describe what the default value will be, set it in ``show_default``.146+147+.. click:example::148+149+ import os150+151+ @click.command()152+ @click.option(153+ "--username", prompt=True,154+ default=lambda: os.environ.get("USER", ""),155+ show_default="current user"156+ )157+ def hello(username):158+ click.echo(f"Hello, {username}!")159+160+.. click:run::161+162+ invoke(hello, args=["--help"])added:docs/quickstart.md+196 added
1+# Quickstart2+3+```{currentmodule} click4+```5+6+## Install7+8+Install from PyPI:9+10+```console11+pip install click12+```13+14+Installing into a virtual environment is highly recommended. We suggest {ref}`virtualenv-heading`.15+16+## Examples17+18+Some standalone examples of Click applications are packaged with Click. They are available in the19+[examples folder](https://github.com/pallets/click/tree/main/examples) of the repo.20+21+- [inout](https://github.com/pallets/click/tree/main/examples/inout) : A very simple example of an application that can22+ read from files and write to files and also accept input from stdin or write to stdout.23+- [validation](https://github.com/pallets/click/tree/main/examples/validation) : A simple example of an application that24+ performs custom validation of parameters in different ways.25+- [naval](https://github.com/pallets/click/tree/main/examples/naval) : Port of the [docopt](http://docopt.org/) naval26+ example.27+- [colors](https://github.com/pallets/click/tree/main/examples/colors) : A simple example that colorizes text. Uses28+ colorama on Windows.29+- [aliases](https://github.com/pallets/click/tree/main/examples/aliases) : An advanced example that implements30+ {ref}`aliases`.31+- [imagepipe](https://github.com/pallets/click/tree/main/examples/imagepipe) : A complex example that implements some32+ {ref}`command-pipelines` . It chains together image processing instructions. Requires pillow.33+- [repo](https://github.com/pallets/click/tree/main/examples/repo) : An advanced example that implements a34+ Git-/Mercurial-like command line interface.35+- [complex](https://github.com/pallets/click/tree/main/examples/complex) : A very advanced example that implements36+ loading subcommands dynamically from a plugin folder.37+- [termui](https://github.com/pallets/click/tree/main/examples/termui) : A simple example that showcases terminal UI38+ helpers provided by click.39+40+## Basic Concepts - Creating a Command41+42+Click is based on declaring commands through decorators. Internally, there is a non-decorator interface for advanced use43+cases, but it's discouraged for high-level usage.44+45+A function becomes a Click command line tool by decorating it through {func}`command`. At its simplest, just46+decorating a function with this decorator will make it into a callable script:47+48+49+```{eval-rst}50+.. click:example::51+ import click52+53+ @click.command()54+ def hello():55+ click.echo('Hello World!')56+57+What's happening is that the decorator converts the function into a :class:`Command` which then can be invoked:58+59+.. click:example::60+ if __name__ == '__main__':61+ hello()62+63+And what it looks like:64+65+.. click:run::66+ invoke(hello, args=[], prog_name='python hello.py')67+68+And the corresponding help page:69+70+.. click:run::71+ invoke(hello, args=['--help'], prog_name='python hello.py')72+```73+74+## Echoing75+76+Why does this example use {func}`echo` instead of the regular {func}`print` function? The answer to this question is77+that Click attempts to support different environments consistently and to be very robust even when the environment is78+misconfigured. Click wants to be functional at least on a basic level even if everything is completely broken.79+80+What this means is that the {func}`echo` function applies some error correction in case the terminal is misconfigured81+instead of dying with a {exc}`UnicodeError`.82+83+The echo function also supports color and other styles in output. It will automatically remove styles if the output84+stream is a file. On Windows, colorama is automatically installed and used. See {ref}`ansi-colors`.85+86+If you don't need this, you can also use the `print()` construct / function.87+88+## Nesting Commands89+90+Commands can be attached to other commands of type {class}`Group`. This allows arbitrary nesting of scripts. As an91+example here is a script that implements two commands for managing databases:92+93+```{eval-rst}94+.. click:example::95+ @click.group()96+ def cli():97+ pass98+99+ @click.command()100+ def initdb():101+ click.echo('Initialized the database')102+103+ @click.command()104+ def dropdb():105+ click.echo('Dropped the database')106+107+ cli.add_command(initdb)108+ cli.add_command(dropdb)109+```110+111+As you can see, the {func}`group` decorator works like the {func}`command` decorator, but creates a {class}`Group`112+object instead which can be given multiple subcommands that can be attached with {meth}`Group.add_command`.113+114+For simple scripts, it's also possible to automatically attach and create a command by using the {meth}`Group.command`115+decorator instead. The above script can instead be written like this:116+117+```{eval-rst}118+.. click:example::119+ @click.group()120+ def cli():121+ pass122+123+ @cli.command()124+ def initdb():125+ click.echo('Initialized the database')126+127+ @cli.command()128+ def dropdb():129+ click.echo('Dropped the database')130+131+You would then invoke the :class:`Group` in your entry points or other invocations:132+133+.. click:example::134+ if __name__ == '__main__':135+ cli()136+```137+138+## Registering Commands Later139+140+Instead of using the `@group.command()` decorator, commands can be decorated with the plain `@command()` decorator141+and registered with a group later with `group.add_command()`. This could be used to split commands into multiple Python142+modules.143+144+```{code-block} python145+ @click.command()146+ def greet():147+ click.echo("Hello, World!")148+```149+150+```{code-block} python151+ @click.group()152+ def group():153+ pass154+155+ group.add_command(greet)156+```157+158+## Adding Parameters159+160+To add parameters, use the {func}`option` and {func}`argument` decorators:161+162+```{eval-rst}163+.. click:example::164+ @click.command()165+ @click.option('--count', default=1, help='number of greetings')166+ @click.argument('name')167+ def hello(count, name):168+ for x in range(count):169+ click.echo(f"Hello {name}!")170+171+What it looks like:172+173+.. click:run::174+ invoke(hello, args=['--help'], prog_name='python hello.py')175+```176+177+## Switching to Entry Points178+179+In the code you wrote so far there is a block at the end of the file which looks like this:180+`if __name__ == '__main__':`. This is traditionally how a standalone Python file looks like. With Click you can continue181+doing that, but a better way is to package your app with an entry point.182+183+There are two main (and many more) reasons for this:184+185+The first one is that installers automatically generate executable wrappers for Windows so your command line utilities186+work on Windows too.187+188+The second reason is that entry point scripts work with virtualenv on Unix without the virtualenv having to be189+activated. This is a very useful concept which allows you to bundle your scripts with all requirements into a190+virtualenv.191+192+Click is perfectly equipped to work with that and in fact the rest of the documentation will assume that you are writing193+applications as distributed packages.194+195+Look at the {doc}`entry-points` chapter before reading the rest as the examples assume that you will be using entry196+points.deleted:docs/quickstart.rst-206 removed
1-Quickstart2-==========3-4-.. currentmodule:: click5-6-Install7-----------------------8-Install from PyPI::9-10- pip install click11-12-Installing into a virtual environment is highly recommended. We suggest :ref:`virtualenv-heading`.13-14-Examples15------------------------16-17-Some standalone examples of Click applications are packaged with Click. They are available in the `examples folder <https://github.com/pallets/click/tree/main/examples>`_ of the repo.18-19-* `inout <https://github.com/pallets/click/tree/main/examples/inout>`_ : A very simple example of an application that can read from files and write to files and also accept input from stdin or write to stdout.20-* `validation <https://github.com/pallets/click/tree/main/examples/validation>`_ : A simple example of an application that performs custom validation of parameters in different ways.21-* `naval <https://github.com/pallets/click/tree/main/examples/naval>`_ : Port of the `docopt <http://docopt.org/>`_ naval example.22-* `colors <https://github.com/pallets/click/tree/main/examples/colors>`_ : A simple example that colorizes text. Uses colorama on Windows.23-* `aliases <https://github.com/pallets/click/tree/main/examples/aliases>`_ : An advanced example that implements :ref:`aliases`.24-* `imagepipe <https://github.com/pallets/click/tree/main/examples/imagepipe>`_ : A complex example that implements some :ref:`command-pipelines` . It chains together image processing instructions. Requires pillow.25-* `repo <https://github.com/pallets/click/tree/main/examples/repo>`_ : An advanced example that implements a Git-/Mercurial-like command line interface.26-* `complex <https://github.com/pallets/click/tree/main/examples/complex>`_ : A very advanced example that implements loading subcommands dynamically from a plugin folder.27-* `termui <https://github.com/pallets/click/tree/main/examples/termui>`_ : A simple example that showcases terminal UI helpers provided by click.28-29-Basic Concepts - Creating a Command30------------------------------------31-32-Click is based on declaring commands through decorators. Internally, there33-is a non-decorator interface for advanced use cases, but it's discouraged34-for high-level usage.35-36-A function becomes a Click command line tool by decorating it through37-:func:`click.command`. At its simplest, just decorating a function38-with this decorator will make it into a callable script:39-40-.. click:example::41-42- import click43-44- @click.command()45- def hello():46- click.echo('Hello World!')47-48-What's happening is that the decorator converts the function into a49-:class:`Command` which then can be invoked::50-51- if __name__ == '__main__':52- hello()53-54-And what it looks like:55-56-.. click:run::57-58- invoke(hello, args=[], prog_name='python hello.py')59-60-And the corresponding help page:61-62-.. click:run::63-64- invoke(hello, args=['--help'], prog_name='python hello.py')65-66-Echoing67--------68-69-Why does this example use :func:`echo` instead of the regular70-:func:`print` function? The answer to this question is that Click71-attempts to support different environments consistently and to be very72-robust even when the environment is misconfigured. Click wants to be73-functional at least on a basic level even if everything is completely74-broken.75-76-What this means is that the :func:`echo` function applies some error77-correction in case the terminal is misconfigured instead of dying with a78-:exc:`UnicodeError`.79-80-The echo function also supports color and other styles in output. It81-will automatically remove styles if the output stream is a file. On82-Windows, colorama is automatically installed and used. See83-:ref:`ansi-colors`.84-85-If you don't need this, you can also use the `print()` construct /86-function.87-88-Nesting Commands89-----------------90-91-Commands can be attached to other commands of type :class:`Group`. This92-allows arbitrary nesting of scripts. As an example here is a script that93-implements two commands for managing databases:94-95-.. click:example::96-97- @click.group()98- def cli():99- pass100-101- @click.command()102- def initdb():103- click.echo('Initialized the database')104-105- @click.command()106- def dropdb():107- click.echo('Dropped the database')108-109- cli.add_command(initdb)110- cli.add_command(dropdb)111-112-As you can see, the :func:`group` decorator works like the :func:`command`113-decorator, but creates a :class:`Group` object instead which can be given114-multiple subcommands that can be attached with :meth:`Group.add_command`.115-116-For simple scripts, it's also possible to automatically attach and create a117-command by using the :meth:`Group.command` decorator instead. The above118-script can instead be written like this:119-120-.. click:example::121-122- @click.group()123- def cli():124- pass125-126- @cli.command()127- def initdb():128- click.echo('Initialized the database')129-130- @cli.command()131- def dropdb():132- click.echo('Dropped the database')133-134-You would then invoke the :class:`Group` in your entry points or other invocations::135-136- if __name__ == '__main__':137- cli()138-139-140-Registering Commands Later141---------------------------142-143-Instead of using the ``@group.command()`` decorator, commands can be144-decorated with the plain ``@click.command()`` decorator and registered145-with a group later with ``group.add_command()``. This could be used to146-split commands into multiple Python modules.147-148-.. code-block:: python149-150- @click.command()151- def greet():152- click.echo("Hello, World!")153-154-.. code-block:: python155-156- @click.group()157- def group():158- pass159-160- group.add_command(greet)161-162-163-Adding Parameters164------------------165-166-To add parameters, use the :func:`option` and :func:`argument` decorators:167-168-.. click:example::169-170- @click.command()171- @click.option('--count', default=1, help='number of greetings')172- @click.argument('name')173- def hello(count, name):174- for x in range(count):175- click.echo(f"Hello {name}!")176-177-What it looks like:178-179-.. click:run::180-181- invoke(hello, args=['--help'], prog_name='python hello.py')182-183-Switching to Entry Points184--------------------------185-186-In the code you wrote so far there is a block at the end of the file which187-looks like this: ``if __name__ == '__main__':``. This is traditionally188-how a standalone Python file looks like. With Click you can continue189-doing that, but a better way is to package your app with an entry point.190-191-There are two main (and many more) reasons for this:192-193-The first one is that installers automatically generate executable194-wrappers for Windows so your command line utilities work on Windows too.195-196-The second reason is that entry point scripts work with virtualenv on Unix197-without the virtualenv having to be activated. This is a very useful198-concept which allows you to bundle your scripts with all requirements into199-a virtualenv.200-201-Click is perfectly equipped to work with that and in fact the rest of the202-documentation will assume that you are writing applications as distributed203-packages.204-205-Look at the :doc:`entry-points` chapter before reading the rest as the examples206-assume that you will be using entry points.added:docs/setuptools.md+7 added
1+---2+orphan: true3+---4+5+# Setuptools Integration6+7+Moved to {doc}`entry-points`.deleted:docs/setuptools.rst-6 removed
1-:orphan:2-3-Setuptools Integration4-======================5-6-Moved to :doc:`entry-points`.added:docs/shell-completion.md+249 added
1+(shell-completion)=2+3+# Shell Completion4+5+```{currentmodule} click.shell_completion6+```7+8+Click provides tab completion support for Bash (version 4.4 and up), Zsh, and Fish. It is possible to add support for9+other shells too, and suggestions can be customized at multiple levels.10+11+Shell completion suggests command names, option names, and values for choice, file, and path parameter types. Options12+are only listed if at least a dash has been entered. Hidden commands and options are not shown.13+14+```console15+$ repo <TAB><TAB>16+clone commit copy delete setuser17+$ repo clone -<TAB><TAB>18+--deep --help --rev --shallow -r19+```20+21+## Enabling Completion22+23+Completion is only available if a script is installed and invoked through an entry point, not through the `python`24+command. See {doc}`entry-points`. Once the executable is installed, calling it with a special environment variable will25+put Click in completion mode.26+27+To enable shell completion, the user needs to register a special function with their shell. The exact script varies28+depending on the shell you are using. Click will output it when called with `_{FOO_BAR}_COMPLETE` set to29+`{shell}_source`. `{FOO_BAR}` is the executable name in uppercase with dashes replaced by underscores. It is30+conventional but not strictly required for environment variable names to be in upper case. This convention helps31+distinguish environment variables from regular shell variables and commands, making scripts and configuration files more32+readable and easier to maintain. The built-in shells are `bash`, `zsh`, and `fish`.33+34+Provide your users with the following instructions customized to your program name. This uses `foo-bar` as an example.35+36+```{eval-rst}37+.. tabs::38+39+ .. group-tab:: Bash40+41+ Add this to ``~/.bashrc``:42+43+ .. code-block:: bash44+45+ eval "$(_FOO_BAR_COMPLETE=bash_source foo-bar)"46+47+ .. group-tab:: Zsh48+49+ Add this to ``~/.zshrc``:50+51+ .. code-block:: zsh52+53+ eval "$(_FOO_BAR_COMPLETE=zsh_source foo-bar)"54+55+ .. group-tab:: Fish56+57+ Add this to ``~/.config/fish/completions/foo-bar.fish``:58+59+ .. code-block:: fish60+61+ _FOO_BAR_COMPLETE=fish_source foo-bar | source62+63+ This is the same file used for the activation script method64+ below. For Fish it's probably always easier to use that method.65+```66+67+Using `eval` means that the command is invoked and evaluated every time a shell is started, which can delay shell68+responsiveness. To speed it up, write the generated script to a file, then source that. You can generate the files ahead69+of time and distribute them with your program to save your users a step.70+71+```{eval-rst}72+.. tabs::73+74+ .. group-tab:: Bash75+76+ Save the script somewhere.77+78+ .. code-block:: bash79+80+ _FOO_BAR_COMPLETE=bash_source foo-bar > ~/.foo-bar-complete.bash81+82+ Source the file in ``~/.bashrc``.83+84+ .. code-block:: bash85+86+ . ~/.foo-bar-complete.bash87+88+ .. group-tab:: Zsh89+90+ Save the script somewhere.91+92+ .. code-block:: bash93+94+ _FOO_BAR_COMPLETE=zsh_source foo-bar > ~/.foo-bar-complete.zsh95+96+ Source the file in ``~/.zshrc``.97+98+ .. code-block:: bash99+100+ . ~/.foo-bar-complete.zsh101+102+ .. group-tab:: Fish103+104+ Save the script to ``~/.config/fish/completions/foo-bar.fish``:105+106+ .. code-block:: fish107+108+ _FOO_BAR_COMPLETE=fish_source foo-bar > ~/.config/fish/completions/foo-bar.fish109+```110+111+After modifying the shell config, you need to start a new shell in order for the changes to be loaded.112+113+## Custom Type Completion114+115+When creating a custom {class}`~click.ParamType`, override its {meth}`~click.ParamType.shell_complete` method to provide116+shell completion for parameters with the type. The method must return a list of {class}`~CompletionItem` objects.117+Besides the value, these objects hold metadata that shell support might use. The built-in implementations use `type` to118+indicate special handling for paths, and `help` for shells that support showing a help string next to a suggestion.119+120+In this example, the type will suggest environment variables that start with the incomplete value.121+122+```python123+class EnvVarType(ParamType):124+ name = "envvar"125+126+ def shell_complete(self, ctx, param, incomplete):127+ return [128+ CompletionItem(name)129+ for name in os.environ if name.startswith(incomplete)130+ ]131+132+@click.command()133+@click.option("--ev", type=EnvVarType())134+def cli(ev):135+ click.echo(os.environ[ev])136+```137+138+## Overriding Value Completion139+140+Value completions for a parameter can be customized without a custom type by providing a `shell_complete` function. The141+function is used instead of any completion provided by the type. It is passed 3 keyword arguments:142+143+- `ctx` - The current command context.144+- `param` - The current parameter requesting completion.145+- `incomplete` - The partial word that is being completed. May be an empty string if no characters have been entered146+ yet.147+148+It must return a list of {class}`CompletionItem` objects, or as a shortcut it can return a list of strings.149+150+In this example, the command will suggest environment variables that start with the incomplete value.151+152+```python153+def complete_env_vars(ctx, param, incomplete):154+ return [k for k in os.environ if k.startswith(incomplete)]155+156+@click.command()157+@click.argument("name", shell_complete=complete_env_vars)158+def cli(name):159+ click.echo(f"Name: {name}")160+ click.echo(f"Value: {os.environ[name]}")161+```162+163+## Adding Support for a Shell164+165+Support can be added for shells that do not come built in. Be sure to check PyPI to see if there's already a package166+that adds support for your shell. This topic is very technical, you'll want to look at Click's source to study the167+built-in implementations.168+169+Shell support is provided by subclasses of {class}`ShellComplete` registered with {func}`add_completion_class`. When170+Click is invoked in completion mode, it calls {meth}`~ShellComplete.source` to output the completion script, or171+{meth}`~ShellComplete.complete` to output completions. The base class provides default implementations that require172+implementing some smaller parts.173+174+First, you'll need to figure out how your shell's completion system works and write a script to integrate it with Click.175+It must invoke your program with the environment variable `_{FOO_BAR}_COMPLETE` set to `{shell}_complete` and pass the176+complete args and incomplete value. How it passes those values, and the format of the completion response from Click is177+up to you.178+179+In your subclass, set {attr}`ShellComplete.source_template` to the completion script. The default implementation will180+perform `%` formatting with the following variables:181+182+- `complete_func` - A safe name for the completion function defined in the script.183+- `complete_var` - The environment variable name for passing the `{shell}_complete` instruction.184+- `foo_bar` - The name of the executable being completed.185+186+The example code is for a made up shell "My Shell" or "mysh" for short.187+188+```python189+from click.shell_completion import add_completion_class190+from click.shell_completion import ShellComplete191+192+_mysh_source = """\193+%(complete_func)s {194+ response=$(%(complete_var)s=mysh_complete %(foo_bar)s)195+ # parse response and set completions somehow196+}197+call-on-complete %(foo_bar)s %(complete_func)s198+"""199+200+@add_completion_class201+class MyshComplete(ShellComplete):202+ name = "mysh"203+ source_template = _mysh_source204+```205+206+Next, implement {meth}`~ShellComplete.get_completion_args`. This must get, parse, and return the complete args and207+incomplete value from the completion script. For example, for the Bash implementation the `COMP_WORDS` env var contains208+the command line args as a string, and the `COMP_CWORD` env var contains the index of the incomplete arg. The method209+must return a `(args, incomplete)` tuple.210+211+```python212+import os213+from click.parser import split_arg_string214+215+class MyshComplete(ShellComplete):216+ ...217+218+ def get_completion_args(self):219+ args = split_arg_string(os.environ["COMP_WORDS"])220+221+ if os.environ["COMP_PARTIAL"] == "1":222+ incomplete = args.pop()223+ return args, incomplete224+225+ return args, ""226+```227+228+Finally, implement {meth}`~ShellComplete.format_completion`. This is called to format each {class}`CompletionItem` into a string. For example, the Bash implementation returns `f"{item.type},{item.value}` (it doesn't support help strings), and the Zsh implementation returns each part separated by a newline, replacing empty help with a `_` placeholder. This format is entirely up to what you parse with your completion script.229+230+The `type` value is usually `plain`, but it can be another value that the completion script can switch on. For example,231+`file` or `dir` can tell the shell to handle path completion, since the shell is better at that than Click.232+233+```python234+class MyshComplete(ShellComplete):235+ ...236+237+ def format_completion(self, item):238+ return f"{item.type}\t{item.value}"239+```240+241+With those three things implemented, the new shell support is ready. In case those weren't sufficient, there are more242+parts that can be overridden, but that probably isn't necessary.243+244+The activation instructions will again depend on how your shell works. Use the following to generate the completion245+script, then load it into the shell somehow.246+247+```console248+_FOO_BAR_COMPLETE=mysh_source foo-bar249+```deleted:docs/shell-completion.rst-291 removed
1-.. currentmodule:: click.shell_completion2-3-Shell Completion4-================5-6-Click provides tab completion support for Bash (version 4.4 and up),7-Zsh, and Fish. It is possible to add support for other shells too, and8-suggestions can be customized at multiple levels.9-10-Shell completion suggests command names, option names, and values for11-choice, file, and path parameter types. Options are only listed if at12-least a dash has been entered. Hidden commands and options are not13-shown.14-15-.. code-block:: text16-17- $ repo <TAB><TAB>18- clone commit copy delete setuser19- $ repo clone -<TAB><TAB>20- --deep --help --rev --shallow -r21-22-23-Enabling Completion24--------------------25-26-Completion is only available if a script is installed and invoked27-through an entry point, not through the ``python`` command. See28-:doc:`entry-points`. Once the executable is installed, calling it with29-a special environment variable will put Click in completion mode.30-31-To enable shell completion, the user needs to register a special32-function with their shell. The exact script varies depending on the33-shell you are using. Click will output it when called with34-``_{FOO_BAR}_COMPLETE`` set to ``{shell}_source``. ``{FOO_BAR}`` is35-the executable name in uppercase with dashes replaced by underscores.36-It is conventional but not strictly required for environment variable37-names to be in upper case. This convention helps distinguish environment38-variables from regular shell variables and commands, making scripts39-and configuration files more readable and easier to maintain. The40-built-in shells are ``bash``, ``zsh``, and ``fish``.41-42-Provide your users with the following instructions customized to your43-program name. This uses ``foo-bar`` as an example.44-45-.. tabs::46-47- .. group-tab:: Bash48-49- Add this to ``~/.bashrc``:50-51- .. code-block:: bash52-53- eval "$(_FOO_BAR_COMPLETE=bash_source foo-bar)"54-55- .. group-tab:: Zsh56-57- Add this to ``~/.zshrc``:58-59- .. code-block:: zsh60-61- eval "$(_FOO_BAR_COMPLETE=zsh_source foo-bar)"62-63- .. group-tab:: Fish64-65- Add this to ``~/.config/fish/completions/foo-bar.fish``:66-67- .. code-block:: fish68-69- _FOO_BAR_COMPLETE=fish_source foo-bar | source70-71- This is the same file used for the activation script method72- below. For Fish it's probably always easier to use that method.73-74-Using ``eval`` means that the command is invoked and evaluated every75-time a shell is started, which can delay shell responsiveness. To speed76-it up, write the generated script to a file, then source that. You can77-generate the files ahead of time and distribute them with your program78-to save your users a step.79-80-.. tabs::81-82- .. group-tab:: Bash83-84- Save the script somewhere.85-86- .. code-block:: bash87-88- _FOO_BAR_COMPLETE=bash_source foo-bar > ~/.foo-bar-complete.bash89-90- Source the file in ``~/.bashrc``.91-92- .. code-block:: bash93-94- . ~/.foo-bar-complete.bash95-96- .. group-tab:: Zsh97-98- Save the script somewhere.99-100- .. code-block:: bash101-102- _FOO_BAR_COMPLETE=zsh_source foo-bar > ~/.foo-bar-complete.zsh103-104- Source the file in ``~/.zshrc``.105-106- .. code-block:: bash107-108- . ~/.foo-bar-complete.zsh109-110- .. group-tab:: Fish111-112- Save the script to ``~/.config/fish/completions/foo-bar.fish``:113-114- .. code-block:: fish115-116- _FOO_BAR_COMPLETE=fish_source foo-bar > ~/.config/fish/completions/foo-bar.fish117-118-After modifying the shell config, you need to start a new shell in order119-for the changes to be loaded.120-121-122-Custom Type Completion123-----------------------124-125-When creating a custom :class:`~click.ParamType`, override its126-:meth:`~click.ParamType.shell_complete` method to provide shell127-completion for parameters with the type. The method must return a list128-of :class:`~CompletionItem` objects. Besides the value, these objects129-hold metadata that shell support might use. The built-in implementations130-use ``type`` to indicate special handling for paths, and ``help`` for131-shells that support showing a help string next to a suggestion.132-133-In this example, the type will suggest environment variables that start134-with the incomplete value.135-136-.. code-block:: python137-138- class EnvVarType(ParamType):139- name = "envvar"140-141- def shell_complete(self, ctx, param, incomplete):142- return [143- CompletionItem(name)144- for name in os.environ if name.startswith(incomplete)145- ]146-147- @click.command()148- @click.option("--ev", type=EnvVarType())149- def cli(ev):150- click.echo(os.environ[ev])151-152-153-Overriding Value Completion154----------------------------155-156-Value completions for a parameter can be customized without a custom157-type by providing a ``shell_complete`` function. The function is used158-instead of any completion provided by the type. It is passed 3 keyword159-arguments:160-161-- ``ctx`` - The current command context.162-- ``param`` - The current parameter requesting completion.163-- ``incomplete`` - The partial word that is being completed. May164- be an empty string if no characters have been entered yet.165-166-It must return a list of :class:`CompletionItem` objects, or as a167-shortcut it can return a list of strings.168-169-In this example, the command will suggest environment variables that170-start with the incomplete value.171-172-.. code-block:: python173-174- def complete_env_vars(ctx, param, incomplete):175- return [k for k in os.environ if k.startswith(incomplete)]176-177- @click.command()178- @click.argument("name", shell_complete=complete_env_vars)179- def cli(name):180- click.echo(f"Name: {name}")181- click.echo(f"Value: {os.environ[name]}")182-183-184-Adding Support for a Shell185---------------------------186-187-Support can be added for shells that do not come built in. Be sure to188-check PyPI to see if there's already a package that adds support for189-your shell. This topic is very technical, you'll want to look at Click's190-source to study the built-in implementations.191-192-Shell support is provided by subclasses of :class:`ShellComplete`193-registered with :func:`add_completion_class`. When Click is invoked in194-completion mode, it calls :meth:`~ShellComplete.source` to output the195-completion script, or :meth:`~ShellComplete.complete` to output196-completions. The base class provides default implementations that197-require implementing some smaller parts.198-199-First, you'll need to figure out how your shell's completion system200-works and write a script to integrate it with Click. It must invoke your201-program with the environment variable ``_{FOO_BAR}_COMPLETE`` set to202-``{shell}_complete`` and pass the complete args and incomplete value.203-How it passes those values, and the format of the completion response204-from Click is up to you.205-206-In your subclass, set :attr:`~ShellComplete.source_template` to the207-completion script. The default implementation will perform ``%``208-formatting with the following variables:209-210-- ``complete_func`` - A safe name for the completion function defined211- in the script.212-- ``complete_var`` - The environment variable name for passing the213- ``{shell}_complete`` instruction.214-- ``foo_bar`` - The name of the executable being completed.215-216-The example code is for a made up shell "My Shell" or "mysh" for short.217-218-.. code-block:: python219-220- from click.shell_completion import add_completion_class221- from click.shell_completion import ShellComplete222-223- _mysh_source = """\224- %(complete_func)s {225- response=$(%(complete_var)s=mysh_complete %(foo_bar)s)226- # parse response and set completions somehow227- }228- call-on-complete %(foo_bar)s %(complete_func)s229- """230-231- @add_completion_class232- class MyshComplete(ShellComplete):233- name = "mysh"234- source_template = _mysh_source235-236-Next, implement :meth:`~ShellComplete.get_completion_args`. This must237-get, parse, and return the complete args and incomplete value from the238-completion script. For example, for the Bash implementation the239-``COMP_WORDS`` env var contains the command line args as a string, and240-the ``COMP_CWORD`` env var contains the index of the incomplete arg. The241-method must return a ``(args, incomplete)`` tuple.242-243-.. code-block:: python244-245- import os246- from click.parser import split_arg_string247-248- class MyshComplete(ShellComplete):249- ...250-251- def get_completion_args(self):252- args = split_arg_string(os.environ["COMP_WORDS"])253-254- if os.environ["COMP_PARTIAL"] == "1":255- incomplete = args.pop()256- return args, incomplete257-258- return args, ""259-260-Finally, implement :meth:`~ShellComplete.format_completion`. This is261-called to format each :class:`CompletionItem` into a string. For262-example, the Bash implementation returns ``f"{item.type},{item.value}``263-(it doesn't support help strings), and the Zsh implementation returns264-each part separated by a newline, replacing empty help with a ``_``265-placeholder. This format is entirely up to what you parse with your266-completion script.267-268-The ``type`` value is usually ``plain``, but it can be another value269-that the completion script can switch on. For example, ``file`` or270-``dir`` can tell the shell to handle path completion, since the shell is271-better at that than Click.272-273-.. code-block:: python274-275- class MyshComplete(ShellComplete):276- ...277-278- def format_completion(self, item):279- return f"{item.type}\t{item.value}"280-281-With those three things implemented, the new shell support is ready. In282-case those weren't sufficient, there are more parts that can be283-overridden, but that probably isn't necessary.284-285-The activation instructions will again depend on how your shell works.286-Use the following to generate the completion script, then load it into287-the shell somehow.288-289-.. code-block:: text290-291- _FOO_BAR_COMPLETE=mysh_source foo-baradded:docs/support-multiple-versions.md+62 added
1+# Supporting Multiple Versions2+3+If you are a library maintainer, you may want to support multiple versions of4+Click. See the Pallets [version policy] for information about our version5+numbers and support policy.6+7+[version policy]: https://palletsprojects.com/versions8+9+Most features of Click are stable across releases, and don't require special10+handling. However, feature releases may deprecate and change APIs. Occasionally,11+a change will require special handling.12+13+## Use Feature Detection14+15+Prefer using feature detection. Looking at the version can be tempting, but is16+often more brittle or results in more complicated code. Try to use `if` or `try`17+blocks to decide whether to use a new or old pattern.18+19+If you do need to look at the version, use {func}`importlib.metadata.version`,20+the standardized way to get versions for any installed Python package.21+22+## Changes in 8.223+24+### `ParamType` methods require `ctx`25+26+In 8.2, several methods of `ParamType` now have a `ctx: click.Context`27+argument. Because this changes the signature of the methods from 8.1, it's not28+obvious how to support both when subclassing or calling.29+30+This example uses `ParamType.get_metavar`, and the same technique should be31+applicable to other methods such as `get_missing_message`.32+33+Update your methods overrides to take the new `ctx` argument. Use the34+following decorator to wrap each method. In 8.1, it will get the context where35+possible and pass it using the 8.2 signature.36+37+```python38+import functools39+import typing as t40+import click41+42+F = t.TypeVar("F", bound=t.Callable[..., t.Any])43+44+def add_ctx_arg(f: F) -> F:45+ @functools.wraps(f)46+ def wrapper(*args: t.Any, **kwargs: t.Any) -> t.Any:47+ if "ctx" not in kwargs:48+ kwargs["ctx"] = click.get_current_context(silent=True)49+50+ return f(*args, **kwargs)51+52+ return wrapper # type: ignore[return-value]53+```54+55+Here's an example ``ParamType`` subclass which uses this:56+57+```python58+class CommaDelimitedString(click.ParamType):59+ @add_ctx_arg60+ def get_metavar(self, param: click.Parameter, ctx: click.Context | None) -> str:61+ return "TEXT,TEXT,..."62+```added:docs/testing.md+198 added
1+# Testing Click Applications2+3+```{eval-rst}4+.. currentmodule:: click.testing5+```6+7+Click provides the {ref}`click.testing <testing>` module to help you invoke command line applications and check their behavior.8+9+These tools should only be used for testing since they change10+the entire interpreter state for simplicity. They are not thread-safe!11+12+The examples use [pytest](https://docs.pytest.org/en/stable/) style tests.13+14+```{contents}15+:depth: 116+:local: true17+```18+19+## Basic Example20+21+The key pieces are:22+ - {class}`CliRunner` - used to invoke commands as command line scripts.23+ - {class}`Result` - returned from {meth}`CliRunner.invoke`. Captures output data, exit code, optional exception, and captures the output as bytes and binary data.24+25+```{code-block} python26+:caption: hello.py27+28+import click29+30+@click.command()31+@click.argument('name')32+def hello(name):33+ click.echo(f'Hello {name}!')34+```35+36+```{code-block} python37+:caption: test_hello.py38+39+from click.testing import CliRunner40+from hello import hello41+42+def test_hello_world():43+ runner = CliRunner()44+ result = runner.invoke(hello, ['Peter'])45+ assert result.exit_code == 046+ assert result.output == 'Hello Peter!\n'47+```48+49+## Subcommands50+51+A subcommand name must be specified in the `args` parameter {meth}`CliRunner.invoke`:52+53+```{code-block} python54+:caption: sync.py55+56+import click57+58+@click.group()59+@click.option('--debug/--no-debug', default=False)60+def cli(debug):61+ click.echo(f"Debug mode is {'on' if debug else 'off'}")62+63+@cli.command()64+def sync():65+ click.echo('Syncing')66+```67+68+```{code-block} python69+:caption: test_sync.py70+71+from click.testing import CliRunner72+from sync import cli73+74+def test_sync():75+ runner = CliRunner()76+ result = runner.invoke(cli, ['--debug', 'sync'])77+ assert result.exit_code == 078+ assert 'Debug mode is on' in result.output79+ assert 'Syncing' in result.output80+```81+82+## Context Settings83+84+Additional keyword arguments passed to {meth}`CliRunner.invoke` will be used to construct the initial {class}`Context object <click.Context>`.85+For example, setting a fixed terminal width equal to 60:86+87+```{code-block} python88+:caption: sync.py89+90+import click91+92+@click.group()93+def cli():94+ pass95+96+@cli.command()97+def sync():98+ click.echo('Syncing')99+```100+101+```{code-block} python102+:caption: test_sync.py103+104+from click.testing import CliRunner105+from sync import cli106+107+def test_sync():108+ runner = CliRunner()109+ result = runner.invoke(cli, ['sync'], terminal_width=60)110+ assert result.exit_code == 0111+ assert 'Debug mode is on' in result.output112+ assert 'Syncing' in result.output113+```114+115+## File System Isolation116+117+The {meth}`CliRunner.isolated_filesystem` context manager sets the current working directory to a new, empty folder.118+119+```{code-block} python120+:caption: cat.py121+122+import click123+124+@click.command()125+@click.argument('f', type=click.File())126+def cat(f):127+ click.echo(f.read())128+```129+130+```{code-block} python131+:caption: test_cat.py132+133+from click.testing import CliRunner134+from cat import cat135+136+def test_cat():137+ runner = CliRunner()138+ with runner.isolated_filesystem():139+ with open('hello.txt', 'w') as f:140+ f.write('Hello World!')141+142+ result = runner.invoke(cat, ['hello.txt'])143+ assert result.exit_code == 0144+ assert result.output == 'Hello World!\n'145+```146+147+Pass in a path to control where the temporary directory is created.148+In this case, the directory will not be removed by Click. Its useful149+to integrate with a framework like Pytest that manages temporary files.150+151+```{code-block} python152+:caption: test_cat.py153+154+from click.testing import CliRunner155+from cat import cat156+157+def test_cat_with_path_specified():158+ runner = CliRunner()159+ with runner.isolated_filesystem('~/test_folder'):160+ with open('hello.txt', 'w') as f:161+ f.write('Hello World!')162+163+ result = runner.invoke(cat, ['hello.txt'])164+ assert result.exit_code == 0165+ assert result.output == 'Hello World!\n'166+```167+168+## Input Streams169+170+The test wrapper can provide input data for the input stream (stdin). This is very useful for testing prompts.171+172+```{code-block} python173+:caption: prompt.py174+175+import click176+177+@click.command()178+@click.option('--foo', prompt=True)179+def prompt(foo):180+ click.echo(f"foo={foo}")181+```182+183+```{code-block} python184+:caption: test_prompt.py185+186+from click.testing import CliRunner187+from prompt import prompt188+189+def test_prompts():190+ runner = CliRunner()191+ result = runner.invoke(prompt, input='wau wau\n')192+ assert not result.exception193+ assert result.output == 'Foo: wau wau\nfoo=wau wau\n'194+```195+196+Prompts will be emulated so they write the input data to197+the output stream as well. If hidden input is expected then this198+does not happen.deleted:docs/testing.rst-158 removed
1-Testing Click Applications2-==========================3-4-.. currentmodule:: click.testing5-6-For basic testing, Click provides the :mod:`click.testing` module which7-provides test functionality that helps you invoke command line8-applications and check their behavior.9-10-These tools should really only be used for testing as they change11-the entire interpreter state for simplicity and are not in any way12-thread-safe!13-14-Basic Testing15--------------16-17-The basic functionality for testing Click applications is the18-:class:`CliRunner` which can invoke commands as command line scripts. The19-:meth:`CliRunner.invoke` method runs the command line script in isolation20-and captures the output as both bytes and binary data.21-22-The return value is a :class:`Result` object, which has the captured output23-data, exit code, and optional exception attached:24-25-.. code-block:: python26- :caption: hello.py27-28- import click29-30- @click.command()31- @click.argument('name')32- def hello(name):33- click.echo(f'Hello {name}!')34-35-.. code-block:: python36- :caption: test_hello.py37-38- from click.testing import CliRunner39- from hello import hello40-41- def test_hello_world():42- runner = CliRunner()43- result = runner.invoke(hello, ['Peter'])44- assert result.exit_code == 045- assert result.output == 'Hello Peter!\n'46-47-For subcommand testing, a subcommand name must be specified in the `args` parameter of :meth:`CliRunner.invoke` method:48-49-.. code-block:: python50- :caption: sync.py51-52- import click53-54- @click.group()55- @click.option('--debug/--no-debug', default=False)56- def cli(debug):57- click.echo(f"Debug mode is {'on' if debug else 'off'}")58-59- @cli.command()60- def sync():61- click.echo('Syncing')62-63-.. code-block:: python64- :caption: test_sync.py65-66- from click.testing import CliRunner67- from sync import cli68-69- def test_sync():70- runner = CliRunner()71- result = runner.invoke(cli, ['--debug', 'sync'])72- assert result.exit_code == 073- assert 'Debug mode is on' in result.output74- assert 'Syncing' in result.output75-76-Additional keyword arguments passed to ``.invoke()`` will be used to construct the initial Context object.77-For example, if you want to run your tests against a fixed terminal width you can use the following::78-79- runner = CliRunner()80- result = runner.invoke(cli, ['--debug', 'sync'], terminal_width=60)81-82-File System Isolation83----------------------84-85-For basic command line tools with file system operations, the86-:meth:`CliRunner.isolated_filesystem` method is useful for setting the87-current working directory to a new, empty folder.88-89-.. code-block:: python90- :caption: cat.py91-92- import click93-94- @click.command()95- @click.argument('f', type=click.File())96- def cat(f):97- click.echo(f.read())98-99-.. code-block:: python100- :caption: test_cat.py101-102- from click.testing import CliRunner103- from cat import cat104-105- def test_cat():106- runner = CliRunner()107- with runner.isolated_filesystem():108- with open('hello.txt', 'w') as f:109- f.write('Hello World!')110-111- result = runner.invoke(cat, ['hello.txt'])112- assert result.exit_code == 0113- assert result.output == 'Hello World!\n'114-115-Pass ``temp_dir`` to control where the temporary directory is created.116-The directory will not be removed by Click in this case. This is useful117-to integrate with a framework like Pytest that manages temporary files.118-119-.. code-block:: python120-121- def test_keep_dir(tmp_path):122- runner = CliRunner()123-124- with runner.isolated_filesystem(temp_dir=tmp_path) as td:125- ...126-127-128-Input Streams129--------------130-131-The test wrapper can also be used to provide input data for the input132-stream (stdin). This is very useful for testing prompts, for instance:133-134-.. code-block:: python135- :caption: prompt.py136-137- import click138-139- @click.command()140- @click.option('--foo', prompt=True)141- def prompt(foo):142- click.echo(f"foo={foo}")143-144-.. code-block:: python145- :caption: test_prompt.py146-147- from click.testing import CliRunner148- from prompt import prompt149-150- def test_prompts():151- runner = CliRunner()152- result = runner.invoke(prompt, input='wau wau\n')153- assert not result.exception154- assert result.output == 'Foo: wau wau\nfoo=wau wau\n'155-156-Note that prompts will be emulated so that they write the input data to157-the output stream as well. If hidden input is expected then this158-obviously does not happen.added:docs/unicode-support.md+100 added
1+# Unicode Support2+3+```{currentmodule} click4+```5+6+Click has to take extra care to support Unicode text in different environments.7+8+- The command line in Unix is traditionally bytes, not Unicode. While there are encoding hints, there are some9+ situations where this can break. The most common one is SSH connections to machines with different locales.10+11+ Misconfigured environments can cause a wide range of Unicode problems due to the lack of support for roundtripping12+ surrogate escapes. This will not be fixed in Click itself!13+14+- Standard input and output is opened in text mode by default. Click has to reopen the stream in binary mode in certain15+ situations. Because there is no standard way to do this, it might not always work. Primarily this can become a problem16+ when testing command-line applications.17+18+ This is not supported:19+20+ ```python21+ sys.stdin = io.StringIO('Input here')22+ sys.stdout = io.StringIO()23+ ```24+25+ Instead you need to do this:26+27+ ```python28+ input = 'Input here'29+ in_stream = io.BytesIO(input.encode('utf-8'))30+ sys.stdin = io.TextIOWrapper(in_stream, encoding='utf-8')31+ out_stream = io.BytesIO()32+ sys.stdout = io.TextIOWrapper(out_stream, encoding='utf-8')33+ ```34+35+ Remember in that case, you need to use `out_stream.getvalue()` and not `sys.stdout.getvalue()` if you want to access36+ the buffer contents as the wrapper will not forward that method.37+38+- `sys.stdin`, `sys.stdout` and `sys.stderr` are by default text-based. When Click needs a binary stream, it attempts to39+ discover the underlying binary stream.40+41+- `sys.argv` is always text. This means that the native type for input values to the types in Click is Unicode, not42+ bytes.43+44+ This causes problems if the terminal is incorrectly set and Python does not figure out the encoding. In that case, the45+ Unicode string will contain error bytes encoded as surrogate escapes.46+47+- When dealing with files, Click will always use the Unicode file system API by using the operating system's reported or48+ guessed filesystem encoding. Surrogates are supported for filenames, so it should be possible to open files through49+ the {func}`File` type even if the environment is misconfigured.50+51+## Surrogate Handling52+53+Click does all the Unicode handling in the standard library and is subject to its behavior. Unicode requires extra care.54+The reason for this is that the encoding detection is done in the interpreter, and on Linux and certain other operating55+systems, its encoding handling is problematic.56+57+The biggest source of frustration is that Click scripts invoked by init systems, deployment tools, or cron jobs will58+refuse to work unless a Unicode locale is exported.59+60+If Click encounters such an environment it will prevent further execution to force you to set a locale. This is done61+because Click cannot know about the state of the system once it's invoked and restore the values before Python's Unicode62+handling kicked in.63+64+If you see something like this error:65+66+```console67+Traceback (most recent call last):68+ ...69+RuntimeError: Click will abort further execution because Python was70+ configured to use ASCII as encoding for the environment. Consult71+ https://click.palletsprojects.com/unicode-support/ for mitigation72+ steps.73+```74+75+You are dealing with an environment where Python thinks you are restricted to ASCII data. The solution to these problems76+is different depending on which locale your computer is running in.77+78+For instance, if you have a German Linux machine, you can fix the problem by exporting the locale to `de_DE.utf-8`:79+80+```console81+export LC_ALL=de_DE.utf-882+export LANG=de_DE.utf-883+```84+85+If you are on a US machine, `en_US.utf-8` is the encoding of choice. On some newer Linux systems, you could also try86+`C.UTF-8` as the locale:87+88+```console89+export LC_ALL=C.UTF-890+export LANG=C.UTF-891+```92+93+On some systems it was reported that `UTF-8` has to be written as `UTF8` and vice versa. To see which locales are94+supported you can invoke `locale -a`.95+96+You need to export the values before you invoke your Python script.97+98+In Python 3.7 and later you will no longer get a `RuntimeError` in many cases thanks to {pep}`538` and {pep}`540`, which99+changed the default assumption in unconfigured environments. This doesn't change the general issue that your locale may100+be misconfigured.deleted:docs/unicode-support.rst-112 removed
1-Unicode Support2-===============3-4-.. currentmodule:: click5-6-Click has to take extra care to support Unicode text in different7-environments.8-9-* The command line in Unix is traditionally bytes, not Unicode. While10- there are encoding hints, there are some situations where this can11- break. The most common one is SSH connections to machines with12- different locales.13-14- Misconfigured environments can cause a wide range of Unicode15- problems due to the lack of support for roundtripping surrogate16- escapes. This will not be fixed in Click itself!17-18-* Standard input and output is opened in text mode by default. Click19- has to reopen the stream in binary mode in certain situations.20- Because there is no standard way to do this, it might not always21- work. Primarily this can become a problem when testing command-line22- applications.23-24- This is not supported::25-26- sys.stdin = io.StringIO('Input here')27- sys.stdout = io.StringIO()28-29- Instead you need to do this::30-31- input = 'Input here'32- in_stream = io.BytesIO(input.encode('utf-8'))33- sys.stdin = io.TextIOWrapper(in_stream, encoding='utf-8')34- out_stream = io.BytesIO()35- sys.stdout = io.TextIOWrapper(out_stream, encoding='utf-8')36-37- Remember in that case, you need to use ``out_stream.getvalue()``38- and not ``sys.stdout.getvalue()`` if you want to access the buffer39- contents as the wrapper will not forward that method.40-41-* ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are by default42- text-based. When Click needs a binary stream, it attempts to43- discover the underlying binary stream.44-45-* ``sys.argv`` is always text. This means that the native type for46- input values to the types in Click is Unicode, not bytes.47-48- This causes problems if the terminal is incorrectly set and Python49- does not figure out the encoding. In that case, the Unicode string50- will contain error bytes encoded as surrogate escapes.51-52-* When dealing with files, Click will always use the Unicode file53- system API by using the operating system's reported or guessed54- filesystem encoding. Surrogates are supported for filenames, so it55- should be possible to open files through the :class:`File` type even56- if the environment is misconfigured.57-58-59-Surrogate Handling60-------------------61-62-Click does all the Unicode handling in the standard library and is63-subject to its behavior. Unicode requires extra care. The reason for64-this is that the encoding detection is done in the interpreter, and on65-Linux and certain other operating systems, its encoding handling is66-problematic.67-68-The biggest source of frustration is that Click scripts invoked by init69-systems, deployment tools, or cron jobs will refuse to work unless a70-Unicode locale is exported.71-72-If Click encounters such an environment it will prevent further73-execution to force you to set a locale. This is done because Click74-cannot know about the state of the system once it's invoked and restore75-the values before Python's Unicode handling kicked in.76-77-If you see something like this error::78-79- Traceback (most recent call last):80- ...81- RuntimeError: Click will abort further execution because Python was82- configured to use ASCII as encoding for the environment. Consult83- https://click.palletsprojects.com/unicode-support/ for mitigation84- steps.85-86-You are dealing with an environment where Python thinks you are87-restricted to ASCII data. The solution to these problems is different88-depending on which locale your computer is running in.89-90-For instance, if you have a German Linux machine, you can fix the91-problem by exporting the locale to ``de_DE.utf-8``::92-93- export LC_ALL=de_DE.utf-894- export LANG=de_DE.utf-895-96-If you are on a US machine, ``en_US.utf-8`` is the encoding of choice.97-On some newer Linux systems, you could also try ``C.UTF-8`` as the98-locale::99-100- export LC_ALL=C.UTF-8101- export LANG=C.UTF-8102-103-On some systems it was reported that ``UTF-8`` has to be written as104-``UTF8`` and vice versa. To see which locales are supported you can105-invoke ``locale -a``.106-107-You need to export the values before you invoke your Python script.108-109-In Python 3.7 and later you will no longer get a ``RuntimeError`` in110-many cases thanks to :pep:`538` and :pep:`540`, which changed the111-default assumption in unconfigured environments. This doesn't change the112-general issue that your locale may be misconfigured.added:docs/utils.md+392 added
1+# Utilities2+3+```{currentmodule} click4+```5+6+Besides the functionality that Click provides to interface with argument parsing and handling, it also provides a bunch7+of addon functionality that is useful for writing command line utilities.8+9+## Printing to Stdout10+11+The most obvious helper is the {func}`echo` function, which in many ways works like the Python `print` statement or12+function. The main difference is that it works the same in many different terminal environments.13+14+Example:15+16+```python17+import click18+19+click.echo('Hello World!')20+```21+22+It can output both text and binary data. It will emit a trailing newline by default, which needs to be suppressed by23+passing `nl=False`:24+25+```python26+click.echo(b'\xe2\x98\x83', nl=False)27+```28+29+Last but not least {func}`echo` uses click's intelligent internal output streams to stdout and stderr which support30+unicode output on the Windows console. This means for as long as you are using `click.echo` you can output unicode31+characters (there are some limitations on the default font with regards to which characters can be displayed).32+33+```{versionadded} 6.034+```35+36+Click emulates output streams on Windows to support unicode to the Windows console through separate APIs. For more37+information see {doc}`wincmd`.38+39+```{versionadded} 3.040+```41+42+You can also easily print to standard error by passing `err=True`:43+44+```python45+click.echo('Hello World!', err=True)46+```47+48+(ansi-colors)=49+50+## ANSI Colors51+52+```{versionadded} 2.053+```54+55+The {func}`echo` function supports ANSI colors and styles. On Windows this uses [colorama](https://pypi.org/project/colorama/).56+57+Primarily this means that:58+59+- Click's {func}`echo` function will automatically strip ANSI color codes if the stream is not connected to a terminal.60+- the {func}`echo` function will transparently connect to the terminal on Windows and translate ANSI codes to terminal61+ API calls. This means that colors will work on Windows the same way they do on other operating systems.62+63+On Windows, Click uses colorama without calling `colorama.init()`. You can still call that in your code, but it's not64+required for Click.65+66+For styling a string, the {func}`style` function can be used:67+68+```python69+import click70+71+click.echo(click.style('Hello World!', fg='green'))72+click.echo(click.style('Some more text', bg='blue', fg='white'))73+click.echo(click.style('ATTENTION', blink=True, bold=True))74+```75+76+The combination of {func}`echo` and {func}`style` is also available in a single function called {func}`secho`:77+78+```python79+click.secho('Hello World!', fg='green')80+click.secho('Some more text', bg='blue', fg='white')81+click.secho('ATTENTION', blink=True, bold=True)82+```83+84+## Pager Support85+86+In some situations, you might want to show long texts on the terminal and let a user scroll through it. This can be87+achieved by using the {func}`echo_via_pager` function which works similarly to the {func}`echo` function, but always88+writes to stdout and, if possible, through a pager.89+90+Example:91+92+```{eval-rst}93+.. click:example::94+ @click.command()95+ def less():96+ click.echo_via_pager("\n".join(f"Line {idx}" for idx in range(200)))97+```98+99+If you want to use the pager for a lot of text, especially if generating everything in advance would take a lot of time,100+you can pass a generator (or generator function) instead of a string:101+102+```{eval-rst}103+.. click:example::104+ def _generate_output():105+ for idx in range(50000):106+ yield f"Line {idx}\n"107+108+ @click.command()109+ def less():110+ click.echo_via_pager(_generate_output())111+```112+113+## Screen Clearing114+115+```{versionadded} 2.0116+```117+118+To clear the terminal screen, you can use the {func}`clear` function that is provided starting with Click 2.0. It does119+what the name suggests: it clears the entire visible screen in a platform-agnostic way:120+121+```python122+import click123+click.clear()124+```125+126+## Getting Characters from Terminal127+128+```{versionadded} 2.0129+```130+131+Normally, when reading input from the terminal, you would read from standard input. However, this is buffered input and132+will not show up until the line has been terminated. In certain circumstances, you might not want to do that and instead133+read individual characters as they are being written.134+135+For this, Click provides the {func}`getchar` function which reads a single character from the terminal buffer and136+returns it as a Unicode character.137+138+Note that this function will always read from the terminal, even if stdin is instead a pipe.139+140+Example:141+142+```python143+import click144+145+click.echo('Continue? [yn] ', nl=False)146+c = click.getchar()147+click.echo()148+if c == 'y':149+ click.echo('We will go on')150+elif c == 'n':151+ click.echo('Abort!')152+else:153+ click.echo('Invalid input :(')154+```155+156+Note that this reads raw input, which means that things like arrow keys will show up in the platform's native escape157+format. The only characters translated are `^C` and `^D` which are converted into keyboard interrupts and end of file158+exceptions respectively. This is done because otherwise, it's too easy to forget about that and to create scripts that159+cannot be properly exited.160+161+## Waiting for Key Press162+163+```{versionadded} 2.0164+```165+166+Sometimes, it's useful to pause until the user presses any key on the keyboard. This is especially useful on Windows167+where `cmd.exe` will close the window at the end of the command execution by default, instead of waiting.168+169+In click, this can be accomplished with the {func}`pause` function. This function will print a quick message to the170+terminal (which can be customized) and wait for the user to press a key. In addition to that, it will also become a NOP171+(no operation instruction) if the script is not run interactively.172+173+Example:174+175+```python176+import click177+click.pause()178+```179+180+## Launching Editors181+182+```{versionadded} 2.0183+```184+185+Click supports launching editors automatically through {func}`edit`. This is very useful for asking users for multi-line186+input. It will automatically open the user's defined editor or fall back to a sensible default. If the user closes the187+editor without saving, the return value will be `None`, otherwise the entered text.188+189+Example usage:190+191+```python192+import click193+194+def get_commit_message():195+ MARKER = '# Everything below is ignored\n'196+ message = click.edit('\n\n' + MARKER)197+ if message is not None:198+ return message.split(MARKER, 1)[0].rstrip('\n')199+```200+201+Alternatively, the function can also be used to launch editors for files by a specific filename. In this case, the202+return value is always `None`.203+204+Example usage:205+206+```python207+import click208+click.edit(filename='/etc/passwd')209+```210+211+## Launching Applications212+213+```{versionadded} 2.0214+```215+216+Click supports launching applications through {func}`launch`. This can be used to open the default application217+associated with a URL or filetype. This can be used to launch web browsers or picture viewers, for instance. In addition218+to this, it can also launch the file manager and automatically select the provided file.219+220+Example usage:221+222+```python223+click.launch("https://click.palletsprojects.com/")224+click.launch("/my/downloaded/file.txt", locate=True)225+```226+227+## Printing Filenames228+229+Because filenames might not be Unicode, formatting them can be a bit tricky.230+231+The way this works with click is through the {func}`format_filename` function. It does a best-effort conversion of the232+filename to Unicode and will never fail. This makes it possible to use these filenames in the context of a full Unicode233+string.234+235+Example:236+237+```python238+click.echo(f"Path: {click.format_filename(b'foo.txt')}")239+```240+241+## Standard Streams242+243+For command line utilities, it's very important to get access to input and output streams reliably. Python generally244+provides access to these streams through `sys.stdout` and friends, but unfortunately, there are API differences between245+2.x and 3.x, especially with regards to how these streams respond to Unicode and binary data.246+247+Because of this, click provides the {func}`get_binary_stream` and {func}`get_text_stream` functions, which produce248+consistent results with different Python versions and for a wide variety of terminal configurations.249+250+The end result is that these functions will always return a functional stream object (except in very odd cases; see251+{doc}`/unicode-support`).252+253+Example:254+255+```python256+import click257+258+stdin_text = click.get_text_stream('stdin')259+stdout_binary = click.get_binary_stream('stdout')260+```261+262+```{versionadded} 6.0263+```264+265+Click now emulates output streams on Windows to support unicode to the Windows console through separate APIs. For more266+information see {doc}`wincmd`.267+268+## Intelligent File Opening269+270+```{versionadded} 3.0271+```272+273+Starting with Click 3.0 the logic for opening files from the {func}`File` type is exposed through the {func}`open_file`274+function. It can intelligently open stdin/stdout as well as any other file.275+276+Example:277+278+```python279+import click280+281+stdout = click.open_file('-', 'w')282+test_file = click.open_file('test.txt', 'w')283+```284+285+If stdin or stdout are returned, the return value is wrapped in a special file where the context manager will prevent286+the closing of the file. This makes the handling of standard streams transparent and you can always use it like this:287+288+```python289+with click.open_file(filename, 'w') as f:290+ f.write('Hello World!\n')291+```292+293+## Finding Application Folders294+295+```{versionadded} 2.0296+```297+298+Very often, you want to open a configuration file that belongs to your application. However, different operating systems299+store these configuration files in different locations depending on their standards. Click provides a300+{func}`get_app_dir` function which returns the most appropriate location for per-user config files for your application301+depending on the OS.302+303+Example usage:304+305+```python306+import os307+import click308+import ConfigParser309+310+APP_NAME = 'My Application'311+def read_config():312+cfg = os.path.join(click.get_app_dir(APP_NAME), 'config.ini')313+parser = ConfigParser.RawConfigParser()314+parser.read([cfg])315+rv = {}316+for section in parser.sections():317+ for key, value in parser.items(section):318+ rv[f"{section}.{key}"] = value319+return rv320+```321+322+## Showing Progress Bars323+324+Sometimes, you have command line scripts that need to process a lot of data, but you want to quickly show the user some325+progress about how long that will take. Click supports simple progress bar rendering for that through the326+{func}`progressbar` function.327+328+```{note} If you find that you have requirements beyond what Click's progress bar supports, try using [tqdm](https://tqdm.github.io/).329+```330+331+The basic usage is very simple: the idea is that you have an iterable that you want to operate on. For each item in the332+iterable it might take some time to do processing. So say you have a loop like this:333+334+```python335+for user in all_the_users_to_process:336+ modify_the_user(user)337+```338+339+To hook this up with an automatically updating progress bar, all you need to do is to change the code to this:340+341+```python342+import click343+344+with click.progressbar(all_the_users_to_process) as bar:345+ for user in bar:346+ modify_the_user(user)347+```348+349+Click will then automatically print a progress bar to the terminal and calculate the remaining time for you. The350+calculation of remaining time requires that the iterable has a length. If it does not have a length but you know the351+length, you can explicitly provide it:352+353+```python354+with click.progressbar(all_the_users_to_process,355+ length=number_of_users) as bar:356+ for user in bar:357+ modify_the_user(user)358+```359+360+Note that {func}`progressbar` updates the bar *after* each iteration of the loop. So code like this will render361+correctly:362+363+```python364+import time365+366+with click.progressbar([1, 2, 3]) as bar:367+ for x in bar:368+ print(f"sleep({x})...")369+ time.sleep(x)370+```371+372+Another useful feature is to associate a label with the progress bar which will be shown preceding the progress bar:373+374+```python375+with click.progressbar(all_the_users_to_process,376+ label='Modifying user accounts',377+ length=number_of_users) as bar:378+ for user in bar:379+ modify_the_user(user)380+```381+382+Sometimes, one may need to iterate over an external iterator, and advance the progress bar irregularly. To do so, you383+need to specify the length (and no iterable), and use the update method on the context return value instead of iterating384+directly over it:385+386+```python387+with click.progressbar(length=total_size,388+ label='Unzipping archive') as bar:389+ for archive in zip_file:390+ archive.extract()391+ bar.update(archive.size)392+```deleted:docs/utils.rst-408 removed
1-Utilities2-=========3-4-.. currentmodule:: click5-6-Besides the functionality that Click provides to interface with argument7-parsing and handling, it also provides a bunch of addon functionality that8-is useful for writing command line utilities.9-10-11-Printing to Stdout12-------------------13-14-The most obvious helper is the :func:`echo` function, which in many ways15-works like the Python ``print`` statement or function. The main difference is16-that it works the same in many different terminal environments.17-18-Example::19-20- import click21-22- click.echo('Hello World!')23-24-It can output both text and binary data. It will emit a trailing newline25-by default, which needs to be suppressed by passing ``nl=False``::26-27- click.echo(b'\xe2\x98\x83', nl=False)28-29-Last but not least :func:`echo` uses click's intelligent internal output30-streams to stdout and stderr which support unicode output on the Windows31-console. This means for as long as you are using `click.echo` you can32-output unicode characters (there are some limitations on the default font33-with regards to which characters can be displayed).34-35-.. versionadded:: 6.036-37-Click emulates output streams on Windows to support unicode to the38-Windows console through separate APIs. For more information see39-:doc:`wincmd`.40-41-.. versionadded:: 3.042-43-You can also easily print to standard error by passing ``err=True``::44-45- click.echo('Hello World!', err=True)46-47-48-.. _ansi-colors:49-50-ANSI Colors51------------52-53-.. versionadded:: 2.054-55-The :func:`echo` function supports ANSI colors and styles. On Windows56-this uses `colorama`_.57-58-Primarily this means that:59-60-- Click's :func:`echo` function will automatically strip ANSI color codes61- if the stream is not connected to a terminal.62-- the :func:`echo` function will transparently connect to the terminal on63- Windows and translate ANSI codes to terminal API calls. This means64- that colors will work on Windows the same way they do on other65- operating systems.66-67-On Windows, Click uses colorama without calling ``colorama.init()``. You68-can still call that in your code, but it's not required for Click.69-70-For styling a string, the :func:`style` function can be used::71-72- import click73-74- click.echo(click.style('Hello World!', fg='green'))75- click.echo(click.style('Some more text', bg='blue', fg='white'))76- click.echo(click.style('ATTENTION', blink=True, bold=True))77-78-The combination of :func:`echo` and :func:`style` is also available in79-a single function called :func:`secho`::80-81- click.secho('Hello World!', fg='green')82- click.secho('Some more text', bg='blue', fg='white')83- click.secho('ATTENTION', blink=True, bold=True)84-85-86-.. _colorama: https://pypi.org/project/colorama/87-88-Pager Support89--------------90-91-In some situations, you might want to show long texts on the terminal and92-let a user scroll through it. This can be achieved by using the93-:func:`echo_via_pager` function which works similarly to the :func:`echo`94-function, but always writes to stdout and, if possible, through a pager.95-96-Example:97-98-.. click:example::99-100- @click.command()101- def less():102- click.echo_via_pager("\n".join(f"Line {idx}" for idx in range(200)))103-104-If you want to use the pager for a lot of text, especially if generating everything in advance would take a lot of time, you can pass a generator (or generator function) instead of a string:105-106-.. click:example::107- def _generate_output():108- for idx in range(50000):109- yield f"Line {idx}\n"110-111- @click.command()112- def less():113- click.echo_via_pager(_generate_output())114-115-116-Screen Clearing117----------------118-119-.. versionadded:: 2.0120-121-To clear the terminal screen, you can use the :func:`clear` function that122-is provided starting with Click 2.0. It does what the name suggests: it123-clears the entire visible screen in a platform-agnostic way:124-125-::126-127- import click128- click.clear()129-130-131-Getting Characters from Terminal132---------------------------------133-134-.. versionadded:: 2.0135-136-Normally, when reading input from the terminal, you would read from137-standard input. However, this is buffered input and will not show up until138-the line has been terminated. In certain circumstances, you might not want139-to do that and instead read individual characters as they are being written.140-141-For this, Click provides the :func:`getchar` function which reads a single142-character from the terminal buffer and returns it as a Unicode character.143-144-Note that this function will always read from the terminal, even if stdin145-is instead a pipe.146-147-Example::148-149- import click150-151- click.echo('Continue? [yn] ', nl=False)152- c = click.getchar()153- click.echo()154- if c == 'y':155- click.echo('We will go on')156- elif c == 'n':157- click.echo('Abort!')158- else:159- click.echo('Invalid input :(')160-161-Note that this reads raw input, which means that things like arrow keys162-will show up in the platform's native escape format. The only characters163-translated are ``^C`` and ``^D`` which are converted into keyboard164-interrupts and end of file exceptions respectively. This is done because165-otherwise, it's too easy to forget about that and to create scripts that166-cannot be properly exited.167-168-169-Waiting for Key Press170----------------------171-172-.. versionadded:: 2.0173-174-Sometimes, it's useful to pause until the user presses any key on the175-keyboard. This is especially useful on Windows where ``cmd.exe`` will176-close the window at the end of the command execution by default, instead177-of waiting.178-179-In click, this can be accomplished with the :func:`pause` function. This180-function will print a quick message to the terminal (which can be181-customized) and wait for the user to press a key. In addition to that,182-it will also become a NOP (no operation instruction) if the script is not183-run interactively.184-185-Example::186-187- import click188- click.pause()189-190-191-Launching Editors192------------------193-194-.. versionadded:: 2.0195-196-Click supports launching editors automatically through :func:`edit`. This197-is very useful for asking users for multi-line input. It will198-automatically open the user's defined editor or fall back to a sensible199-default. If the user closes the editor without saving, the return value200-will be ``None``, otherwise the entered text.201-202-Example usage::203-204- import click205-206- def get_commit_message():207- MARKER = '# Everything below is ignored\n'208- message = click.edit('\n\n' + MARKER)209- if message is not None:210- return message.split(MARKER, 1)[0].rstrip('\n')211-212-Alternatively, the function can also be used to launch editors for files by213-a specific filename. In this case, the return value is always `None`.214-215-Example usage::216-217- import click218- click.edit(filename='/etc/passwd')219-220-221-Launching Applications222-----------------------223-224-.. versionadded:: 2.0225-226-Click supports launching applications through :func:`launch`. This can be227-used to open the default application associated with a URL or filetype.228-This can be used to launch web browsers or picture viewers, for instance.229-In addition to this, it can also launch the file manager and automatically230-select the provided file.231-232-Example usage::233-234- click.launch("https://click.palletsprojects.com/")235- click.launch("/my/downloaded/file.txt", locate=True)236-237-238-Printing Filenames239-------------------240-241-Because filenames might not be Unicode, formatting them can be a bit242-tricky.243-244-The way this works with click is through the :func:`format_filename`245-function. It does a best-effort conversion of the filename to Unicode and246-will never fail. This makes it possible to use these filenames in the247-context of a full Unicode string.248-249-Example::250-251- click.echo(f"Path: {click.format_filename(b'foo.txt')}")252-253-254-Standard Streams255-----------------256-257-For command line utilities, it's very important to get access to input and258-output streams reliably. Python generally provides access to these259-streams through ``sys.stdout`` and friends, but unfortunately, there are260-API differences between 2.x and 3.x, especially with regards to how these261-streams respond to Unicode and binary data.262-263-Because of this, click provides the :func:`get_binary_stream` and264-:func:`get_text_stream` functions, which produce consistent results with265-different Python versions and for a wide variety of terminal configurations.266-267-The end result is that these functions will always return a functional268-stream object (except in very odd cases; see :doc:`/unicode-support`).269-270-Example::271-272- import click273-274- stdin_text = click.get_text_stream('stdin')275- stdout_binary = click.get_binary_stream('stdout')276-277-.. versionadded:: 6.0278-279-Click now emulates output streams on Windows to support unicode to the280-Windows console through separate APIs. For more information see281-:doc:`wincmd`.282-283-284-Intelligent File Opening285-------------------------286-287-.. versionadded:: 3.0288-289-Starting with Click 3.0 the logic for opening files from the :class:`File`290-type is exposed through the :func:`open_file` function. It can291-intelligently open stdin/stdout as well as any other file.292-293-Example::294-295- import click296-297- stdout = click.open_file('-', 'w')298- test_file = click.open_file('test.txt', 'w')299-300-If stdin or stdout are returned, the return value is wrapped in a special301-file where the context manager will prevent the closing of the file. This302-makes the handling of standard streams transparent and you can always use303-it like this::304-305- with click.open_file(filename, 'w') as f:306- f.write('Hello World!\n')307-308-309-Finding Application Folders310----------------------------311-312-.. versionadded:: 2.0313-314-Very often, you want to open a configuration file that belongs to your315-application. However, different operating systems store these configuration316-files in different locations depending on their standards. Click provides317-a :func:`get_app_dir` function which returns the most appropriate location318-for per-user config files for your application depending on the OS.319-320-Example usage::321-322- import os323- import click324- import ConfigParser325-326- APP_NAME = 'My Application'327-328- def read_config():329- cfg = os.path.join(click.get_app_dir(APP_NAME), 'config.ini')330- parser = ConfigParser.RawConfigParser()331- parser.read([cfg])332- rv = {}333- for section in parser.sections():334- for key, value in parser.items(section):335- rv[f"{section}.{key}"] = value336- return rv337-338-339-Showing Progress Bars340----------------------341-342-Sometimes, you have command line scripts that need to process a lot of data,343-but you want to quickly show the user some progress about how long that344-will take. Click supports simple progress bar rendering for that through345-the :func:`progressbar` function.346-347-.. note::348-349- If you find that you have requirements beyond what Click's progress350- bar supports, try using `tqdm`_.351-352- .. _tqdm: https://tqdm.github.io/353-354-The basic usage is very simple: the idea is that you have an iterable that355-you want to operate on. For each item in the iterable it might take some356-time to do processing. So say you have a loop like this::357-358- for user in all_the_users_to_process:359- modify_the_user(user)360-361-To hook this up with an automatically updating progress bar, all you need362-to do is to change the code to this::363-364- import click365-366- with click.progressbar(all_the_users_to_process) as bar:367- for user in bar:368- modify_the_user(user)369-370-Click will then automatically print a progress bar to the terminal and371-calculate the remaining time for you. The calculation of remaining time372-requires that the iterable has a length. If it does not have a length373-but you know the length, you can explicitly provide it::374-375- with click.progressbar(all_the_users_to_process,376- length=number_of_users) as bar:377- for user in bar:378- modify_the_user(user)379-380-Note that :func:`progressbar` updates the bar *after* each iteration of the381-loop. So code like this will render correctly::382-383- import time384-385- with click.progressbar([1, 2, 3]) as bar:386- for x in bar:387- print(f"sleep({x})...")388- time.sleep(x)389-390-Another useful feature is to associate a label with the progress bar which391-will be shown preceding the progress bar::392-393- with click.progressbar(all_the_users_to_process,394- label='Modifying user accounts',395- length=number_of_users) as bar:396- for user in bar:397- modify_the_user(user)398-399-Sometimes, one may need to iterate over an external iterator, and advance the400-progress bar irregularly. To do so, you need to specify the length (and no401-iterable), and use the update method on the context return value instead of402-iterating directly over it::403-404- with click.progressbar(length=total_size,405- label='Unzipping archive') as bar:406- for archive in zip_file:407- archive.extract()408- bar.update(archive.size)added:docs/virtualenv.md+58 added
1+(virtualenv-heading)=2+3+# Virtualenv4+5+## Why Use Virtualenv?6+7+You should use [Virtualenv](https://virtualenv.pypa.io/en/latest/) because:8+9+- It allows you to install multiple versions of the same dependency.10+- If you have an operating system version of Python, it prevents you from changing its dependencies and potentially11+ messing up your os.12+13+## How to Use Virtualenv14+15+Create your project folder, then a virtualenv within it:16+17+```console18+$ mkdir myproject19+$ cd myproject20+$ python3 -m venv .venv21+```22+23+Now, whenever you want to work on a project, you only have to activate the corresponding environment.24+25+26+```{eval-rst}27+.. tabs::28+29+ .. group-tab:: OSX/Linux30+31+ .. code-block:: text32+33+ $ . .venv/bin/activate34+ (venv) $35+36+ .. group-tab:: Windows37+38+ .. code-block:: text39+40+ > .venv\scripts\activate41+ (venv) >42+```43+44+You are now using your virtualenv (notice how the prompt of your shell has changed to show the active environment).45+46+To install packages in the virtual environment:47+48+```console49+$ pip install click50+```51+52+And if you want to stop using the virtualenv, use the following command:53+54+```console55+$ deactivate56+```57+58+After doing this, the prompt of your shell should be as familiar as before.deleted:docs/virtualenv.rst-54 removed
1-.. _virtualenv-heading:2-3-Virtualenv4-=========================5-6-Why Use Virtualenv?7--------------------------8-9-You should use `Virtualenv <https://virtualenv.pypa.io/en/latest/>`_ because:10-11-* It allows you to install multiple versions of the same dependency.12-13-* If you have an operating system version of Python, it prevents you from changing its dependencies and potentially messing up your os.14-15-How to Use Virtualenv16------------------------------17-18-Create your project folder, then a virtualenv within it::19-20- $ mkdir myproject21- $ cd myproject22- $ python3 -m venv .venv23-24-Now, whenever you want to work on a project, you only have to activate the25-corresponding environment.26-27-.. tabs::28-29- .. group-tab:: OSX/Linux30-31- .. code-block:: text32-33- $ . .venv/bin/activate34- (venv) $35-36- .. group-tab:: Windows37-38- .. code-block:: text39-40- > .venv\scripts\activate41- (venv) >42-43-44-You are now using your virtualenv (notice how the prompt of your shell has changed to show the active environment).45-46-To install packages in the virtual environment::47-48- $ pip install click49-50-And if you want to stop using the virtualenv, use the following command::51-52- $ deactivate53-54-After doing this, the prompt of your shell should be as familiar as before.added:docs/why.md+106 added
1+# Why Click?2+3+There are so many libraries out there for writing command line utilities; why does Click exist?4+5+This question is easy to answer: because there is not a single command line utility for Python out there which ticks the6+following boxes:7+8+- Is lazily composable without restrictions.9+- Supports implementation of Unix/POSIX command line conventions.10+- Supports loading values from environment variables out of the box.11+- Support for prompting of custom values.12+- Is fully nestable and composable.13+- Supports file handling out of the box.14+- Comes with useful common helpers (getting terminal dimensions, ANSI colors, fetching direct keyboard input, screen15+ clearing, finding config paths, launching apps and editors, etc.).16+17+There are many alternatives to Click; the obvious ones are `optparse` and `argparse` from the standard library. Have a18+look to see if something else resonates with you.19+20+Click actually implements its own parsing of arguments and does not use `optparse` or `argparse` following the21+`optparse` parsing behavior. The reason it's not based on `argparse` is that `argparse` does not allow proper nesting of22+commands by design and has some deficiencies when it comes to POSIX compliant argument handling.23+24+Click is designed to be fun and customizable but not overly flexible. For instance, the customizability of help pages is25+constrained. This constraint is intentional because Click promises multiple Click instances will continue to function as26+intended when strung together.27+28+Too much customizability would break this promise.29+30+Click was written to support the [Flask](https://palletsprojects.com/p/flask/) microframework ecosystem because no tool31+could provide it with the functionality it needed.32+33+To get an understanding of what Click is all about, I strongly recommend looking at the {ref}`complex-guide` chapter.34+35+## Why not Argparse?36+37+Click is internally based on `optparse` instead of `argparse`. This is an implementation detail that a user does not38+have to be concerned with. Click is not based on `argparse` because it has some behaviors that make handling arbitrary39+command line interfaces hard:40+41+- `argparse` has built-in behavior to guess if something is an argument or an option. This becomes a problem when42+ dealing with incomplete command lines; the behaviour becomes unpredictable without full knowledge of a command line.43+ This goes against Click's ambitions of dispatching to subparsers.44+- `argparse` does not support disabling interspersed arguments. Without this feature, it's not possible to safely45+ implement Click's nested parsing.46+47+## Why not Docopt etc.?48+49+Docopt, and many tools like it, are cool in how they work, but very few of these tools deal with nesting of commands and50+composability in a way like Click. To the best of the developer's knowledge, Click is the first Python library that aims51+to create a level of composability of applications that goes beyond what the system itself supports.52+53+Docopt, for instance, acts by parsing your help pages and then parsing according to those rules. The side effect of this54+is that docopt is quite rigid in how it handles the command line interface. The upside of docopt is that it gives you55+strong control over your help page; the downside is that due to this it cannot rewrap your output for the current56+terminal width, and it makes translations hard. On top of that, docopt is restricted to basic parsing. It does not57+handle argument dispatching and callback invocation or types. This means there is a lot of code that needs to be written58+in addition to the basic help page to handle the parsing results.59+60+Most of all, however, it makes composability hard. While docopt does support dispatching to subcommands, it, for61+instance, does not directly support any kind of automatic subcommand enumeration based on what's available or it does62+not enforce subcommands to work in a consistent way.63+64+This is fine, but it's different from how Click wants to work. Click aims to support fully composable command line user65+interfaces by doing the following:66+67+- Click does not just parse, it also dispatches to the appropriate code.68+- Click has a strong concept of an invocation context that allows subcommands to respond to data from the parent69+ command.70+- Click has strong information available for all parameters and commands, so it can generate unified help pages for the71+ full CLI and assist the user in converting the input data as necessary.72+- Click has a strong understanding of what types are, and it can give the user consistent error messages if something73+ goes wrong. A subcommand written by a different developer will not suddenly die with a different error message because74+ it's manually handled.75+- Click has enough meta information available for its whole program to evolve over time and improve the user experience76+ without forcing developers to adjust their programs. For instance, if Click decides to change how help pages are77+ formatted, all Click programs will automatically benefit from this.78+79+The aim of Click is to make composable systems. Whereas, the aim of docopt is to build the most beautiful and80+hand-crafted command line interfaces. These two goals conflict with one another in subtle ways. Click actively prevents81+people from implementing certain patterns in order to achieve unified command line interfaces. For instance, as a82+developer, you are given very little choice in formatting your help pages.83+84+## Why Hardcoded Behaviors?85+86+The other question is why Click goes away from optparse and hardcodes certain behaviors instead of staying configurable.87+There are multiple reasons for this. The biggest one is that too much configurability makes it hard to achieve a88+consistent command line experience.89+90+The best example for this is optparse's `callback` functionality for accepting an arbitrary number of arguments. Due to91+syntactical ambiguities on the command line, there is no way to implement fully variadic arguments. There are always92+tradeoffs that need to be made and in case of `argparse` these tradeoffs have been critical enough, that a system like93+Click cannot even be implemented on top of it.94+95+In this particular case, Click attempts to stay with a handful of accepted paradigms for building command line96+interfaces that can be well documented and tested.97+98+## Why No Auto Correction?99+100+The question came up why Click does not auto correct parameters given that even optparse and `argparse` support101+automatic expansion of long arguments. The reason for this is that it's a liability for backwards compatibility. If102+people start relying on automatically modified parameters and someone adds a new parameter in the future, the script103+might stop working. These kinds of problems are hard to find, so Click does not attempt to be magical about this.104+105+This sort of behavior however can be implemented on a higher level to support things such as explicit aliases. For more106+information see {ref}`aliases`.deleted:docs/why.rst-146 removed
1-Why Click?2-==========3-4-There are so many libraries out there for writing command line utilities;5-why does Click exist?6-7-This question is easy to answer: because there is not a single command8-line utility for Python out there which ticks the following boxes:9-10-* Is lazily composable without restrictions.11-* Supports implementation of Unix/POSIX command line conventions.12-* Supports loading values from environment variables out of the box.13-* Support for prompting of custom values.14-* Is fully nestable and composable.15-* Supports file handling out of the box.16-* Comes with useful common helpers (getting terminal dimensions,17- ANSI colors, fetching direct keyboard input, screen clearing,18- finding config paths, launching apps and editors, etc.).19-20-There are many alternatives to Click; the obvious ones are ``optparse``21-and ``argparse`` from the standard library. Have a look to see if something22-else resonates with you.23-24-Click actually implements its own parsing of arguments and does not use25-``optparse`` or ``argparse`` following the ``optparse`` parsing behavior.26-The reason it's not based on ``argparse`` is that ``argparse`` does not27-allow proper nesting of commands by design and has some deficiencies when28-it comes to POSIX compliant argument handling.29-30-Click is designed to be fun and customizable but not overly flexible.31-For instance, the customizability of help pages is constrained. This32-constraint is intentional because Click promises multiple Click instances33-will continue to function as intended when strung together.34-35-Too much customizability would break this promise.36-37-Click was written to support the `Flask <https://palletsprojects.com/p/flask/>`_38-microframework ecosystem because no tool could provide it with the39-functionality it needed.40-41-To get an understanding of what Click is all about, I strongly recommend42-looking at the :ref:`complex-guide` chapter.43-44-Why not Argparse?45------------------46-47-Click is internally based on ``optparse`` instead of ``argparse``. This48-is an implementation detail that a user does not have to be concerned49-with. Click is not based on ``argparse`` because it has some behaviors that50-make handling arbitrary command line interfaces hard:51-52-* ``argparse`` has built-in behavior to guess if something is an53- argument or an option. This becomes a problem when dealing with54- incomplete command lines; the behaviour becomes unpredictable55- without full knowledge of a command line. This goes against Click's56- ambitions of dispatching to subparsers.57-* ``argparse`` does not support disabling interspersed arguments. Without58- this feature, it's not possible to safely implement Click's nested59- parsing.60-61-Why not Docopt etc.?62---------------------63-64-Docopt, and many tools like it, are cool in how they work, but very few of65-these tools deal with nesting of commands and composability in a way like66-Click. To the best of the developer's knowledge, Click is the first67-Python library that aims to create a level of composability of applications68-that goes beyond what the system itself supports.69-70-Docopt, for instance, acts by parsing your help pages and then parsing71-according to those rules. The side effect of this is that docopt is quite72-rigid in how it handles the command line interface. The upside of docopt73-is that it gives you strong control over your help page; the downside is74-that due to this it cannot rewrap your output for the current terminal75-width, and it makes translations hard. On top of that, docopt is restricted76-to basic parsing. It does not handle argument dispatching and callback77-invocation or types. This means there is a lot of code that needs to be78-written in addition to the basic help page to handle the parsing results.79-80-Most of all, however, it makes composability hard. While docopt does81-support dispatching to subcommands, it, for instance, does not directly82-support any kind of automatic subcommand enumeration based on what's83-available or it does not enforce subcommands to work in a consistent way.84-85-This is fine, but it's different from how Click wants to work. Click aims86-to support fully composable command line user interfaces by doing the87-following:88-89-- Click does not just parse, it also dispatches to the appropriate code.90-- Click has a strong concept of an invocation context that allows91- subcommands to respond to data from the parent command.92-- Click has strong information available for all parameters and commands,93- so it can generate unified help pages for the full CLI and94- assist the user in converting the input data as necessary.95-- Click has a strong understanding of what types are, and it can give the user96- consistent error messages if something goes wrong. A subcommand97- written by a different developer will not suddenly die with a98- different error message because it's manually handled.99-- Click has enough meta information available for its whole program100- to evolve over time and improve the user experience without101- forcing developers to adjust their programs. For instance, if Click102- decides to change how help pages are formatted, all Click programs103- will automatically benefit from this.104-105-The aim of Click is to make composable systems. Whereas, the aim of docopt106-is to build the most beautiful and hand-crafted command line interfaces.107-These two goals conflict with one another in subtle ways. Click108-actively prevents people from implementing certain patterns in order to109-achieve unified command line interfaces. For instance, as a developer, you110-are given very little choice in formatting your help pages.111-112-113-Why Hardcoded Behaviors?114-------------------------115-116-The other question is why Click goes away from optparse and hardcodes117-certain behaviors instead of staying configurable. There are multiple118-reasons for this. The biggest one is that too much configurability makes119-it hard to achieve a consistent command line experience.120-121-The best example for this is optparse's ``callback`` functionality for122-accepting an arbitrary number of arguments. Due to syntactical ambiguities123-on the command line, there is no way to implement fully variadic arguments.124-There are always tradeoffs that need to be made and in case of125-``argparse`` these tradeoffs have been critical enough, that a system like126-Click cannot even be implemented on top of it.127-128-In this particular case, Click attempts to stay with a handful of accepted129-paradigms for building command line interfaces that can be well documented130-and tested.131-132-133-Why No Auto Correction?134------------------------135-136-The question came up why Click does not auto correct parameters given that137-even optparse and ``argparse`` support automatic expansion of long arguments.138-The reason for this is that it's a liability for backwards compatibility.139-If people start relying on automatically modified parameters and someone140-adds a new parameter in the future, the script might stop working. These141-kinds of problems are hard to find, so Click does not attempt to be magical142-about this.143-144-This sort of behavior however can be implemented on a higher level to145-support things such as explicit aliases. For more information see146-:ref:`aliases`.added:docs/wincmd.md+47 added
1+# Windows Console Notes2+3+```{versionadded} 6.04+```5+6+Click emulates output streams on Windows to support unicode to the Windows console through separate APIs and we perform7+different decoding of parameters.8+9+Here is a brief overview of how this works and what it means to you.10+11+## Unicode Arguments12+13+Click internally is generally based on the concept that any argument can come in as either byte string or unicode string14+and conversion is performed to the type expected value as late as possible. This has some advantages as it allows us to15+accept the data in the most appropriate form for the operating system and Python version.16+17+This caused some problems on Windows where initially the wrong encoding was used and garbage ended up in your input18+data. We not only fixed the encoding part, but we also now extract unicode parameters from `sys.argv`.19+20+There is also another limitation with this: if `sys.argv` was modified prior to invoking a click handler, we have to21+fall back to the regular byte input in which case not all unicode values are available but only a subset of the codepage22+used for parameters.23+24+## Unicode Output and Input25+26+Unicode output and input on Windows is implemented through the concept of a dispatching text stream. What this means is27+that when click first needs a text output (or input) stream on windows it goes through a few checks to figure out of a28+windows console is connected or not. If no Windows console is present then the text output stream is returned as such29+and the encoding for that stream is set to `utf-8` like on all platforms.30+31+However if a console is connected the stream will instead be emulated and use the cmd.exe unicode APIs to output text32+information. In this case the stream will also use `utf-16-le` as internal encoding. However there is some hackery going33+on that the underlying raw IO buffer is still bypassing the unicode APIs and byte output through an indirection is still34+possible.35+36+- This unicode support is limited to `click.echo`, `click.prompt` as well as `click.get_text_stream`.37+- Depending on if unicode values or byte strings are passed the control flow goes completely different places internally38+ which can have some odd artifacts if data partially ends up being buffered. Click attempts to protect against that by39+ manually always flushing but if you are mixing and matching different string types to `stdout` or `stderr` you will40+ need to manually flush.41+- The raw output stream is set to binary mode, which is a global operation on Windows, so `print` calls will be42+ affected. Prefer `click.echo` over `print`.43+- On Windows 7 and below, there is a limitation where at most 64k characters can be written in one call in binary mode.44+ In this situation, `sys.stdout` and `sys.stderr` are replaced with wrappers that work around the limitation.45+46+Another important thing to note is that the Windows console's default fonts do not support a lot of characters which47+means that you are mostly limited to international letters but no emojis or special characters.deleted:docs/wincmd.rst-64 removed
1-Windows Console Notes2-=====================3-4-.. versionadded:: 6.05-6-Click emulates output streams on Windows to support unicode to the7-Windows console through separate APIs and we perform different decoding of8-parameters.9-10-Here is a brief overview of how this works and what it means to you.11-12-Unicode Arguments13------------------14-15-Click internally is generally based on the concept that any argument can16-come in as either byte string or unicode string and conversion is17-performed to the type expected value as late as possible. This has some18-advantages as it allows us to accept the data in the most appropriate form19-for the operating system and Python version.20-21-This caused some problems on Windows where initially the wrong encoding22-was used and garbage ended up in your input data. We not only fixed the23-encoding part, but we also now extract unicode parameters from `sys.argv`.24-25-There is also another limitation with this: if `sys.argv` was modified26-prior to invoking a click handler, we have to fall back to the regular27-byte input in which case not all unicode values are available but only a28-subset of the codepage used for parameters.29-30-Unicode Output and Input31-------------------------32-33-Unicode output and input on Windows is implemented through the concept of34-a dispatching text stream. What this means is that when click first needs35-a text output (or input) stream on windows it goes through a few checks to36-figure out of a windows console is connected or not. If no Windows37-console is present then the text output stream is returned as such and the38-encoding for that stream is set to ``utf-8`` like on all platforms.39-40-However if a console is connected the stream will instead be emulated and41-use the cmd.exe unicode APIs to output text information. In this case the42-stream will also use ``utf-16-le`` as internal encoding. However there is43-some hackery going on that the underlying raw IO buffer is still bypassing44-the unicode APIs and byte output through an indirection is still possible.45-46-* This unicode support is limited to ``click.echo``, ``click.prompt`` as47- well as ``click.get_text_stream``.48-* Depending on if unicode values or byte strings are passed the control49- flow goes completely different places internally which can have some50- odd artifacts if data partially ends up being buffered. Click51- attempts to protect against that by manually always flushing but if52- you are mixing and matching different string types to ``stdout`` or53- ``stderr`` you will need to manually flush.54-* The raw output stream is set to binary mode, which is a global55- operation on Windows, so ``print`` calls will be affected. Prefer56- ``click.echo`` over ``print``.57-* On Windows 7 and below, there is a limitation where at most 64k58- characters can be written in one call in binary mode. In this59- situation, ``sys.stdout`` and ``sys.stderr`` are replaced with60- wrappers that work around the limitation.61-62-Another important thing to note is that the Windows console's default63-fonts do not support a lot of characters which means that you are mostly64-limited to international letters but no emojis or special characters.modified:examples/aliases/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-aliases"3 version = "1.0.0"4 description = "Click aliases example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/colors/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-colors"3 version = "1.0.0"4 description = "Click colors example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/completion/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-completion"3 version = "1.0.0"4 description = "Click completion example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/complex/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-complex"3 version = "1.0.0"4 description = "Click complex example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/imagepipe/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-imagepipe"3 version = "1.0.0"4 description = "Click imagepipe example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 "pillow",9 ]10 unmodified linesmodified:examples/inout/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-inout"3 version = "1.0.0"4 description = "Click inout example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/naval/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-naval"3 version = "1.0.0"4 description = "Click naval example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/repo/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-repo"3 version = "1.0.0"4 description = "Click repo example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/termui/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-termui"3 version = "1.0.0"4 description = "Click termui example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/validation/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-validation"3 version = "1.0.0"4 description = "Click validation example"5-requires-python = ">=3.8"5+requires-python = ">=3.10"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesdeleted:requirements/build.in-1 removed
1-builddeleted:requirements/build.txt-12 removed
1-#2-# This file is autogenerated by pip-compile with Python 3.133-# by the following command:4-#5-# pip-compile build.in6-#7-build==1.2.2.post18- # via -r build.in9-packaging==24.110- # via build11-pyproject-hooks==1.2.012- # via builddeleted:requirements/dev.in-5 removed
1--r docs.txt2--r tests.txt3--r typing.txt4-pre-commit5-toxdeleted:requirements/dev.txt-150 removed
1-#2-# This file is autogenerated by pip-compile with Python 3.133-# by the following command:4-#5-# pip-compile dev.in6-#7-alabaster==1.0.08- # via sphinx9-babel==2.16.010- # via sphinx11-build==1.2.2.post112- # via pip-tools13-cachetools==5.5.014- # via tox15-certifi==2024.8.3016- # via requests17-cfgv==3.4.018- # via pre-commit19-chardet==5.2.020- # via tox21-charset-normalizer==3.4.022- # via requests23-click==8.1.724- # via25- # pip-compile-multi26- # pip-tools27-colorama==0.4.628- # via tox29-distlib==0.3.930- # via virtualenv31-docutils==0.21.232- # via33- # sphinx34- # sphinx-tabs35-filelock==3.16.136- # via37- # tox38- # virtualenv39-identify==2.6.140- # via pre-commit41-idna==3.1042- # via requests43-imagesize==1.4.144- # via sphinx45-iniconfig==2.0.046- # via pytest47-jinja2==3.1.448- # via sphinx49-markupsafe==3.0.250- # via jinja251-mypy==1.13.052- # via -r typing.in53-mypy-extensions==1.0.054- # via mypy55-nodeenv==1.9.156- # via57- # pre-commit58- # pyright59-packaging==24.160- # via61- # build62- # pallets-sphinx-themes63- # pyproject-api64- # pytest65- # sphinx66- # tox67-pallets-sphinx-themes==2.3.068- # via -r docs.in69-pip-compile-multi==2.6.470- # via -r dev.in71-pip-tools==7.4.172- # via pip-compile-multi73-platformdirs==4.3.674- # via75- # tox76- # virtualenv77-pluggy==1.5.078- # via79- # pytest80- # tox81-pre-commit==4.0.182- # via -r dev.in83-pygments==2.18.084- # via85- # sphinx86- # sphinx-tabs87-pyproject-api==1.8.088- # via tox89-pyproject-hooks==1.2.090- # via91- # build92- # pip-tools93-pyright==1.1.38694- # via -r typing.in95-pytest==8.3.396- # via -r tests.in97-pyyaml==6.0.298- # via pre-commit99-requests==2.32.3100- # via sphinx101-snowballstemmer==2.2.0102- # via sphinx103-sphinx==8.1.3104- # via105- # -r docs.in106- # pallets-sphinx-themes107- # sphinx-issues108- # sphinx-notfound-page109- # sphinx-tabs110- # sphinxcontrib-log-cabinet111-sphinx-issues==5.0.0112- # via -r docs.in113-sphinx-notfound-page==1.0.4114- # via pallets-sphinx-themes115-sphinx-tabs==3.4.7116- # via -r docs.in117-sphinxcontrib-applehelp==2.0.0118- # via sphinx119-sphinxcontrib-devhelp==2.0.0120- # via sphinx121-sphinxcontrib-htmlhelp==2.1.0122- # via sphinx123-sphinxcontrib-jsmath==1.0.1124- # via sphinx125-sphinxcontrib-log-cabinet==1.0.1126- # via -r docs.in127-sphinxcontrib-qthelp==2.0.0128- # via sphinx129-sphinxcontrib-serializinghtml==2.0.0130- # via sphinx131-toposort==1.10132- # via pip-compile-multi133-tox==4.23.2134- # via -r dev.in135-typing-extensions==4.12.2136- # via137- # mypy138- # pyright139-urllib3==2.2.3140- # via requests141-virtualenv==20.27.0142- # via143- # pre-commit144- # tox145-wheel==0.44.0146- # via pip-tools147-148-# The following packages are considered to be unsafe in a requirements file:149-# pip150-# setuptoolsdeleted:requirements/docs.in-4 removed
1-pallets-sphinx-themes2-sphinx3-sphinxcontrib-log-cabinet4-sphinx-tabsdeleted:requirements/docs.txt-70 removed
1-#2-# This file is autogenerated by pip-compile with Python 3.133-# by the following command:4-#5-# pip-compile docs.in6-#7-alabaster==1.0.08- # via sphinx9-babel==2.16.010- # via sphinx11-certifi==2024.8.3012- # via requests13-charset-normalizer==3.4.014- # via requests15-docutils==0.21.216- # via17- # sphinx18- # sphinx-tabs19-idna==3.1020- # via requests21-imagesize==1.4.122- # via sphinx23-jinja2==3.1.424- # via sphinx25-markupsafe==3.0.226- # via jinja227-packaging==24.128- # via29- # pallets-sphinx-themes30- # sphinx31-pallets-sphinx-themes==2.3.032- # via -r docs.in33-pygments==2.18.034- # via35- # sphinx36- # sphinx-tabs37-requests==2.32.338- # via sphinx39-snowballstemmer==2.2.040- # via sphinx41-sphinx==8.1.342- # via43- # -r docs.in44- # pallets-sphinx-themes45- # sphinx-issues46- # sphinx-notfound-page47- # sphinx-tabs48- # sphinxcontrib-log-cabinet49-sphinx-issues==5.0.050- # via -r docs.in51-sphinx-notfound-page==1.0.452- # via pallets-sphinx-themes53-sphinx-tabs==3.4.754- # via -r docs.in55-sphinxcontrib-applehelp==2.0.056- # via sphinx57-sphinxcontrib-devhelp==2.0.058- # via sphinx59-sphinxcontrib-htmlhelp==2.1.060- # via sphinx61-sphinxcontrib-jsmath==1.0.162- # via sphinx63-sphinxcontrib-log-cabinet==1.0.164- # via -r docs.in65-sphinxcontrib-qthelp==2.0.066- # via sphinx67-sphinxcontrib-serializinghtml==2.0.068- # via sphinx69-urllib3==2.2.370- # via requestsdeleted:requirements/tests.in-1 removed
1-pytestdeleted:requirements/tests.txt-14 removed
1-#2-# This file is autogenerated by pip-compile with Python 3.133-# by the following command:4-#5-# pip-compile tests.in6-#7-iniconfig==2.0.08- # via pytest9-packaging==24.110- # via pytest11-pluggy==1.5.012- # via pytest13-pytest==8.3.314- # via -r tests.indeleted:requirements/typing.in-3 removed
1-mypy2-pyright3-pytestdeleted:requirements/typing.txt-18 removed
1-#2-# This file is autogenerated by pip-compile with Python 3.133-# by the following command:4-#5-# pip-compile typing.in6-#7-mypy==1.13.08- # via -r typing.in9-mypy-extensions==1.0.010- # via mypy11-nodeenv==1.9.112- # via pyright13-pyright==1.1.38614- # via -r typing.in15-typing-extensions==4.12.216- # via17- # mypy18- # pyrightmodified:src/click/__init__.py-1 removed
17 unmodified lines18 from .decorators import command as command19 from .decorators import confirmation_option as confirmation_option20 from .decorators import group as group21 from .decorators import help_option as help_option22-from .decorators import HelpOption as HelpOption22 from .decorators import make_pass_decorator as make_pass_decorator23 from .decorators import option as option24 from .decorators import pass_context as pass_context25 from .decorators import pass_obj as pass_obj98 unmodified linesmodified:src/click/_termui_impl.py+110 added-40 removed
8 unmodified lines9 import collections.abc as cabc10 import contextlib11 import math12 import os13+import shlex14 import sys15 import time16 import typing as t17 from gettext import gettext as _18 from io import StringIO19+from pathlib import Path20+from shutil import which21 from types import TracebackType22 23 from ._compat import _default_text_stdout24 from ._compat import CYGWIN74 unmodified lines99 raise TypeError("iterable or length is required")100 iterable = t.cast("cabc.Iterable[V]", range(length))101 self.iter: cabc.Iterable[V] = iter(iterable)102 self.length = length100- self.pos = 0103+ self.pos: int = 0104 self.avg: list[float] = []105 self.last_eta: float106 self.start: float107 self.start = self.last_eta = time.time()269 unmodified lines377 stdout = StringIO()378 379 if not isatty(sys.stdin) or not isatty(stdout):380 return _nullpager(stdout, generator, color)378- pager_cmd = (os.environ.get("PAGER", None) or "").strip()379- if pager_cmd:381+382+ # Split and normalize the pager command into parts.383+ pager_cmd_parts = shlex.split(os.environ.get("PAGER", ""), posix=False)384+ if pager_cmd_parts:385 if WIN:381- return _tempfilepager(generator, pager_cmd, color)382- return _pipepager(generator, pager_cmd, color)386+ if _tempfilepager(generator, pager_cmd_parts, color):387+ return388+ elif _pipepager(generator, pager_cmd_parts, color):389+ return390+391 if os.environ.get("TERM") in ("dumb", "emacs"):392 return _nullpager(stdout, generator, color)385- if WIN or sys.platform.startswith("os2"):386- return _tempfilepager(generator, "more <", color)387- if hasattr(os, "system") and os.system("(less) 2>/dev/null") == 0:388- return _pipepager(generator, "less", color)393+ if (WIN or sys.platform.startswith("os2")) and _tempfilepager(394+ generator, ["more"], color395+ ):396+ return397+ if _pipepager(generator, ["less"], color):398+ return399 400 import tempfile401 402 fd, filename = tempfile.mkstemp()403 os.close(fd)404 try:395- if hasattr(os, "system") and os.system(f'more "{filename}"') == 0:396- return _pipepager(generator, "more", color)405+ if _pipepager(generator, ["more"], color):406+ return407 return _nullpager(stdout, generator, color)408 finally:409 os.unlink(filename)410 411 402-def _pipepager(generator: cabc.Iterable[str], cmd: str, color: bool | None) -> None:403- """Page through text by feeding it to another program. Invoking a412+def _pipepager(413+ generator: cabc.Iterable[str], cmd_parts: list[str], color: bool | None414+) -> bool:415+ """Page through text by feeding it to another program. Invoking a416 pager through this might support colors.417+418+ Returns `True` if the command was found, `False` otherwise and thus another419+ pager should be attempted.420 """421+ # Split the command into the invoked CLI and its parameters.422+ if not cmd_parts:423+ return False424+ cmd = cmd_parts[0]425+ cmd_params = cmd_parts[1:]426+427+ cmd_filepath = which(cmd)428+ if not cmd_filepath:429+ return False430+ # Resolves symlinks and produces a normalized absolute path string.431+ cmd_path = Path(cmd_filepath).resolve()432+ cmd_name = cmd_path.name433+434 import subprocess435 436+ # Make a local copy of the environment to not affect the global one.437 env = dict(os.environ)438 410- # If we're piping to less we might support colors under the411- # condition that412- cmd_detail = cmd.rsplit("/", 1)[-1].split()413- if color is None and cmd_detail[0] == "less":414- less_flags = f"{os.environ.get('LESS', '')}{' '.join(cmd_detail[1:])}"439+ # If we're piping to less and the user hasn't decided on colors, we enable440+ # them by default we find the -R flag in the command line arguments.441+ if color is None and cmd_name == "less":442+ less_flags = f"{os.environ.get('LESS', '')}{' '.join(cmd_params)}"443 if not less_flags:444 env["LESS"] = "-R"445 color = True446 elif "r" in less_flags or "R" in less_flags:447 color = True448 421- c = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, env=env)422- stdin = t.cast(t.BinaryIO, c.stdin)423- encoding = get_best_encoding(stdin)449+ c = subprocess.Popen(450+ [str(cmd_path)] + cmd_params,451+ shell=True,452+ stdin=subprocess.PIPE,453+ env=env,454+ errors="replace",455+ text=True,456+ )457+ assert c.stdin is not None458 try:459 for text in generator:460 if not color:461 text = strip_ansi(text)462 429- stdin.write(text.encode(encoding, "replace"))463+ c.stdin.write(text)464 except BrokenPipeError:465 # In case the pager exited unexpectedly, ignore the broken pipe error.466 pass467 except Exception as e:5 unmodified lines473 raise e474 finally:475 # We must close stdin and wait for the pager to exit before we continue476 try:443- stdin.close()477+ c.stdin.close()478 # Close implies flush, so it might throw a BrokenPipeError if the pager479 # process exited already.480 except BrokenPipeError:481 pass13 unmodified lines495 pass496 else:497 break498 499+ return True500 466-def _tempfilepager(generator: cabc.Iterable[str], cmd: str, color: bool | None) -> None:467- """Page through text by invoking a program on a temporary file."""501+502+def _tempfilepager(503+ generator: cabc.Iterable[str], cmd_parts: list[str], color: bool | None504+) -> bool:505+ """Page through text by invoking a program on a temporary file.506+507+ Returns `True` if the command was found, `False` otherwise and thus another508+ pager should be attempted.509+ """510+ # Split the command into the invoked CLI and its parameters.511+ if not cmd_parts:512+ return False513+ cmd = cmd_parts[0]514+515+ cmd_filepath = which(cmd)516+ if not cmd_filepath:517+ return False518+ # Resolves symlinks and produces a normalized absolute path string.519+ cmd_path = Path(cmd_filepath).resolve()520+521+ import subprocess522 import tempfile523 524 fd, filename = tempfile.mkstemp()525 # TODO: This never terminates if the passed generator never terminates.3 unmodified lines529 encoding = get_best_encoding(sys.stdout)530 with open_stream(filename, "wb")[0] as f:531 f.write(text.encode(encoding))532 try:479- os.system(f'{cmd} "{filename}"')533+ subprocess.call([str(cmd_path), filename])534+ except OSError:535+ # Command not found536+ pass537 finally:538 os.close(fd)539 os.unlink(filename)540 541+ return True542 543+544 def _nullpager(545 stream: t.TextIO, generator: cabc.Iterable[str], color: bool | None546 ) -> None:547 """Simply print unformatted text. This is the ultimate fallback."""25 unmodified lines573 return rv574 if WIN:575 return "notepad"576 for editor in "sensible-editor", "vim", "nano":518- if os.system(f"which {editor} >/dev/null 2>&1") == 0:577+ if which(editor) is not None:578 return editor579 return "vi"580 581 def edit_files(self, filenames: cabc.Iterable[str]) -> None:33 unmodified lines615 def edit(self, text: str | bytes | bytearray | None) -> str | bytes | None:616 import tempfile617 618 if text is None:560- data = b""619+ data: bytes | bytearray = b""620 elif isinstance(text, (bytes, bytearray)):621 data = text622 else:623 if text and not text.endswith("\n"):60 unmodified lines684 finally:685 null.close()686 elif WIN:687 if locate:629- url = _unquote_file(url.replace('"', ""))630- args = f'explorer /select,"{url}"'688+ url = _unquote_file(url)689+ args = ["explorer", f"/select,{url}"]690 else:632- url = url.replace('"', "")633- wait_str = "/WAIT" if wait else ""634- args = f'start {wait_str} "" "{url}"'635- return os.system(args)691+ args = ["start"]692+ if wait:693+ args.append("/WAIT")694+ args.append("")695+ args.append(url)696+ try:697+ return subprocess.call(args)698+ except OSError:699+ # Command not found700+ return 127701 elif CYGWIN:702 if locate:638- url = os.path.dirname(_unquote_file(url).replace('"', ""))639- args = f'cygstart "{url}"'703+ url = _unquote_file(url)704+ args = ["cygstart", os.path.dirname(url)]705 else:641- url = url.replace('"', "")642- wait_str = "-w" if wait else ""643- args = f'cygstart {wait_str} "{url}"'644- return os.system(args)706+ args = ["cygstart"]707+ if wait:708+ args.append("-w")709+ args.append(url)710+ try:711+ return subprocess.call(args)712+ except OSError:713+ # Command not found714+ return 127715 716 try:717 if locate:718 url = os.path.dirname(_unquote_file(url)) or "."121 unmodified linesmodified:src/click/_winconsole.py+3 added-2 removed
106 unmodified lines107 flags: int = PyBUF_WRITABLE if writable else PyBUF_SIMPLE108 PyObject_GetBuffer(py_object(obj), byref(buf), flags)109 110 try:111- buffer_type: Array[c_char] = c_char * buf.len112- return buffer_type.from_address(buf.buf)111+ buffer_type = c_char * buf.len112+ out: Array[c_char] = buffer_type.from_address(buf.buf)113+ return out114 finally:115 PyBuffer_Release(byref(buf))116 117 179 unmodified linesmodified:src/click/core.py+117 added-60 removed
88 unmodified lines89 raise RuntimeError(message)90 91 92 def batch(iterable: cabc.Iterable[V], batch_size: int) -> list[tuple[V, ...]]:93- return list(zip(*repeat(iter(iterable), batch_size)))93+ return list(zip(*repeat(iter(iterable), batch_size), strict=False))94 95 96 @contextmanager97 def augment_usage_errors(17 unmodified lines115 def iter_params_for_processing(116 invocation_order: cabc.Sequence[Parameter],117 declaration_order: cabc.Sequence[Parameter],118 ) -> list[Parameter]:119- """Given a sequence of parameters in the order as should be considered120- for processing and an iterable of parameters that exist, this returns121- a list in the correct order as they should be processed.119+ """Returns all declared parameters in the order they should be processed.120+121+ The declared parameters are re-shuffled depending on the order in which122+ they were invoked, as well as the eagerness of each parameters.123+124+ The invocation order takes precedence over the declaration order. I.e. the125+ order in which the user provided them to the CLI is respected.126+127+ This behavior and its effect on callback evaluation is detailed at:128+ https://click.palletsprojects.com/en/stable/advanced/#callback-evaluation-order129 """130 131 def sort_key(item: Parameter) -> tuple[bool, float]:132 try:807 unmodified lines940 self.epilog = epilog941 self.options_metavar = options_metavar942 self.short_help = short_help943 self.add_help_option = add_help_option944+ self._help_option = None945 self.no_args_is_help = no_args_is_help946 self.hidden = hidden947 self.deprecated = deprecated948 72 unmodified lines1021 all_names.difference_update(param.secondary_opts)1022 return list(all_names)1023 1024 def get_help_option(self, ctx: Context) -> Option | None:1017- """Returns the help option object."""1018- help_options = self.get_help_option_names(ctx)1025+ """Returns the help option object.1026 1027+ Skipped if :attr:`add_help_option` is ``False``.1028+1029+ .. versionchanged:: 8.1.81030+ The help option is now cached to avoid creating it multiple times.1031+ """1032+ help_option_names = self.get_help_option_names(ctx)1033+1020- if not help_options or not self.add_help_option:1034+ if not help_option_names or not self.add_help_option:1035 return None1036 1023- def show_help(ctx: Context, param: Parameter, value: str) -> None:1024- if value and not ctx.resilient_parsing:1025- echo(ctx.get_help(), color=ctx.color)1026- ctx.exit()1037+ # Cache the help option object in private _help_option attribute to1038+ # avoid creating it multiple times. Not doing this will break the1039+ # callback odering by iter_params_for_processing(), which relies on1040+ # object comparison.1041+ if self._help_option is None:1042+ # Avoid circular import.1043+ from .decorators import help_option1044 1028- return Option(1029- help_options,1030- is_flag=True,1031- is_eager=True,1032- expose_value=False,1033- callback=show_help,1034- help=_("Show this message and exit."),1035- )1045+ # Apply help_option decorator and pop resulting option1046+ help_option(*help_option_names)(self)1047+ self._help_option = self.params.pop() # type: ignore[assignment]1048 1049+ return self._help_option1050+1051 def make_parser(self, ctx: Context) -> _OptionParser:1052 """Creates the underlying option parser for this command."""1053 parser = _OptionParser(ctx)1054 for param in self.get_params(ctx):162 unmodified lines1217 extra_message = (1218 f" {self.deprecated}" if isinstance(self.deprecated, str) else ""1219 )1220 message = _(1207- "DeprecationWarning: The command {name!r} is deprecated."1208- "{extra_message}"1221+ "DeprecationWarning: The command {name!r} is deprecated.{extra_message}"1222 ).format(name=self.name, extra_message=extra_message)1223 echo(style(message, fg="red"), err=True)1224 1225 if self.callback is not None:389 unmodified lines1615 1616 func: t.Callable[..., t.Any] | None = None1617 1618 if args and callable(args[0]):1606- assert (1607- len(args) == 1 and not kwargs1608- ), "Use 'command(**kwargs)(callable)' to provide arguments."1619+ assert len(args) == 1 and not kwargs, (1620+ "Use 'command(**kwargs)(callable)' to provide arguments."1621+ )1622 (func,) = args1623 args = ()1624 1625 if self.command_class and kwargs.get("cls") is None:38 unmodified lines1664 1665 func: t.Callable[..., t.Any] | None = None1666 1667 if args and callable(args[0]):1655- assert (1656- len(args) == 1 and not kwargs1657- ), "Use 'group(**kwargs)(callable)' to provide arguments."1668+ assert len(args) == 1 and not kwargs, (1669+ "Use 'group(**kwargs)(callable)' to provide arguments."1670+ )1671 (func,) = args1672 args = ()1673 1674 if self.group_class is not None and kwargs.get("cls") is None:529 unmodified lines2204 same as the name for options, but the metavar for arguments.2205 """2206 return self.name # type: ignore2207 2195- def make_metavar(self) -> str:2208+ def make_metavar(self, ctx: Context) -> str:2209 if self.metavar is not None:2210 return self.metavar2211 2199- metavar = self.type.get_metavar(self)2212+ metavar = self.type.get_metavar(param=self, ctx=ctx)2213 2214 if metavar is None:2215 metavar = self.type.name.upper()2216 336 unmodified lines2553 ) -> None:2554 if help:2555 help = inspect.cleandoc(help)2556 2544- default_is_missing = "default" not in attrs2557 super().__init__(2558 param_decls, type=type, multiple=multiple, deprecated=deprecated, **attrs2559 )2560 25 unmodified lines2586 # used as a flag to indicate using prompt or flag_value.2587 self._flag_needs_value = self.prompt is not None and not self.prompt_required2588 2589 if is_flag is None:2590+ # Implicitly a flag because flag_value was set.2591 if flag_value is not None:2579- # Implicitly a flag because flag_value was set.2592 is_flag = True2593+ # Not a flag, but when used as a flag it shows a prompt.2594 elif self._flag_needs_value:2582- # Not a flag, but when used as a flag it shows a prompt.2595 is_flag = False2584- else:2585- # Implicitly a flag because flag options were given.2586- is_flag = bool(self.secondary_opts)2596+ # Implicitly a flag because flag options were given.2597+ elif self.secondary_opts:2598+ is_flag = True2599 elif is_flag is False and not self._flag_needs_value:2600 # Not a flag, and prompt is not enabled, can be used as a2601 # flag if flag_value is set.2602 self._flag_needs_value = flag_value is not None2603 2604 self.default: t.Any | t.Callable[[], t.Any]2605 2606+ if is_flag:2607+ # Set missing default for flags if not explicitly required or prompted.2594- if is_flag and default_is_missing and not self.required:2595- if multiple:2596- self.default = ()2597- else:2598- self.default = False2608+ if self.default is None and not self.required and not self.prompt:2609+ if multiple:2610+ self.default = ()2611+ else:2612+ self.default = False2613 2614+ if flag_value is None:2615+ # A boolean flag presence in the command line is enough to set2616+ # the value: to the default if it is not blank, or to True2617+ # otherwise.2618+ flag_value = self.default if self.default else True2619+2620 self.type: types.ParamType2621 if is_flag and type is None:2602- if flag_value is None:2603- flag_value = not self.default2622 # Re-guess the type from the flag value instead of the2623 # default.2624 self.type = types.convert_type(None, flag_value)2625 2608- self.is_flag: bool = is_flag2609- self.is_bool_flag: bool = is_flag and isinstance(self.type, types.BoolParamType)2626+ self.is_flag: bool = bool(is_flag)2627+ self.is_bool_flag: bool = bool(2628+ is_flag and isinstance(self.type, types.BoolParamType)2629+ )2630 self.flag_value: t.Any = flag_value2631 2632 # Counting2633 self.count = count2634 if count:2635 if type is None:2636 self.type = types.IntRange(min=0)2617- if default_is_missing:2637+ if self.default is None:2638 self.default = 02639 2640 self.allow_from_autoenv = allow_from_autoenv2641 self.help = help39 unmodified lines2681 return info_dict2682 2683 def get_error_hint(self, ctx: Context) -> str:2684 result = super().get_error_hint(ctx)2665- if self.show_envvar:2685+ if self.show_envvar and self.envvar is not None:2686 result += f" (env var: '{self.envvar}')"2687 return result2688 2689 def _parse_decls(104 unmodified lines2794 if any_slashes:2795 any_prefix_is_slash = True2796 2797 if not self.is_flag and not self.count:2778- rv += f" {self.make_metavar()}"2798+ rv += f" {self.make_metavar(ctx=ctx)}"2799 2800 return rv2801 2802 rv = [_write_opts(self.opts)]68 unmodified lines2871 if show_default_is_str:2872 default_string = f"({self.show_default})"2873 elif isinstance(default_value, (list, tuple)):2874 default_string = ", ".join(str(d) for d in default_value)2875+ elif isinstance(default_value, enum.Enum):2876+ default_string = default_value.name2877 elif inspect.isfunction(default_value):2878 default_string = _("(dynamic)")2879 elif self.is_bool_flag and self.secondary_opts:2880 # For boolean flags that have distinct True/False opts,44 unmodified lines2925 # if we're the default one in which case we return the flag2926 # value as default.2927 if self.is_flag and not self.is_bool_flag:2928 for param in ctx.command.params:2907- if param.name == self.name and param.default:2908- return t.cast(Option, param).flag_value2929+ if param.name == self.name and param.default is not None:2930+ return t.cast(Option, param).default2931 2932 return None2933 2934 return super().get_default(ctx, call=call)31 unmodified lines2966 **prompt_kwargs,2967 )2968 2969 def resolve_envvar_value(self, ctx: Context) -> str | None:2970+ """Find which environment variable to read for this option and return2971+ its value.2972+2973+ Returns the value of the environment variable if it exists, or ``None``2974+ if it does not.2975+2976+ .. caution::2977+2978+ The raw value extracted from the environment is not normalized and2979+ is returned as-is. Any normalization or reconciation with the2980+ option's type should happen later.2981+ """2982 rv = super().resolve_envvar_value(ctx)2983 2984 if rv is not None:2951- if self.is_flag and self.flag_value:2952- return str(self.flag_value)2985 return rv2986 2987 if (2988 self.allow_from_autoenv8 unmodified lines2997 2998 return None2999 3000 def value_from_envvar(self, ctx: Context) -> t.Any | None:3001+ """Normalize the value from the environment variable, if it exists."""2969- rv: t.Any | None = self.resolve_envvar_value(ctx)3002+ rv: str | None = self.resolve_envvar_value(ctx)3003 3004 if rv is None:3005 return None3006 2974- value_depth = (self.nargs != 1) + bool(self.multiple)3007+ # Non-boolean flags are more liberal in what they accept. But a flag being a3008+ # flag, its envvar value still needs to analyzed to determine if the flag is3009+ # activated or not.3010+ if self.is_flag and not self.is_bool_flag:3011+ # If the flag_value is set and match the envvar value, return it3012+ # directly.3013+ if self.flag_value is not None and rv == self.flag_value:3014+ return self.flag_value3015+ # Analyze the envvar value as a boolean to know if the flag is3016+ # activated or not.3017+ return types.BoolParamType.str_to_bool(rv)3018 3019+ # Split the envvar value if it is allowed to be repeated.3020+ value_depth = (self.nargs != 1) + bool(self.multiple)3021 if value_depth > 0:2977- rv = self.type.split_envvar_value(rv)2978-3022+ multi_rv = self.type.split_envvar_value(rv)3023 if self.multiple and self.nargs != 1:2980- rv = batch(rv, self.nargs)3024+ multi_rv = batch(multi_rv, self.nargs) # type: ignore[assignment]3025 3026+ return multi_rv3027+3028 return rv3029 3030 def consume_value(3031 self, ctx: Context, opts: cabc.Mapping[str, Parameter]10 unmodified lines3042 else:3043 value = self.flag_value3044 source = ParameterSource.COMMANDLINE3045 3046+ # A flag which is activated and has a flag_value set, should returns3047+ # the latter, unless the value comes from the explicitly sets default.3048 elif (3049+ self.is_flag3050+ and value is True3051+ and not self.is_bool_flag3052+ and self.flag_value is not None3053+ and source is not ParameterSource.DEFAULT3054+ ):3055+ value = self.flag_value3056+3057+ elif (3058 self.multiple3059 and value is not None3060 and any(v is _flag_needs_value for v in value)3061 ):50 unmodified lines3112 if self.metavar is not None:3113 return self.metavar3114 return self.name.upper() # type: ignore3115 3059- def make_metavar(self) -> str:3116+ def make_metavar(self, ctx: Context) -> str:3117 if self.metavar is not None:3118 return self.metavar3062- var = self.type.get_metavar(self)3119+ var = self.type.get_metavar(param=self, ctx=ctx)3120 if not var:3121 var = self.name.upper() # type: ignore3122 if self.deprecated:3123 var += "!"20 unmodified lines3144 )3145 return name, [arg], []3146 3147 def get_usage_pieces(self, ctx: Context) -> list[str]:3091- return [self.make_metavar()]3148+ return [self.make_metavar(ctx)]3149 3150 def get_error_hint(self, ctx: Context) -> str:3094- return f"'{self.make_metavar()}'"3151+ return f"'{self.make_metavar(ctx)}'"3152 3153 def add_to_parser(self, parser: _OptionParser, ctx: Context) -> None:3154 parser.add_argument(dest=self.name, nargs=self.nargs, obj=self)3155 23 unmodified linesmodified:src/click/decorators.py+12 added-26 removed
1 from __future__ import annotations2 3 import inspect4 import typing as t5-from collections import abc5 from functools import update_wrapper6 from gettext import gettext as _7 8 from .core import Argument514 unmodified lines523 kwargs["callback"] = callback524 return option(*param_decls, **kwargs)525 526 528-class HelpOption(Option):527+def help_option(*param_decls: str, **kwargs: t.Any) -> t.Callable[[FC], FC]:528 """Pre-configured ``--help`` option which immediately prints the help page529 and exits the program.530+531+ :param param_decls: One or more option names. Defaults to the single532+ value ``"--help"``.533+ :param kwargs: Extra arguments are passed to :func:`option`.534 """535 533- def __init__(534- self,535- param_decls: abc.Sequence[str] | None = None,536- **kwargs: t.Any,537- ) -> None:538- if not param_decls:539- param_decls = ("--help",)540-541- kwargs.setdefault("is_flag", True)542- kwargs.setdefault("expose_value", False)543- kwargs.setdefault("is_eager", True)544- kwargs.setdefault("help", _("Show this message and exit."))545- kwargs.setdefault("callback", self.show_help)546-547- super().__init__(param_decls, **kwargs)548-549- @staticmethod536 def show_help(ctx: Context, param: Parameter, value: bool) -> None:537 """Callback that print the help page on ``<stdout>`` and exits."""538 if value and not ctx.resilient_parsing:539 echo(ctx.get_help(), color=ctx.color)540 ctx.exit()541 542+ if not param_decls:543+ param_decls = ("--help",)544 557-def help_option(*param_decls: str, **kwargs: t.Any) -> t.Callable[[FC], FC]:558- """Decorator for the pre-configured ``--help`` option defined above.545+ kwargs.setdefault("is_flag", True)546+ kwargs.setdefault("expose_value", False)547+ kwargs.setdefault("is_eager", True)548+ kwargs.setdefault("help", _("Show this message and exit."))549+ kwargs.setdefault("callback", show_help)550 560- :param param_decls: One or more option names. Defaults to the single561- value ``"--help"``.562- :param kwargs: Extra arguments are passed to :func:`option`.563- """564- kwargs.setdefault("cls", HelpOption)551 return option(*param_decls, **kwargs)modified:src/click/exceptions.py+6 added-4 removed
113 unmodified lines114 self,115 message: str,116 ctx: Context | None = None,117 param: Parameter | None = None,118- param_hint: str | None = None,118+ param_hint: cabc.Sequence[str] | str | None = None,119 ) -> None:120 super().__init__(message, ctx)121 self.param = param122 self.param_hint = param_hint27 unmodified lines150 self,151 message: str | None = None,152 ctx: Context | None = None,153 param: Parameter | None = None,154- param_hint: str | None = None,154+ param_hint: cabc.Sequence[str] | str | None = None,155 param_type: str | None = None,156 ) -> None:157 super().__init__(message or "", ctx, param, param_hint)158 self.param_type = param_type159 160 def format_message(self) -> str:161 if self.param_hint is not None:162- param_hint: str | None = self.param_hint162+ param_hint: cabc.Sequence[str] | str | None = self.param_hint163 elif self.param is not None:164 param_hint = self.param.get_error_hint(self.ctx) # type: ignore165 else:166 param_hint = None6 unmodified lines173 param_type = self.param.param_type_name174 175 msg = self.message176 if self.param is not None:177- msg_extra = self.param.type.get_missing_message(self.param)177+ msg_extra = self.param.type.get_missing_message(178+ param=self.param, ctx=self.ctx179+ )180 if msg_extra:181 if msg:182 msg += f". {msg_extra}"183 else:125 unmodified linesmodified:src/click/formatting.py+1 added-1 removed
127 unmodified lines128 width = FORCED_WIDTH129 if width is None:130 width = max(min(shutil.get_terminal_size().columns, max_width) - 2, 50)131 self.width = width132- self.current_indent = 0132+ self.current_indent: int = 0133 self.buffer: list[str] = []134 135 def write(self, string: str) -> None:136 """Writes a unicode string into the internal buffer."""165 unmodified linesmodified:src/click/shell_completion.py+34 added-7 removed
122 unmodified lines123 124 %(complete_func)s_setup;125 """126 127+# See ZshComplete.format_completion below, and issue #2703, before128+# changing this script.129+#130+# (TL;DR: _describe is picky about the format, but this Zsh script snippet131+# is already widely deployed. So freeze this script, and use clever-ish132+# handling of colons in ZshComplet.format_completion.)133 _SOURCE_ZSH = """\134 #compdef %(prog_name)s135 136 %(complete_func)s() {171 unmodified lines308 source_template = _SOURCE_BASH309 310 @staticmethod311 def _check_version() -> None:312+ import shutil313 import subprocess314 308- output = subprocess.run(309- ["bash", "-c", 'echo "${BASH_VERSION}"'], stdout=subprocess.PIPE310- )311- match = re.search(r"^(\d+)\.(\d+)\.\d+", output.stdout.decode())315+ bash_exe = shutil.which("bash")316 317+ if bash_exe is None:318+ match = None319+ else:320+ output = subprocess.run(321+ [bash_exe, "--norc", "-c", 'echo "${BASH_VERSION}"'],322+ stdout=subprocess.PIPE,323+ )324+ match = re.search(r"^(\d+)\.(\d+)\.\d+", output.stdout.decode())325+326 if match is not None:327 major, minor = match.groups()328 329 if major < "4" or major == "4" and minor < "4":48 unmodified lines378 379 return args, incomplete380 381 def format_completion(self, item: CompletionItem) -> str:369- return f"{item.type}\n{item.value}\n{item.help if item.help else '_'}"382+ help_ = item.help or "_"383+ # The zsh completion script uses `_describe` on items with help384+ # texts (which splits the item help from the item value at the385+ # first unescaped colon) and `compadd` on items without help386+ # text (which uses the item value as-is and does not support387+ # colon escaping). So escape colons in the item value if and388+ # only if the item help is not the sentinel "_" value, as used389+ # by the completion script.390+ #391+ # (The zsh completion script is potentially widely deployed, and392+ # thus harder to fix than this method.)393+ #394+ # See issue #1812 and issue #2703 for further context.395+ value = item.value.replace(":", r"\:") if help_ != "_" else item.value396+ return f"{item.type}\n{value}\n{help_}"397 398 399 class FishComplete(ShellComplete):400 """Shell completion for Fish."""186 unmodified lines587 588 with cmd.make_context(589 name, args, parent=ctx, resilient_parsing=True590 ) as sub_ctx:564- args = ctx._protected_args + ctx.args591 ctx = sub_ctx592+ args = ctx._protected_args + ctx.args593 else:594 sub_ctx = ctx595 596 while args:9 unmodified lines606 allow_extra_args=True,607 allow_interspersed_args=False,608 resilient_parsing=True,609 ) as sub_sub_ctx:583- args = sub_ctx.args610 sub_ctx = sub_sub_ctx611+ args = sub_ctx.args612 613 ctx = sub_ctx614 args = [*sub_ctx._protected_args, *sub_ctx.args]615 else:50 unmodified linesmodified:src/click/testing.py+24 added-2 removed
97 unmodified lines98 self.output: io.BytesIO = io.BytesIO()99 self.stdout: io.BytesIO = BytesIOCopy(copy_to=self.output)100 self.stderr: io.BytesIO = BytesIOCopy(copy_to=self.output)101 102+ def __del__(self) -> None:103+ """104+ Guarantee that embedded file-like objects are closed in a105+ predictable order, protecting against races between106+ self.output being closed and other streams being flushed on close107 108+ .. versionadded:: 8.2.2109+ """110+ self.stderr.close()111+ self.stdout.close()112+ self.output.close()113+114+115 class _NamedTextIOWrapper(io.TextIOWrapper):116 def __init__(117 self, buffer: t.BinaryIO, name: str, mode: str, **kwargs: t.Any118 ) -> None:8 unmodified lines127 @property128 def mode(self) -> str:129 return self._mode130 131+ def __next__(self) -> str: # type: ignore132+ try:133+ line = super().__next__()134+ except StopIteration as e:135+ raise EOFError() from e136+ return line137 138+139 def make_input_stream(140 input: str | bytes | t.IO[t.Any] | None, charset: str141 ) -> t.BinaryIO:142 # Is already an input stream.216 unmodified lines359 360 @_pause_echo(echo_input) # type: ignore361 def visible_input(prompt: str | None = None) -> str:362 sys.stdout.write(prompt or "")344- val = text_input.readline().rstrip("\r\n")363+ val = next(text_input).rstrip("\r\n")364 sys.stdout.write(f"{val}\n")365 sys.stdout.flush()366 return val367 368 @_pause_echo(echo_input) # type: ignore369 def hidden_input(prompt: str | None = None) -> str:370 sys.stdout.write(f"{prompt or ''}\n")371 sys.stdout.flush()353- return text_input.readline().rstrip("\r\n")372+ return next(text_input).rstrip("\r\n")373 374 @_pause_echo(echo_input) # type: ignore375 def _getchar(echo: bool) -> str:376 char = sys.stdin.read(1)16 unmodified lines393 old_visible_prompt_func = termui.visible_prompt_func394 old_hidden_prompt_func = termui.hidden_prompt_func395 old__getchar_func = termui._getchar396 old_should_strip_ansi = utils.should_strip_ansi # type: ignore397+ old__compat_should_strip_ansi = _compat.should_strip_ansi398 termui.visible_prompt_func = visible_input399 termui.hidden_prompt_func = hidden_input400 termui._getchar = _getchar401 utils.should_strip_ansi = should_strip_ansi # type: ignore26 unmodified lines428 termui.visible_prompt_func = old_visible_prompt_func429 termui.hidden_prompt_func = old_hidden_prompt_func430 termui._getchar = old__getchar_func431 utils.should_strip_ansi = old_should_strip_ansi # type: ignore432+ _compat.should_strip_ansi = old__compat_should_strip_ansi433 formatting.FORCED_WIDTH = old_forced_width434 435 def invoke(436 self,91 unmodified lines528 exit_code = 1529 exc_info = sys.exc_info()530 finally:531 sys.stdout.flush()532+ sys.stderr.flush()533 stdout = outstreams[0].getvalue()534 stderr = outstreams[1].getvalue()535 output = outstreams[2].getvalue()536 41 unmodified linesmodified:src/click/types.py+164 added-64 removed
1 from __future__ import annotations2 3 import collections.abc as cabc4+import enum5 import os6 import stat7 import sys8 import typing as t14 unmodified lines23 from .core import Context24 from .core import Parameter25 from .shell_completion import CompletionItem26 27+ParamTypeValue = t.TypeVar("ParamTypeValue")28 29+30 class ParamType:31 """Represents the type of a parameter. Validates and converts values32 from the command line or Python into the correct type.33 54 unmodified lines88 ) -> t.Any:89 if value is not None:90 return self.convert(value, param, ctx)91 89- def get_metavar(self, param: Parameter) -> str | None:92+ def get_metavar(self, param: Parameter, ctx: Context) -> str | None:93 """Returns the metavar default for this param if it provides one."""94 92- def get_missing_message(self, param: Parameter) -> str | None:95+ def get_missing_message(self, param: Parameter, ctx: Context | None) -> str | None:96 """Optionally might return extra information about a missing97 parameter.98 99 .. versionadded:: 2.0129 unmodified lines229 def __repr__(self) -> str:230 return "STRING"231 232 230-class Choice(ParamType):233+class Choice(ParamType, t.Generic[ParamTypeValue]):234 """The choice type allows a value to be checked against a fixed set232- of supported values. All of these values have to be strings.235+ of supported values.236 234- You should only pass a list or tuple of choices. Other iterables235- (like generators) may lead to surprising results.237+ You may pass any iterable value which will be converted to a tuple238+ and thus will only be iterated once.239 237- The resulting value will always be one of the originally passed choices238- regardless of ``case_sensitive`` or any ``ctx.token_normalize_func``239- being specified.240+ The resulting value will always be one of the originally passed choices.241+ See :meth:`normalize_choice` for more info on the mapping of strings242+ to choices. See :ref:`choice-opts` for an example.243 241- See :ref:`choice-opts` for an example.242-244 :param case_sensitive: Set to false to make choices case245 insensitive. Defaults to true.246+247+ .. versionchanged:: 8.2.0248+ Non-``str`` ``choices`` are now supported. It can additionally be any249+ iterable. Before you were not recommended to pass anything but a list or250+ tuple.251+252+ .. versionadded:: 8.2.0253+ Choice normalization can be overridden via :meth:`normalize_choice`.254 """255 256 name = "choice"257 258 def __init__(250- self, choices: cabc.Sequence[str], case_sensitive: bool = True259+ self, choices: cabc.Iterable[ParamTypeValue], case_sensitive: bool = True260 ) -> None:252- self.choices = choices261+ self.choices: cabc.Sequence[ParamTypeValue] = tuple(choices)262 self.case_sensitive = case_sensitive263 264 def to_info_dict(self) -> dict[str, t.Any]:265 info_dict = super().to_info_dict()266 info_dict["choices"] = self.choices267 info_dict["case_sensitive"] = self.case_sensitive268 return info_dict269 270+ def _normalized_mapping(271+ self, ctx: Context | None = None272+ ) -> cabc.Mapping[ParamTypeValue, str]:273+ """274+ Returns mapping where keys are the original choices and the values are275+ the normalized values that are accepted via the command line.276+277+ This is a simple wrapper around :meth:`normalize_choice`, use that278+ instead which is supported.279+ """280+ return {281+ choice: self.normalize_choice(282+ choice=choice,283+ ctx=ctx,284+ )285+ for choice in self.choices286+ }287+288+ def normalize_choice(self, choice: ParamTypeValue, ctx: Context | None) -> str:289+ """290+ Normalize a choice value, used to map a passed string to a choice.291+ Each choice must have a unique normalized value.292+293+ By default uses :meth:`Context.token_normalize_func` and if not case294+ sensitive, convert it to a casefolded value.295+296+ .. versionadded:: 8.2.0297+ """298+ normed_value = choice.name if isinstance(choice, enum.Enum) else str(choice)299+300+ if ctx is not None and ctx.token_normalize_func is not None:301+ normed_value = ctx.token_normalize_func(normed_value)302+303+ if not self.case_sensitive:304+ normed_value = normed_value.casefold()305+306+ return normed_value307+261- def get_metavar(self, param: Parameter) -> str:308+ def get_metavar(self, param: Parameter, ctx: Context) -> str | None:309 if param.param_type_name == "option" and not param.show_choices: # type: ignore310 choice_metavars = [311 convert_type(type(choice)).name.upper() for choice in self.choices312 ]313 choices_str = "|".join([*dict.fromkeys(choice_metavars)])314 else:268- choices_str = "|".join([str(i) for i in self.choices])315+ choices_str = "|".join(316+ [str(i) for i in self._normalized_mapping(ctx=ctx).values()]317+ )318 319 # Use curly braces to indicate a required argument.320 if param.required and param.param_type_name == "argument":321 return f"{{{choices_str}}}"322 323 # Use square braces to indicate an option or optional argument.324 return f"[{choices_str}]"325 277- def get_missing_message(self, param: Parameter) -> str:278- return _("Choose from:\n\t{choices}").format(choices=",\n\t".join(self.choices))326+ def get_missing_message(self, param: Parameter, ctx: Context | None) -> str:327+ """328+ Message shown when no choice is passed.329 330+ .. versionchanged:: 8.2.0 Added ``ctx`` argument.331+ """332+ return _("Choose from:\n\t{choices}").format(333+ choices=",\n\t".join(self._normalized_mapping(ctx=ctx).values())334+ )335+336 def convert(337 self, value: t.Any, param: Parameter | None, ctx: Context | None282- ) -> t.Any:283- # Match through normalization and case sensitivity284- # first do token_normalize_func, then lowercase285- # preserve original `value` to produce an accurate message in286- # `self.fail`287- normed_value = value288- normed_choices = {choice: choice for choice in self.choices}338+ ) -> ParamTypeValue:339+ """340+ For a given value from the parser, normalize it and find its341+ matching normalized value in the list of choices. Then return the342+ matched "original" choice.343+ """344+ normed_value = self.normalize_choice(choice=value, ctx=ctx)345+ normalized_mapping = self._normalized_mapping(ctx=ctx)346 290- if ctx is not None and ctx.token_normalize_func is not None:291- normed_value = ctx.token_normalize_func(value)292- normed_choices = {293- ctx.token_normalize_func(normed_choice): original294- for normed_choice, original in normed_choices.items()295- }347+ try:348+ return next(349+ original350+ for original, normalized in normalized_mapping.items()351+ if normalized == normed_value352+ )353+ except StopIteration:354+ self.fail(355+ self.get_invalid_choice_message(value=value, ctx=ctx),356+ param=param,357+ ctx=ctx,358+ )359 297- if not self.case_sensitive:298- normed_value = normed_value.casefold()299- normed_choices = {300- normed_choice.casefold(): original301- for normed_choice, original in normed_choices.items()302- }303-304- if normed_value in normed_choices:305- return normed_choices[normed_value]306-307- self.fail(self.get_invalid_choice_message(value), param, ctx)308-309- def get_invalid_choice_message(self, value: t.Any) -> str:360+ def get_invalid_choice_message(self, value: t.Any, ctx: Context | None) -> str:361 """Get the error message when the given choice is invalid.362 363 :param value: The invalid value.364 365 .. versionadded:: 8.2366 """316- choices_str = ", ".join(map(repr, self.choices))367+ choices_str = ", ".join(map(repr, self._normalized_mapping(ctx=ctx).values()))368 return ngettext(369 "{value!r} is not {choice}.",370 "{value!r} is not one of {choices}.",371 len(self.choices),60 unmodified lines432 info_dict = super().to_info_dict()433 info_dict["formats"] = self.formats434 return info_dict435 385- def get_metavar(self, param: Parameter) -> str:436+ def get_metavar(self, param: Parameter, ctx: Context) -> str | None:437 return f"[{'|'.join(self.formats)}]"438 439 def _try_to_convert_date(self, value: t.Any, format: str) -> datetime | None:440 try:210 unmodified lines651 def _clamp(self, bound: float, dir: t.Literal[1, -1], open: bool) -> float:652 if not open:653 return bound654 604- # Could use Python 3.9's math.nextafter here, but clamping an655+ # Could use math.nextafter here, but clamping an656 # open float range doesn't seem to be particularly useful. It's657 # left up to the user to write a callback to do it if needed.658 raise RuntimeError("Clamping is not supported for open bounds.")659 660 661 class BoolParamType(ParamType):662 name = "boolean"663 613- def convert(614- self, value: t.Any, param: Parameter | None, ctx: Context | None615- ) -> t.Any:616- if value in {False, True}:617- return bool(value)664+ bool_states: dict[str, bool] = {665+ "1": True,666+ "0": False,667+ "yes": True,668+ "no": False,669+ "true": True,670+ "false": False,671+ "on": True,672+ "off": False,673+ "t": True,674+ "f": False,675+ "y": True,676+ "n": False,677+ # Absence of value is considered False.678+ "": False,679+ }680+ """A mapping of string values to boolean states.681 619- norm = value.strip().lower()682+ Mapping is inspired by :py:attr:`configparser.ConfigParser.BOOLEAN_STATES`683+ and extends it.684 621- if norm in {"1", "true", "t", "yes", "y", "on"}:622- return True685+ .. caution::686+ String values are lower-cased, as the ``str_to_bool`` comparison function687+ below is case-insensitive.688 624- if norm in {"0", "false", "f", "no", "n", "off"}:625- return False689+ .. warning::690+ The mapping is not exhaustive, and does not cover all possible boolean strings691+ representations. It will remains as it is to avoid endless bikeshedding.692 627- self.fail(628- _("{value!r} is not a valid boolean.").format(value=value), param, ctx629- )693+ Future work my be considered to make this mapping user-configurable from public694+ API.695+ """696 697+ @staticmethod698+ def str_to_bool(value: str | bool) -> bool | None:699+ """Convert a string to a boolean value.700+701+ If the value is already a boolean, it is returned as-is. If the value is a702+ string, it is stripped of whitespaces and lower-cased, then checked against703+ the known boolean states pre-defined in the `BoolParamType.bool_states` mapping704+ above.705+706+ Returns `None` if the value does not match any known boolean state.707+ """708+ if isinstance(value, bool):709+ return value710+ return BoolParamType.bool_states.get(value.strip().lower())711+712+ def convert(713+ self, value: t.Any, param: Parameter | None, ctx: Context | None714+ ) -> bool:715+ normalized = self.str_to_bool(value)716+ if normalized is None:717+ self.fail(718+ _(719+ "{value!r} is not a valid boolean. Recognized values: {states}"720+ ).format(value=value, states=", ".join(sorted(self.bool_states))),721+ param,722+ ctx,723+ )724+ return normalized725+726 def __repr__(self) -> str:727 return "BOOL"728 729 39 unmodified lines769 file lazily for reading, it is still opened temporarily for validation, but770 will not be held open until first IO. lazy is mainly useful when opening771 for writing to avoid creating the file until it is needed.772 678- Starting with Click 2.0, files can also be opened atomically in which679- case all writes go into a separate file in the same folder and upon680- completion the file will be moved over to the original location. This681- is useful if a file regularly read by other users is modified.773+ Files can also be opened atomically in which case all writes go into a774+ separate file in the same folder and upon completion the file will775+ be moved over to the original location. This is useful if a file776+ regularly read by other users is modified.777 778 See :ref:`file-args` for more information.779+780+ .. versionchanged:: 2.0781+ Added the ``atomic`` parameter.782 """783 784 name = "filename"785 envvar_list_splitter: t.ClassVar[str] = os.path.pathsep317 unmodified lines1103 param=param,1104 ctx=ctx,1105 )1106 1009- return tuple(ty(x, param, ctx) for ty, x in zip(self.types, value))1107+ return tuple(1108+ ty(x, param, ctx) for ty, x in zip(self.types, value, strict=False)1109+ )1110 1111 1112 def convert_type(ty: t.Any | None, default: t.Any | None = None) -> ParamType:1113 """Find the most appropriate :class:`ParamType` for the given Python96 unmodified linesmodified:src/click/utils.py+1 added-1 removed
275 unmodified lines276 return277 278 # Convert non bytes/text into the native string type.279 if message is not None and not isinstance(message, (str, bytes, bytearray)):280- out: str | bytes | None = str(message)280+ out: str | bytes | bytearray | None = str(message)281 else:282 out = message283 284 if nl:343 unmodified linesmodified:tests/typing/typing_aliased_group.py+1 added-1 removed
1-"""Example from https://click.palletsprojects.com/en/8.1.x/advanced/#command-aliases"""1+"""Example from https://click.palletsprojects.com/en/stable/advanced/#command-aliases"""2 3 from __future__ import annotations4 5 from typing_extensions import assert_type41 unmodified linesmodified:tests/typing/typing_confirmation_option.py+1 added-1 removed
1-"""From https://click.palletsprojects.com/en/8.1.x/options/#yes-parameters"""1+"""From https://click.palletsprojects.com/en/stable/options/#yes-parameters"""2 3 from typing_extensions import assert_type4 5 import click9 unmodified linesmodified:tests/typing/typing_options.py+1 added-1 removed
1-"""From https://click.palletsprojects.com/en/8.1.x/quickstart/#adding-parameters"""1+"""From https://click.palletsprojects.com/en/stable/quickstart/#adding-parameters"""2 3 from typing_extensions import assert_type4 5 import click11 unmodified linesmodified:tests/typing/typing_version_option.py+1 added-1 removed
1 """2-From https://click.palletsprojects.com/en/8.1.x/options/#callbacks-and-eager-options.2+From https://click.palletsprojects.com/en/stable/options/#callbacks-and-eager-options.3 """4 5 from typing_extensions import assert_type6 10 unmodified linesmodified:tests/test_arguments.py+12 added-16 removed
61 unmodified lines62 assert result.exception is None63 assert result.output.splitlines() == ["name=peter id=1"]64 65 66+def test_nargs_mismatch_with_tuple_type():67+ with pytest.raises(ValueError, match="nargs.*must be 2.*but it was 3"):68+69+ @click.command()70+ @click.argument("test", type=(str, int), nargs=3)71+ def cli(_):72+ pass73+74+75 def test_nargs_err(runner):76 @click.command()77 @click.argument("x")78 def copy(x):11 unmodified lines90 def test_bytes_args(runner, monkeypatch):91 @click.command()92 @click.argument("arg")93 def from_bytes(arg):85- assert isinstance(86- arg, str87- ), "UTF-8 encoded argument should be implicitly converted to Unicode"94+ assert isinstance(arg, str), (95+ "UTF-8 encoded argument should be implicitly converted to Unicode"96+ )97 98 # Simulate empty locale environment variables99 monkeypatch.setattr(sys, "getfilesystemencoding", lambda: "utf-8")100 monkeypatch.setattr(sys, "getdefaultencoding", lambda: "utf-8")105 unmodified lines206 else:207 assert result.return_value == expect208 209 201-def test_envvar_flag_value(runner):202- @click.command()203- # is_flag is implicitly true204- @click.option("--upper", flag_value="upper", envvar="UPPER")205- def cmd(upper):206- click.echo(upper)207- return upper208-209- # For whatever value of the `env` variable, if it exists, the flag should be `upper`210- result = runner.invoke(cmd, env={"UPPER": "whatever"})211- assert result.output.strip() == "upper"212-213-210 def test_nargs_envvar_only_if_values_empty(runner):211 @click.command()212 @click.argument("arg", envvar="X", nargs=-1)213 def cli(arg):257 unmodified linesmodified:tests/test_basic.py+88 added-5 removed
1+from __future__ import annotations2+3+import enum4 import os5 from itertools import chain6 7 import pytest213 unmodified lines221 result = runner.invoke(cli, args, standalone_mode=False)222 assert result.return_value is expect223 224 222-@pytest.mark.parametrize("default", [True, False])223-@pytest.mark.parametrize(("args", "expect"), [(["--f"], True), ([], False)])225+@pytest.mark.parametrize(226+ ("default", "args", "expect"),227+ (228+ (True, ["--f"], True),229+ (True, [], True),230+ (False, ["--f"], True),231+ (False, [], False),232+ ),233+)234 def test_boolean_flag(runner, default, args, expect):235 @click.command()236 @click.option("--f", is_flag=True, default=default)237 def cli(f):238 return f239 230- if default:231- expect = not expect232-240 result = runner.invoke(cli, args, standalone_mode=False)241 assert result.return_value is expect242 243 165 unmodified lines409 result = runner.invoke(cli, ["--help"])410 assert "{foo|bar|baz}" in result.output411 412 413+def test_choice_argument_enum(runner):414+ class MyEnum(str, enum.Enum):415+ FOO = "foo-value"416+ BAR = "bar-value"417+ BAZ = "baz-value"418+419+ @click.command()420+ @click.argument("method", type=click.Choice(MyEnum, case_sensitive=False))421+ def cli(method: MyEnum):422+ assert isinstance(method, MyEnum)423+ click.echo(method)424+425+ result = runner.invoke(cli, ["foo"])426+ assert result.output == "foo-value\n"427+ assert not result.exception428+429+ result = runner.invoke(cli, ["meh"])430+ assert result.exit_code == 2431+ assert (432+ "Invalid value for '{foo|bar|baz}': 'meh' is not one of 'foo',"433+ " 'bar', 'baz'." in result.output434+ )435+436+ result = runner.invoke(cli, ["--help"])437+ assert "{foo|bar|baz}" in result.output438+439+440+def test_choice_argument_custom_type(runner):441+ class MyClass:442+ def __init__(self, value: str) -> None:443+ self.value = value444+445+ def __str__(self) -> str:446+ return self.value447+448+ @click.command()449+ @click.argument(450+ "method", type=click.Choice([MyClass("foo"), MyClass("bar"), MyClass("baz")])451+ )452+ def cli(method: MyClass):453+ assert isinstance(method, MyClass)454+ click.echo(method)455+456+ result = runner.invoke(cli, ["foo"])457+ assert not result.exception458+ assert result.output == "foo\n"459+460+ result = runner.invoke(cli, ["meh"])461+ assert result.exit_code == 2462+ assert (463+ "Invalid value for '{foo|bar|baz}': 'meh' is not one of 'foo',"464+ " 'bar', 'baz'." in result.output465+ )466+467+ result = runner.invoke(cli, ["--help"])468+ assert "{foo|bar|baz}" in result.output469+470+471+def test_choice_argument_none(runner):472+ @click.command()473+ @click.argument(474+ "method", type=click.Choice(["not-none", None], case_sensitive=False)475+ )476+ def cli(method: str | None):477+ assert isinstance(method, str) or method is None478+ click.echo(method)479+480+ result = runner.invoke(cli, ["not-none"])481+ assert not result.exception482+ assert result.output == "not-none\n"483+484+ # None is not yet supported.485+ result = runner.invoke(cli, ["none"])486+ assert result.exception487+488+489 def test_datetime_option_default(runner):490 @click.command()491 @click.option("--start_date", type=click.DateTime())492 def cli(start_date):166 unmodified linesmodified:tests/test_chain.py+2 added-2 removed
161 unmodified lines162 163 return processor164 165 result = runner.invoke(cli, args, input=input)166- assert not result.exception167- assert result.output.splitlines() == expect166+ # last two lines are '' and 'Aborted!'167+ assert result.output.splitlines()[:-2] == expect168 169 170 def test_args_and_chain(runner):171 @click.group(chain=True)74 unmodified linesmodified:tests/test_commands.py+132 added
299 unmodified lines300 result = runner.invoke(cli, ["b"], default_map={"b": {"x": 3}})301 assert result.exit_code == 0302 303 304+@pytest.mark.parametrize(305+ ("invocation_order", "declaration_order", "expected_order"),306+ [307+ # Non-eager options.308+ ([], ["-a"], ["-a"]),309+ (["-a"], ["-a"], ["-a"]),310+ ([], ["-a", "-c"], ["-a", "-c"]),311+ (["-a"], ["-a", "-c"], ["-a", "-c"]),312+ (["-c"], ["-a", "-c"], ["-c", "-a"]),313+ ([], ["-c", "-a"], ["-c", "-a"]),314+ (["-a"], ["-c", "-a"], ["-a", "-c"]),315+ (["-c"], ["-c", "-a"], ["-c", "-a"]),316+ (["-a", "-c"], ["-a", "-c"], ["-a", "-c"]),317+ (["-c", "-a"], ["-a", "-c"], ["-c", "-a"]),318+ # Eager options.319+ ([], ["-b"], ["-b"]),320+ (["-b"], ["-b"], ["-b"]),321+ ([], ["-b", "-d"], ["-b", "-d"]),322+ (["-b"], ["-b", "-d"], ["-b", "-d"]),323+ (["-d"], ["-b", "-d"], ["-d", "-b"]),324+ ([], ["-d", "-b"], ["-d", "-b"]),325+ (["-b"], ["-d", "-b"], ["-b", "-d"]),326+ (["-d"], ["-d", "-b"], ["-d", "-b"]),327+ (["-b", "-d"], ["-b", "-d"], ["-b", "-d"]),328+ (["-d", "-b"], ["-b", "-d"], ["-d", "-b"]),329+ # Mixed options.330+ ([], ["-a", "-b", "-c", "-d"], ["-b", "-d", "-a", "-c"]),331+ (["-a"], ["-a", "-b", "-c", "-d"], ["-b", "-d", "-a", "-c"]),332+ (["-b"], ["-a", "-b", "-c", "-d"], ["-b", "-d", "-a", "-c"]),333+ (["-c"], ["-a", "-b", "-c", "-d"], ["-b", "-d", "-c", "-a"]),334+ (["-d"], ["-a", "-b", "-c", "-d"], ["-d", "-b", "-a", "-c"]),335+ (["-a", "-b"], ["-a", "-b", "-c", "-d"], ["-b", "-d", "-a", "-c"]),336+ (["-b", "-a"], ["-a", "-b", "-c", "-d"], ["-b", "-d", "-a", "-c"]),337+ (["-d", "-c"], ["-a", "-b", "-c", "-d"], ["-d", "-b", "-c", "-a"]),338+ (["-c", "-d"], ["-a", "-b", "-c", "-d"], ["-d", "-b", "-c", "-a"]),339+ (["-a", "-b", "-c", "-d"], ["-a", "-b", "-c", "-d"], ["-b", "-d", "-a", "-c"]),340+ (["-b", "-d", "-a", "-c"], ["-a", "-b", "-c", "-d"], ["-b", "-d", "-a", "-c"]),341+ ([], ["-b", "-d", "-e", "-a", "-c"], ["-b", "-d", "-e", "-a", "-c"]),342+ (["-a", "-d"], ["-b", "-d", "-e", "-a", "-c"], ["-d", "-b", "-e", "-a", "-c"]),343+ (["-c", "-d"], ["-b", "-d", "-e", "-a", "-c"], ["-d", "-b", "-e", "-c", "-a"]),344+ ],345+)346+def test_iter_params_for_processing(347+ invocation_order, declaration_order, expected_order348+):349+ parameters = {350+ "-a": click.Option(["-a"]),351+ "-b": click.Option(["-b"], is_eager=True),352+ "-c": click.Option(["-c"]),353+ "-d": click.Option(["-d"], is_eager=True),354+ "-e": click.Option(["-e"], is_eager=True),355+ }356+357+ invocation_params = [parameters[opt_id] for opt_id in invocation_order]358+ declaration_params = [parameters[opt_id] for opt_id in declaration_order]359+ expected_params = [parameters[opt_id] for opt_id in expected_order]360+361+ assert (362+ click.core.iter_params_for_processing(invocation_params, declaration_params)363+ == expected_params364+ )365+366+367+def test_help_param_priority(runner):368+ """Cover the edge-case in which the eagerness of help option was not369+ respected, because it was internally generated multiple times.370+371+ See: https://github.com/pallets/click/pull/2811372+ """373+374+ def print_and_exit(ctx, param, value):375+ if value:376+ click.echo(f"Value of {param.name} is: {value}")377+ ctx.exit()378+379+ @click.command(context_settings={"help_option_names": ("--my-help",)})380+ @click.option("-a", is_flag=True, expose_value=False, callback=print_and_exit)381+ @click.option(382+ "-b", is_flag=True, expose_value=False, callback=print_and_exit, is_eager=True383+ )384+ def cli():385+ pass386+387+ # --my-help is properly called and stop execution.388+ result = runner.invoke(cli, ["--my-help"])389+ assert "Value of a is: True" not in result.stdout390+ assert "Value of b is: True" not in result.stdout391+ assert "--my-help" in result.stdout392+ assert result.exit_code == 0393+394+ # -a is properly called and stop execution.395+ result = runner.invoke(cli, ["-a"])396+ assert "Value of a is: True" in result.stdout397+ assert "Value of b is: True" not in result.stdout398+ assert "--my-help" not in result.stdout399+ assert result.exit_code == 0400+401+ # -a takes precedence over -b and stop execution.402+ result = runner.invoke(cli, ["-a", "-b"])403+ assert "Value of a is: True" not in result.stdout404+ assert "Value of b is: True" in result.stdout405+ assert "--my-help" not in result.stdout406+ assert result.exit_code == 0407+408+ # --my-help is eager by default so takes precedence over -a and stop409+ # execution, whatever the order.410+ for args in [["-a", "--my-help"], ["--my-help", "-a"]]:411+ result = runner.invoke(cli, args)412+ assert "Value of a is: True" not in result.stdout413+ assert "Value of b is: True" not in result.stdout414+ assert "--my-help" in result.stdout415+ assert result.exit_code == 0416+417+ # Both -b and --my-help are eager so they're called in the order they're418+ # invoked by the user.419+ result = runner.invoke(cli, ["-b", "--my-help"])420+ assert "Value of a is: True" not in result.stdout421+ assert "Value of b is: True" in result.stdout422+ assert "--my-help" not in result.stdout423+ assert result.exit_code == 0424+425+ # But there was a bug when --my-help is called before -b, because the426+ # --my-help option created by click via help_option_names is internally427+ # created twice and is not the same object, breaking the priority order428+ # produced by iter_params_for_processing.429+ result = runner.invoke(cli, ["--my-help", "-b"])430+ assert "Value of a is: True" not in result.stdout431+ assert "Value of b is: True" not in result.stdout432+ assert "--my-help" in result.stdout433+ assert result.exit_code == 0434+435+436 def test_unprocessed_options(runner):437 @click.command(context_settings=dict(ignore_unknown_options=True))438 @click.argument("args", nargs=-1, type=click.UNPROCESSED)439 @click.option("--verbose", "-v", count=True)108 unmodified linesmodified:tests/test_formatting.py+1 added-1 removed
246 unmodified lines247 248 249 def test_formatting_custom_type_metavar(runner):250 class MyType(click.ParamType):251- def get_metavar(self, param):251+ def get_metavar(self, param: click.Parameter, ctx: click.Context):252 return "MY_TYPE"253 254 @click.command("foo")255 @click.help_option()113 unmodified linesmodified:tests/test_imports.py+16 added-14 removed
25 unmodified lines26 """27 28 ALLOWED_IMPORTS = {29 "__future__",30- "weakref",31- "os",32- "struct",30+ "codecs",31 "collections",32 "collections.abc",35- "sys",33+ "configparser",34 "contextlib",35+ "datetime",36+ "enum",37+ "errno",38+ "fcntl",39 "functools",38- "stat",39- "re",40- "codecs",40+ "gettext",41 "inspect",42- "itertools",42 "io",43+ "itertools",44+ "os",45+ "re",46+ "shutil",47+ "stat",48+ "struct",49+ "sys",50 "threading",45- "errno",46- "fcntl",47- "datetime",48- "enum",49- "typing",51 "types",51- "gettext",52+ "typing",53+ "weakref",54 }55 56 if WIN:57 ALLOWED_IMPORTS.update(["ctypes", "ctypes.wintypes", "msvcrt", "time"])14 unmodified linesmodified:tests/test_info_dict.py+2 added-2 removed
104 unmodified lines105 id="UNPROCESSED ParamType",106 ),107 pytest.param(*STRING_PARAM_TYPE, id="STRING ParamType"),108 pytest.param(109- click.Choice(["a", "b"]),109+ click.Choice(("a", "b")),110 {111 "param_type": "Choice",112 "name": "choice",113- "choices": ["a", "b"],113+ "choices": ("a", "b"),114 "case_sensitive": True,115 },116 id="Choice ParamType",117 ),158 unmodified linesmodified:tests/test_normalization.py+30 added-5 removed
15 unmodified lines16 17 18 def test_choice_normalization(runner):19 @click.command(context_settings=CONTEXT_SETTINGS)20- @click.option("--choice", type=click.Choice(["Foo", "Bar"]))21- def cli(choice):22- click.echo(choice)20+ @click.option(21+ "--method",22+ type=click.Choice(23+ ["SCREAMING_SNAKE_CASE", "snake_case", "PascalCase", "kebab-case"],24+ case_sensitive=False,25+ ),26+ )27+ def cli(method):28+ click.echo(method)29 24- result = runner.invoke(cli, ["--CHOICE", "FOO"])25- assert result.output == "Foo\n"30+ result = runner.invoke(cli, ["--METHOD=snake_case"])31+ assert not result.exception, result.output32+ assert result.output == "snake_case\n"33 34+ # Even though it's case sensitive, the choice's original value is preserved35+ result = runner.invoke(cli, ["--method=pascalcase"])36+ assert not result.exception, result.output37+ assert result.output == "PascalCase\n"38 39+ result = runner.invoke(cli, ["--method=meh"])40+ assert result.exit_code == 241+ assert (42+ "Invalid value for '--method': 'meh' is not one of "43+ "'screaming_snake_case', 'snake_case', 'pascalcase', 'kebab-case'."44+ ) in result.output45+46+ result = runner.invoke(cli, ["--help"])47+ assert (48+ "--method [screaming_snake_case|snake_case|pascalcase|kebab-case]"49+ in result.output50+ )51+52+53 def test_command_normalization(runner):54 @click.group(context_settings=CONTEXT_SETTINGS)55 def cli():56 pass7 unmodified linesmodified:tests/test_options.py+427 added-5 removed
1+import enum2 import os3 import re4+import sys5 6+if sys.version_info < (3, 11):7+ enum.StrEnum = enum.Enum # type: ignore[assignment]8+9 import pytest10 11 import click12 from click import Option238 unmodified lines251 assert not result.exception252 assert result.output == "foo|bar\n"253 254 250-def test_trailing_blanks_boolean_envvar(runner):255+@pytest.mark.parametrize(256+ ("name", "value", "expected"),257+ (258+ # Lower-cased variations of value.259+ ("SHOUT", "true", True),260+ ("SHOUT", "false", False),261+ # Title-cased variations of value.262+ ("SHOUT", "True", True),263+ ("SHOUT", "False", False),264+ # Upper-cased variations of value.265+ ("SHOUT", "TRUE", True),266+ ("SHOUT", "FALSE", False),267+ # Random-cased variations of value.268+ ("SHOUT", "TruE", True),269+ ("SHOUT", "truE", True),270+ ("SHOUT", "FaLsE", False),271+ ("SHOUT", "falsE", False),272+ # Extra spaces around the value.273+ ("SHOUT", "true ", True),274+ ("SHOUT", " true", True),275+ ("SHOUT", " true ", True),276+ ("SHOUT", "false ", False),277+ ("SHOUT", " false", False),278+ ("SHOUT", " false ", False),279+ # Integer variations.280+ ("SHOUT", "1", True),281+ ("SHOUT", "0", False),282+ # Alternative states.283+ ("SHOUT", "t", True),284+ ("SHOUT", "f", False),285+ ("SHOUT", "y", True),286+ ("SHOUT", "n", False),287+ ("SHOUT", "yes", True),288+ ("SHOUT", "no", False),289+ ("SHOUT", "on", True),290+ ("SHOUT", "off", False),291+ # Blank value variations.292+ ("SHOUT", None, False),293+ ("SHOUT", "", False),294+ ("SHOUT", " ", False),295+ ("SHOUT", " ", False),296+ # Variable names are not stripped of spaces and so don't match the297+ # flag, which then naturraly takes its default value.298+ ("SHOUT ", "True", False),299+ ("SHOUT ", "False", False),300+ (" SHOUT ", "True", False),301+ (" SHOUT ", "False", False),302+ # Same for random and reverse environment variable names: they are not303+ # recognized by the option.304+ ("RANDOM", "True", False),305+ ("NO_SHOUT", "True", False),306+ ("NO_SHOUT", "False", False),307+ ),308+)309+def test_boolean_envvar_normalization(runner, name, value, expected):310 @click.command()311 @click.option("--shout/--no-shout", envvar="SHOUT")312 def cli(shout):313 click.echo(f"shout: {shout!r}")314 256- result = runner.invoke(cli, [], env={"SHOUT": " true "})315+ result = runner.invoke(cli, [], env={name: value})316 assert result.exit_code == 0258- assert result.output == "shout: True\n"317+ assert result.output == f"shout: {expected}\n"318 319 320+@pytest.mark.parametrize(321+ ("name", "value"),322+ (323+ ("SHOUT", "tr ue"),324+ ("SHOUT", "10"),325+ ("SHOUT", "01"),326+ ("SHOUT", "00"),327+ ("SHOUT", "11"),328+ ("SHOUT", "randomstring"),329+ ("SHOUT", "None"),330+ ),331+)332+def test_boolean_envvar_bad_values(runner, name, value):333+ @click.command()334+ @click.option("--shout/--no-shout", envvar="SHOUT")335+ def cli(shout):336+ click.echo(f"shout: {shout!r}")337+338+ result = runner.invoke(cli, [], env={name: value})339+ assert result.exit_code == 2340+ assert (341+ f"Invalid value for '--shout': {value!r} is not a valid boolean."342+ in result.output343+ )344+345+346 def test_multiple_default_help(runner):347 @click.command()348 @click.option("--arg1", multiple=True, default=("foo", "bar"), show_default=True)349 @click.option("--arg2", multiple=True, default=(1, 2), type=int, show_default=True)326 unmodified lines676 result = runner.invoke(cli)677 assert result.exit_code == 2678 assert "Error: Missing option '--foo' (env var: 'bar')." in result.output679 680+ cli = click.Command(681+ "cli", params=[click.Option(["--foo"], show_envvar=True, required=True)]682+ )683+ result = runner.invoke(cli)684+ assert result.exit_code == 2685+ assert "Error: Missing option '--foo'." in result.output686 687+688 def test_case_insensitive_choice(runner):689 @click.command()690 @click.option("--foo", type=click.Choice(["Orange", "Apple"], case_sensitive=False))691 def cmd(foo):123 unmodified lines815 assert "I am a help text" in result.output816 assert "you wont see me" not in result.output817 818 819+@pytest.mark.parametrize("custom_class", (True, False))820+@pytest.mark.parametrize(821+ ("name_specs", "expected"),822+ (823+ (824+ ("-h", "--help"),825+ " -h, --help Show this message and exit.\n",826+ ),827+ (828+ ("-h",),829+ " -h Show this message and exit.\n"830+ " --help Show this message and exit.\n",831+ ),832+ (833+ ("--help",),834+ " --help Show this message and exit.\n",835+ ),836+ ),837+)838+def test_help_option_custom_names_and_class(runner, custom_class, name_specs, expected):839+ class CustomHelpOption(click.Option):840+ pass841+842+ option_attrs = {}843+ if custom_class:844+ option_attrs["cls"] = CustomHelpOption845+846+ @click.command()847+ @click.help_option(*name_specs, **option_attrs)848+ def cmd():849+ pass850+851+ for arg in name_specs:852+ result = runner.invoke(cmd, [arg])853+ assert not result.exception854+ assert result.exit_code == 0855+ assert expected in result.output856+857+858 def test_bool_flag_with_type(runner):859 @click.command()860 @click.option("--shout/--no-shout", default=False, type=bool)861 def cmd(shout):237 unmodified lines1099 assert param.type is click.INT1100 1101 1102 @pytest.mark.parametrize(1103+ ("opt_params", "pass_flag", "expected"),1104+ [1105+ # Effect of the presence/absence of flag depending on type1106+ ({"type": bool}, False, False),1107+ ({"type": bool}, True, True),1108+ ({"type": click.BOOL}, False, False),1109+ ({"type": click.BOOL}, True, True),1110+ ({"type": str}, False, "False"),1111+ ({"type": str}, True, "True"),1112+ # Effects of default value1113+ ({"type": bool, "default": True}, False, True),1114+ ({"type": bool, "default": True}, True, True),1115+ ({"type": bool, "default": False}, False, False),1116+ ({"type": bool, "default": False}, True, True),1117+ ({"type": bool, "default": None}, False, False),1118+ ({"type": bool, "default": None}, True, True),1119+ ({"type": click.BOOL, "default": True}, False, True),1120+ ({"type": click.BOOL, "default": True}, True, True),1121+ ({"type": click.BOOL, "default": False}, False, False),1122+ ({"type": click.BOOL, "default": False}, True, True),1123+ ({"type": click.BOOL, "default": None}, False, False),1124+ ({"type": click.BOOL, "default": None}, True, True),1125+ ({"type": str, "default": True}, False, "True"),1126+ ({"type": str, "default": True}, True, "True"),1127+ ({"type": str, "default": False}, False, "False"),1128+ ({"type": str, "default": False}, True, "True"),1129+ ({"type": str, "default": "foo"}, False, "foo"),1130+ ({"type": str, "default": "foo"}, True, "foo"),1131+ ({"type": str, "default": None}, False, "False"),1132+ ({"type": str, "default": None}, True, "True"),1133+ # Effects of flag_value1134+ ({"type": bool, "flag_value": True}, False, False),1135+ ({"type": bool, "flag_value": True}, True, True),1136+ ({"type": bool, "flag_value": False}, False, False),1137+ ({"type": bool, "flag_value": False}, True, False),1138+ ({"type": bool, "flag_value": None}, False, False),1139+ ({"type": bool, "flag_value": None}, True, True),1140+ ({"type": click.BOOL, "flag_value": True}, False, False),1141+ ({"type": click.BOOL, "flag_value": True}, True, True),1142+ ({"type": click.BOOL, "flag_value": False}, False, False),1143+ ({"type": click.BOOL, "flag_value": False}, True, False),1144+ ({"type": click.BOOL, "flag_value": None}, False, False),1145+ ({"type": click.BOOL, "flag_value": None}, True, True),1146+ ({"type": str, "flag_value": True}, False, "False"),1147+ ({"type": str, "flag_value": True}, True, "True"),1148+ ({"type": str, "flag_value": False}, False, "False"),1149+ ({"type": str, "flag_value": False}, True, "False"),1150+ ({"type": str, "flag_value": "foo"}, False, "False"),1151+ ({"type": str, "flag_value": "foo"}, True, "foo"),1152+ ({"type": str, "flag_value": None}, False, "False"),1153+ ({"type": str, "flag_value": None}, True, "True"),1154+ # Not passing --foo returns the default value as-is1155+ ({"type": bool, "default": True, "flag_value": True}, False, True),1156+ ({"type": bool, "default": True, "flag_value": False}, False, True),1157+ ({"type": bool, "default": False, "flag_value": True}, False, False),1158+ ({"type": bool, "default": False, "flag_value": False}, False, False),1159+ ({"type": bool, "default": None, "flag_value": True}, False, False),1160+ ({"type": bool, "default": None, "flag_value": False}, False, False),1161+ ({"type": str, "default": True, "flag_value": True}, False, "True"),1162+ ({"type": str, "default": True, "flag_value": False}, False, "True"),1163+ ({"type": str, "default": False, "flag_value": True}, False, "False"),1164+ ({"type": str, "default": False, "flag_value": False}, False, "False"),1165+ ({"type": str, "default": "foo", "flag_value": True}, False, "foo"),1166+ ({"type": str, "default": "foo", "flag_value": False}, False, "foo"),1167+ ({"type": str, "default": "foo", "flag_value": "bar"}, False, "foo"),1168+ ({"type": str, "default": "foo", "flag_value": None}, False, "foo"),1169+ ({"type": str, "default": None, "flag_value": True}, False, "False"),1170+ ({"type": str, "default": None, "flag_value": False}, False, "False"),1171+ # Passing --foo returns the explicitly set flag_value1172+ ({"type": bool, "default": True, "flag_value": True}, True, True),1173+ ({"type": bool, "default": True, "flag_value": False}, True, False),1174+ ({"type": bool, "default": False, "flag_value": True}, True, True),1175+ ({"type": bool, "default": False, "flag_value": False}, True, False),1176+ ({"type": bool, "default": None, "flag_value": True}, True, True),1177+ ({"type": bool, "default": None, "flag_value": False}, True, False),1178+ ({"type": str, "default": True, "flag_value": True}, True, "True"),1179+ ({"type": str, "default": True, "flag_value": False}, True, "False"),1180+ ({"type": str, "default": False, "flag_value": True}, True, "True"),1181+ ({"type": str, "default": False, "flag_value": False}, True, "False"),1182+ ({"type": str, "default": "foo", "flag_value": True}, True, "True"),1183+ ({"type": str, "default": "foo", "flag_value": False}, True, "False"),1184+ ({"type": str, "default": "foo", "flag_value": "bar"}, True, "bar"),1185+ ({"type": str, "default": "foo", "flag_value": None}, True, "foo"),1186+ ({"type": str, "default": None, "flag_value": True}, True, "True"),1187+ ({"type": str, "default": None, "flag_value": False}, True, "False"),1188+ ],1189+)1190+def test_flag_value_and_default(runner, opt_params, pass_flag, expected):1191+ @click.command()1192+ @click.option("--foo", is_flag=True, **opt_params)1193+ def cmd(foo):1194+ click.echo(repr(foo))1195+1196+ result = runner.invoke(cmd, ["--foo"] if pass_flag else [])1197+ assert result.output == f"{expected!r}\n"1198+1199+1200+@pytest.mark.parametrize(1201+ "opts",1202+ [1203+ {"type": bool, "default": "foo"},1204+ {"type": bool, "flag_value": "foo"},1205+ {"type": click.BOOL, "default": "foo"},1206+ {"type": click.BOOL, "flag_value": "foo"},1207+ ],1208+)1209+def test_invalid_flag_definition(runner, opts):1210+ @click.command()1211+ @click.option("--foo", is_flag=True, **opts)1212+ def cmd(foo):1213+ click.echo(foo)1214+1215+ result = runner.invoke(cmd, ["--foo"])1216+ assert (1217+ "Error: Invalid value for '--foo': 'foo' is not a valid boolean"1218+ in result.output1219+ )1220+1221+1222+@pytest.mark.parametrize(1223+ ("flag_value", "envvar_value", "expected"),1224+ [1225+ # Envvar is set to false, so the flag default value is returned.1226+ ("bar", "False", "False"),1227+ # Same as above with alternative states and blank values.1228+ ("bar", "0", "False"),1229+ ("bar", "f", "False"),1230+ ("bar", "", "False"),1231+ # Envvar is set to true, so the flag_value is returned.1232+ ("bar", "True", "bar"),1233+ ("bar", "1", "bar"),1234+ ("bar", "t", "bar"),1235+ # So far we have the same cases as the test_flag_value_and_default1236+ # test case. Now instead of passing a boolean-like value, let's use1237+ # the flag_value as the envvar value.1238+ ("bar", "bar", "bar"),1239+ # flag_value is expected to be the exact same in the envvar for the flag to be1240+ # activated.1241+ ("bar", " bar ", "False"),1242+ ("bar", "BAR", "False"),1243+ ("bar", "random", "False"),1244+ ("bar", "bar random", "False"),1245+ ("bar", "random bar", "False"),1246+ ("BAR", "BAR", "BAR"),1247+ ("BAR", "bar", "False"),1248+ (" bar ", " bar ", " bar "),1249+ (" bar ", "bar", "False"),1250+ (" bar ", "BAR", "False"),1251+ ],1252+)1253+def test_envvar_flag_value(runner, flag_value, envvar_value, expected):1254+ """Ensure that flag_value is recognized by the envvar."""1255+1256+ @click.command()1257+ @click.option(1258+ "--upper", type=str, is_flag=True, flag_value=flag_value, envvar="UPPER"1259+ )1260+ def cmd(upper):1261+ click.echo(repr(upper))1262+1263+ result = runner.invoke(cmd, env={"UPPER": envvar_value})1264+ assert result.exit_code == 01265+ assert result.output == f"{expected!r}\n"1266+1267+1268+@pytest.mark.parametrize(1269 ("option", "expected"),1270 [1271 # Not boolean flags1272 pytest.param(Option(["-a"], type=int), False, id="int option"),6 unmodified lines1279 pytest.param(Option(["-a/-A"]), True, id="secondary option [implicit flag]"),1280 pytest.param(Option(["-a"], flag_value=True), True, id="bool flag_value"),1281 ],1282 )986-def test_is_bool_flag_is_correctly_set(option, expected):1283+def test_bool_flag_auto_detection(option, expected):1284 assert option.is_bool_flag is expected1285 1286 1287 @pytest.mark.parametrize(9 unmodified lines1297 1298 assert message in str(e.value)1299 1300 1301+def test_non_flag_with_non_negatable_default(runner):1302+ class NonNegatable:1303+ def __bool__(self):1304+ raise ValueError("Cannot negate this object")1305+1306+ @click.command()1307+ @click.option("--foo", default=NonNegatable())1308+ def cmd(foo):1309+ pass1310+1311+ result = runner.invoke(cmd)1312+ assert result.exit_code == 01313+1314+1315+class HashType(enum.Enum):1316+ MD5 = enum.auto()1317+ SHA1 = enum.auto()1318+1319+1320+class Number(enum.IntEnum):1321+ ONE = enum.auto()1322+ TWO = enum.auto()1323+1324+1325+class Letter(enum.StrEnum):1326+ A = enum.auto()1327+ B = enum.auto()1328+1329+1330+class Color(enum.Flag):1331+ RED = enum.auto()1332+ GREEN = enum.auto()1333+ BLUE = enum.auto()1334+1335+1336+class ColorInt(enum.IntFlag):1337+ RED = enum.auto()1338+ GREEN = enum.auto()1339+ BLUE = enum.auto()1340+1341+1342 @pytest.mark.parametrize(1343 ("choices", "metavars"),1344 [1345 pytest.param(["foo", "bar"], "[TEXT]", id="text choices"),1346 pytest.param([1, 2], "[INTEGER]", id="int choices"),1347 pytest.param([1.0, 2.0], "[FLOAT]", id="float choices"),1348 pytest.param([True, False], "[BOOLEAN]", id="bool choices"),1349 pytest.param(["foo", 1], "[TEXT|INTEGER]", id="text/int choices"),1350+ pytest.param(HashType, "[HASHTYPE]", id="enum choices"),1351+ pytest.param(Number, "[NUMBER]", id="int enum choices"),1352+ pytest.param(Letter, "[LETTER]", id="str enum choices"),1353+ pytest.param(Color, "[COLOR]", id="flag enum choices"),1354+ pytest.param(ColorInt, "[COLORINT]", id="int flag enum choices"),1355 ],1356 )1357 def test_usage_show_choices(runner, choices, metavars):1358 """When show_choices=False is set, the --help output14 unmodified lines1373 def cli_without_choices(g):1374 pass1375 1376 result = runner.invoke(cli_with_choices, ["--help"])1034- assert f"[{'|'.join([str(i) for i in choices])}]" in result.output1377+ assert (1378+ f"[{'|'.join(i.name if isinstance(i, enum.Enum) else str(i) for i in choices)}]"1379+ in result.output1380+ )1381 1382 result = runner.invoke(cli_without_choices, ["--help"])1383 assert metavars in result.output1384 1385 1386 @pytest.mark.parametrize(1387+ ("choices", "default", "default_string"),1388+ [1389+ (["foo", "bar"], "bar", "bar"),1390+ # The default value is not enforced to be in the choices.1391+ (["foo", "bar"], "random", "random"),1392+ # None cannot be a default value as-is: it left the default value as unset.1393+ (["foo", "bar"], None, None),1394+ ([0, 1], 0, "0"),1395+ # Values are not coerced to the type of the choice, even if equivalent.1396+ ([0, 1], 0.0, "0.0"),1397+ ([1, 2], 2, "2"),1398+ ([1.0, 2.0], 2, "2"),1399+ ([1.0, 2.0], 2.0, "2.0"),1400+ ([True, False], True, "True"),1401+ ([True, False], False, "False"),1402+ (["foo", 1], "foo", "foo"),1403+ (["foo", 1], 1, "1"),1404+ # Enum choices are rendered as their names.1405+ # See: https://github.com/pallets/click/issues/29111406+ (HashType, HashType.SHA1, "SHA1"),1407+ # Enum choices allow defaults strings that are their names.1408+ (HashType, "SHA1", "SHA1"),1409+ (Number, Number.TWO, "TWO"),1410+ (Letter, Letter.B, "B"),1411+ (Color, Color.GREEN, "GREEN"),1412+ (ColorInt, ColorInt.GREEN, "GREEN"),1413+ ],1414+)1415+def test_choice_default_rendering(runner, choices, default, default_string):1416+ @click.command()1417+ @click.option("-g", type=click.Choice(choices), default=default, show_default=True)1418+ def cli_with_choices(g):1419+ pass1420+1421+ # Check that the default value is kept normalized to the type of the choice.1422+ assert cli_with_choices.params[0].default == default1423+1424+ result = runner.invoke(cli_with_choices, ["--help"])1425+ extra_usage = f"[default: {default_string}]"1426+ if default_string is None:1427+ assert extra_usage not in result.output1428+ else:1429+ assert extra_usage in result.output1430+1431+1432+@pytest.mark.parametrize(1433 "opts_one,opts_two",1434 [1435 # No duplicate shortnames1436 (15 unmodified lines1452 pass1453 1454 with pytest.warns(UserWarning):1455 runner.invoke(cli, [])1456+1457+1458+@pytest.mark.parametrize(1459+ ("multiple", "nargs", "default", "expected_message"),1460+ [1461+ (1462+ False, # multiple1463+ 2, # nargs1464+ 42, # default (not a list)1465+ "'default' must be a list when 'nargs' != 1.",1466+ ),1467+ (1468+ True, # multiple1469+ 2, # nargs1470+ [1471+ "test string which is not a list in the list"1472+ ], # default (list of non-lists)1473+ "'default' must be a list of lists when 'multiple' is true"1474+ " and 'nargs' != 1.",1475+ ),1476+ ],1477+)1478+def test_default_type_error_raises(multiple, nargs, default, expected_message):1479+ with pytest.raises(ValueError, match=expected_message):1480+ click.Option(1481+ ["--test"],1482+ multiple=multiple,1483+ nargs=nargs,1484+ default=default,1485+ )modified:tests/test_shell_completion.py+105 added
1+import textwrap2 import warnings3+from collections.abc import Mapping4 5 import pytest6 7 import click.shell_completion33 unmodified lines41 assert _get_words(cli, [], "") == ["x", "y"]42 assert _get_words(cli, [], "-") == ["-a", "--help"]43 44 45+@pytest.mark.parametrize(46+ ("args", "word", "expect"),47+ [48+ ([], "", ["get"]),49+ (["get"], "", ["full"]),50+ (["get", "full"], "", ["data"]),51+ (["get", "full"], "-", ["--verbose", "--help"]),52+ (["get", "full", "data"], "", []),53+ (["get", "full", "data"], "-", ["-a", "--help"]),54+ ],55+)56+def test_nested_group(args: list[str], word: str, expect: list[str]) -> None:57+ cli = Group(58+ "cli",59+ commands=[60+ Group(61+ "get",62+ commands=[63+ Group(64+ "full",65+ params=[Option(["--verbose"])],66+ commands=[Command("data", params=[Option(["-a"])])],67+ )68+ ],69+ )70+ ],71+ )72+ assert _get_words(cli, args, word) == expect73+74+75 def test_group_command_same_option():76 cli = Group(77 "cli", params=[Option(["-a"])], commands=[Command("x", params=[Option(["-a"])])]78 )289 unmodified lines368 result = runner.invoke(cli, env=env)369 assert result.output == expect370 371 372+@pytest.mark.parametrize(373+ ("env", "expect"),374+ [375+ (376+ {"COMP_WORDS": "", "COMP_CWORD": "0"},377+ textwrap.dedent(378+ """\379+ plain380+ a381+ _382+ plain383+ b384+ bee385+ plain386+ c\\:d387+ cee:dee388+ plain389+ c:e390+ _391+ """392+ ),393+ ),394+ (395+ {"COMP_WORDS": "a c", "COMP_CWORD": "1"},396+ textwrap.dedent(397+ """\398+ plain399+ c\\:d400+ cee:dee401+ plain402+ c:e403+ _404+ """405+ ),406+ ),407+ (408+ {"COMP_WORDS": "a c:", "COMP_CWORD": "1"},409+ textwrap.dedent(410+ """\411+ plain412+ c\\:d413+ cee:dee414+ plain415+ c:e416+ _417+ """418+ ),419+ ),420+ ],421+)422 @pytest.mark.usefixtures("_patch_for_completion")423+def test_zsh_full_complete_with_colons(424+ runner, env: Mapping[str, str], expect: str425+) -> None:426+ cli = Group(427+ "cli",428+ commands=[429+ Command("a"),430+ Command("b", help="bee"),431+ Command("c:d", help="cee:dee"),432+ Command("c:e"),433+ ],434+ )435+ result = runner.invoke(436+ cli,437+ env={438+ **env,439+ "_CLI_COMPLETE": "zsh_complete",440+ },441+ )442+ assert result.output == expect443+444+445+@pytest.mark.usefixtures("_patch_for_completion")446 def test_context_settings(runner):447 def complete(ctx, param, incomplete):448 return ctx.obj["choices"]449 111 unmodified linesmodified:tests/test_termui.py+2 added-2 removed
240 unmodified lines241 @click.option("-f", default=__file__, prompt="file", type=click.File(**file_kwargs))242 def cli(f):243 click.echo(f.name)244 245- result = runner.invoke(cli)245+ result = runner.invoke(cli, input="\n")246 assert result.output == f"file [{__file__}]: \n{__file__}\n"247 248 249 def test_secho(runner):200 unmodified lines450 ("prompt", "input", "default", "expect"),451 [452 (True, "password\npassword", None, "password"),453 ("Confirm Password", "password\npassword\n", None, "password"),454- (True, "", "", ""),454+ (True, "\n\n", "", ""),455 (False, None, None, None),456 ],457 )458 def test_confirmation_prompt(runner, prompt, input, default, expect):29 unmodified linesmodified:tests/test_testing.py+20 added-1 removed
446 unmodified lines447 runner = CliRunner()448 449 with runner.isolation() as (_, err, _):450 click.echo("\udce2", err=True, nl=False)451+ assert err.getvalue() == b"\\udce2"452 453+454+def test_isolation_flushes_unflushed_stderr():455+ """An un-flushed write to stderr, as with `print(..., file=sys.stderr)`, will end up456+ flushed by the runner at end of invocation.457+ """458+ runner = CliRunner()459+460+ with runner.isolation() as (_, err, _):461+ click.echo("\udce2", err=True, nl=False)452- assert err.getvalue() == b"\\udce2"462+ assert err.getvalue() == b"\\udce2"463+464+ @click.command()465+ def cli():466+ # set end="", flush=False so that it's totally clear that we won't get any467+ # auto-flush behaviors468+ print("gyarados gyarados gyarados", file=sys.stderr, end="", flush=False)469+470+ result = runner.invoke(cli)471+ assert result.stderr == "gyarados gyarados gyarados"modified:tests/test_types.py+7 added-2 removed
224 unmodified lines225 )226 def test_file_surrogates(type, tmp_path):227 path = tmp_path / "\udcff"228 229+ # - common case: �': No such file or directory230+ # - special case: Illegal byte sequence231+ # The spacial case is seen with rootless Podman. The root cause is most232+ # likely that the path is handled by a user-space program (FUSE).233+ match = r"(�': No such file or directory|Illegal byte sequence)"229- with pytest.raises(click.BadParameter, match="�': No such file or directory"):234+ with pytest.raises(click.BadParameter, match=match):235 type.convert(path, None, None)236 237 238 def test_file_error_surrogates():13 unmodified lines252 253 254 def test_choice_get_invalid_choice_message():255 choice = click.Choice(["a", "b", "c"])251- message = choice.get_invalid_choice_message("d")256+ message = choice.get_invalid_choice_message("d", ctx=None)257 assert message == "'d' is not one of 'a', 'b', 'c'."modified:tests/test_utils.py+51 added-33 removed
1 import os2 import pathlib3 import stat4+import subprocess5 import sys6 from collections import namedtuple7+from contextlib import nullcontext8+from functools import partial9 from io import StringIO10+from pathlib import Path11 from tempfile import tempdir12+from unittest.mock import patch13 14 import pytest15 16 import click._termui_impl94 unmodified lines111 assert click.format_filename(b"foo.txt") == "foo.txt"112 assert click.format_filename(b"/x/foo.txt") == "/x/foo.txt"113 assert click.format_filename("/x/foo.txt") == "/x/foo.txt"114 assert click.format_filename("/x/foo.txt", shorten=True) == "foo.txt"110- assert click.format_filename(b"/x/\xff.txt", shorten=True) == "�.txt"115+ assert click.format_filename("/x/\ufffd.txt", shorten=True) == "�.txt"116 117 118 def test_prompts(runner):119 @click.command()58 unmodified lines178 out, err = capsys.readouterr()179 assert out == "Password:\ninterrupted\n"180 181 182+def test_prompts_eof(runner):183+ """If too few lines of input are given, prompt should exit, not hang."""184+185+ @click.command186+ def echo():187+ for _ in range(3):188+ click.echo(click.prompt("", type=int))189+190+ # only provide two lines of input for three prompts191+ result = runner.invoke(echo, input="1\n2\n")192+ assert result.exit_code == 1193+194+195 def _test_gen_func():196 yield "a"197 yield "b"198 yield "c"30 unmodified lines229 230 231 @pytest.mark.skipif(WIN, reason="Different behavior on windows.")232 @pytest.mark.parametrize(233+ "pager_cmd", ["cat", "cat ", " cat ", "less", " less", " less "]234+)235+@pytest.mark.parametrize(236 "test",237 [238 # We need to pass a parameter function instead of a plain param239 # as pytest.mark.parametrize will reuse the parameters causing the42 unmodified lines282 description="Exception in generator function argument",283 test_input=lambda: _test_gen_func_fails,284 # Because generator throws early on, the pager did not have285 # a chance yet to write the file.265- expected_pager=None,286+ expected_pager="",287 expected_stdout="",288 expected_stderr="",289 expected_error=RuntimeError,290 ),1 unmodified line292 description="Exception in generator argument",293 test_input=lambda: _test_gen_func_fails,294 # Because generator throws early on, the pager did not have a295 # chance yet to write the file.275- expected_pager=None,296+ expected_pager="",297 expected_stdout="",298 expected_stderr="",299 expected_error=RuntimeError,300 ),26 unmodified lines327 expected_error=None,328 ),329 ],330 )310-def test_echo_via_pager(monkeypatch, capfd, test):311- pager_out_tmp = f"{tempdir}/pager_out.txt"312-313- if os.path.exists(pager_out_tmp):314- os.remove(pager_out_tmp)315-316- monkeypatch.setitem(os.environ, "PAGER", f"cat > {pager_out_tmp}")331+def test_echo_via_pager(monkeypatch, capfd, pager_cmd, test):332+ monkeypatch.setitem(os.environ, "PAGER", pager_cmd)333 monkeypatch.setattr(click._termui_impl, "isatty", lambda x: True)334 335 test_input = test.test_input()336 expected_pager = test.expected_pager337 expected_stdout = test.expected_stdout338 expected_stderr = test.expected_stderr339 expected_error = test.expected_error340 325- if expected_error:326- with pytest.raises(expected_error):327- click.echo_via_pager(test_input)328- else:329- click.echo_via_pager(test_input)341+ check_raise = pytest.raises(expected_error) if expected_error else nullcontext()342 343+ pager_out_tmp = Path(tempdir) / "pager_out.txt"344+ pager_out_tmp.unlink(missing_ok=True)345+ with pager_out_tmp.open("w") as f:346+ force_subprocess_stdout = patch.object(347+ subprocess,348+ "Popen",349+ partial(subprocess.Popen, stdout=f),350+ )351+ with force_subprocess_stdout:352+ with check_raise:353+ click.echo_via_pager(test_input)354+355 out, err = capfd.readouterr()356 333- if os.path.exists(pager_out_tmp):334- with open(pager_out_tmp) as f:335- pager = f.read()336- else:337- # The pager process was not started or has been338- # terminated before it could finish writing339- pager = None357+ pager = pager_out_tmp.read_text()358 341- assert (342- pager == expected_pager343- ), f"Unexpected pager output in test case '{test.description}'"344- assert (345- out == expected_stdout346- ), f"Unexpected stdout in test case '{test.description}'"347- assert (348- err == expected_stderr349- ), f"Unexpected stderr in test case '{test.description}'"359+ assert pager == expected_pager, (360+ f"Unexpected pager output in test case '{test.description}'"361+ )362+ assert out == expected_stdout, (363+ f"Unexpected stdout in test case '{test.description}'"364+ )365+ assert err == expected_stderr, (366+ f"Unexpected stderr in test case '{test.description}'"367+ )368 369 370 def test_echo_color_flag(monkeypatch, capfd):371 isatty = True214 unmodified lines586 expected = list(map(str, range(10)))587 p = tmpdir.mkdir("testdir").join("testfile")588 p.write("\n".join(expected))589 with p.open() as f:572- for e_line, a_line in zip(expected, click.utils.KeepOpenFile(f)):590+ for e_line, a_line in zip(expected, click.utils.KeepOpenFile(f), strict=False):591 assert e_line == a_line.strip()592 593 594 def test_iter_lazyfile(tmpdir):1 unmodified line596 p = tmpdir.mkdir("testdir").join("testfile")597 p.write("\n".join(expected))598 with p.open() as f:599 with click.utils.LazyFile(f.name) as lf:582- for e_line, a_line in zip(expected, lf):600+ for e_line, a_line in zip(expected, lf, strict=False):601 assert e_line == a_line.strip()602 603 604 class MockMain:67 unmodified linesmodified:.gitignore-4 removed
1 .idea/2 .vscode/3-.venv*/4-venv*/5-.env*/6-env*/3 __pycache__/4 dist/5 .coverage*6 htmlcov/2 unmodified linesmodified:.pre-commit-config.yaml+6 added-2 removed
1 repos:2 - repo: https://github.com/astral-sh/ruff-pre-commit3- rev: v0.7.13+ rev: 9aeda5d1f4bbd212c557da1ea78eca9e8c829e19 # frozen: v0.11.134 hooks:5 - id: ruff6 - id: ruff-format7+ - repo: https://github.com/astral-sh/uv-pre-commit8+ rev: a621b109bab2e7e832d98c88fd3e83399f4e6657 # frozen: 0.7.129+ hooks:10+ - id: uv-lock11 - repo: https://github.com/pre-commit/pre-commit-hooks8- rev: v5.0.012+ rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.013 hooks:14 - id: check-merge-conflict15 - id: debug-statements16 - id: fix-byte-order-marker2 unmodified linesmodified:.readthedocs.yaml+14 added-10 removed
1 version: 22+# Do not specify sphinx key here to be in full control of build steps.3+# https://docs.readthedocs.com/platform/stable/build-customization.html#extend-or-override-the-build-process4+5 build:3- os: ubuntu-22.046+ os: ubuntu-24.047 tools:5- python: '3.12'6-python:7- install:8- - requirements: requirements/docs.txt9- - method: pip10- path: .11-sphinx:12- builder: dirhtml13- fail_on_warning: true8+ python: '3.13'9+ jobs:10+ install:11+ - echo "Installing dependencies"12+ - asdf plugin add uv13+ - asdf install uv latest14+ - asdf global uv latest15+ build:16+ html:17+ - uv run --group docs sphinx-build -W -b dirhtml docs $READTHEDOCS_OUTPUT/htmlmodified:CHANGES.rst+60 added-13 removed
1 .. currentmodule:: click2 3+Version 8.2.24+-------------5+6+Released 2025-07-317+8+- Fix reconciliation of `default`, `flag_value` and `type` parameters for9+ flag options, as well as parsing and normalization of environment variables.10+ :issue:`2952` :pr:`2956`11+- Fix typing issue in ``BadParameter`` and ``MissingParameter`` exceptions for the12+ parameter ``param_hint`` that did not allow for a sequence of string where the13+ underlying functino ``_join_param_hints`` allows for it. :issue:`2777` :pr:`2990`14+- Use the value of ``Enum`` choices to render their default value in help15+ screen. Refs :issue:`2911` :pr:`3004`16+- Fix completion for the Z shell (``zsh``) for completion items containing17+ colons. :issue:`2703` :pr:`2846`18+- Don't include envvar in error hint when not configured. :issue:`2971` :pr:`2972`19+- Fix a rare race in ``click.testing.StreamMixer``'s finalization that manifested20+ as a ``ValueError`` on close in a multi-threaded test session.21+ :issue:`2993` :pr:`2991`22+23+Version 8.2.124+-------------25+26+Released 2025-05-2027+28+- Fix flag value handling for flag options with a provided type. :issue:`2894`29+ :issue:`2897` :pr:`2930`30+- Fix shell completion for nested groups. :issue:`2906` :pr:`2907`31+- Flush ``sys.stderr`` at the end of ``CliRunner.invoke``. :issue:`2682`32+- Fix EOF handling for stdin input in CliRunner. :issue:`2787`33+34 Version 8.2.035 -------------36 6-Unreleased37+Released 2025-05-1038 8-- Drop support for Python 3.7. :pr:`2588`39+- Drop support for Python 3.7, 3.8, and 3.9. :pr:`2588` :pr:`2893`40 - Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.10- :pr:`326`11-- Use ``flit_core`` instead of ``setuptools`` as build backend.41+ :pr:`2438`42+- Use ``flit_core`` instead of ``setuptools`` as build backend. :pr:`2543`43 - Deprecate the ``__version__`` attribute. Use feature detection, or44 ``importlib.metadata.version("click")``, instead. :issue:`2598`45 - ``BaseCommand`` is deprecated. ``Command`` is the base class for all46 commands. :issue:`2589`24 unmodified lines71 items used in ``get_help_record`` to render help text. :issue:`2516`72 :pr:`2517`73 - Keep stdout and stderr streams independent in ``CliRunner``. Always74 collect stderr output and never raise an exception. Add a new44- output` stream to simulate what the user sees in its terminal. Removes75+ output stream to simulate what the user sees in its terminal. Removes76 the ``mix_stderr`` parameter in ``CliRunner``. :issue:`2522` :pr:`2523`77 - ``Option.show_envvar`` now also shows environment variable in error messages.78 :issue:`2695` :pr:`2696`79 - ``Context.close`` will be called on exit. This results in all80 ``Context.call_on_close`` callbacks and context managers added via81 ``Context.with_resource`` to be closed on exit as well. :pr:`2680`82 - Add ``ProgressBar(hidden: bool)`` to allow hiding the progressbar. :issue:`2609`83 - A ``UserWarning`` will be shown when multiple parameters attempt to use the53- same name. :issue:`2396``84+ same name. :issue:`2396`85 - When using ``Option.envvar`` with ``Option.flag_value``, the ``flag_value``86 will always be used instead of the value of the environment variable.87 :issue:`2746` :pr:`2788`88 - Add ``Choice.get_invalid_choice_message`` method for customizing the1 unmodified line90 - If help is shown because ``no_args_is_help`` is enabled (defaults to ``True``91 for groups, ``False`` for commands), the exit code is 2 instead of 0.92 :issue:`1489` :pr:`1489`93 - Contexts created during shell completion are closed properly, fixing63- ``ResourceWarning``s when using ``click.File``. :issue:`2644` :pr:`2800`94+ a ``ResourceWarning`` when using ``click.File``. :issue:`2644` :pr:`2800`95 :pr:`2767`96 - ``click.edit(filename)`` now supports passing an iterable of filenames in97 case the editor supports editing multiple files at once. Its return type98 is now also typed: ``AnyStr`` if ``text`` is passed, otherwise ``None``.19 unmodified lines118 ``(Deprecated) help`` to ``help (DEPRECATED)``.119 - Parameters cannot be required nor prompted or an error is raised.120 - A warning will be printed when something deprecated is used.121 91-- Add a ``catch_exceptions`` parameter to :class:`CliRunner`. If92- ``catch_exceptions`` is not passed to :meth:`CliRunner.invoke`,93- the value from :class:`CliRunner`. :issue:`2817` :pr:`2818`122+- Add a ``catch_exceptions`` parameter to ``CliRunner``. If123+ ``catch_exceptions`` is not passed to ``CliRunner.invoke``, the value124+ from ``CliRunner`` is used. :issue:`2817` :pr:`2818`125 - ``Option.flag_value`` will no longer have a default value set based on126 ``Option.default`` if ``Option.is_flag`` is ``False``. This results in127 ``Option.default`` not needing to implement `__bool__`. :pr:`2829`128 - Incorrect ``click.edit`` typing has been corrected. :pr:`2804`129+- ``Choice`` is now generic and supports any iterable value.130+ This allows you to use enums and other non-``str`` values. :pr:`2796`131+ :issue:`605`132+- Fix setup of help option's defaults when using a custom class on its133+ decorator. Removes ``HelpOption``. :issue:`2832` :pr:`2840`134 135 Version 8.1.8136 -------------137 102-Unreleased138+Released 2024-12-19139 140 - Fix an issue with type hints for ``click.open_file()``. :issue:`2717`141 - Fix issue where error message for invalid ``click.Path`` displays on142 multiple lines. :issue:`2697`4 unmodified lines147 - Show correct value for flag default when using ``default_map``.148 :issue:`2632`149 - Fix ``click.echo(color=...)`` passing ``color`` to coloroma so it can be150 forced on Windows. :issue:`2606`.115-- show correct auto complete value for nargs option in combination with116- flag option :issue:`2813`151+- More robust bash version check, fixing problem on Windows with git-bash.152+ :issue:`2638`153+- Cache the help option generated by the ``help_option_names`` setting to154+ respect its eagerness. :pr:`2811`155+- Replace uses of ``os.system`` with ``subprocess.Popen``. :issue:`1476`156+- Exceptions generated during a command will use the context's ``color``157+ setting when being displayed. :issue:`2193`158+- Error message when defining option with invalid name is more descriptive.159+ :issue:`2452`160+- Refactor code generating default ``--help`` option to deduplicate code.161+ :pr:`2563`162+- Test ``CLIRunner`` resets patched ``_compat.should_strip_ansi``.163+ :issue:`2732`164 165 166 Version 8.1.7167 -------------1100 unmodified linesdeleted:CONTRIBUTING.rst-216 removed
1-How to contribute to Click2-==========================3-4-Thank you for considering contributing to Click!5-6-7-Support questions8------------------9-10-Please don't use the issue tracker for this. The issue tracker is a tool11-to address bugs and feature requests in Click itself. Use one of the12-following resources for questions about using Click or issues with your13-own code:14-15-- The ``#get-help`` channel on our Discord chat:16- https://discord.gg/pallets17-- The mailing list flask@python.org for long term discussion or larger18- issues.19-- Ask on `Stack Overflow`_. Search with Google first using:20- ``site:stackoverflow.com python click {search term, exception message, etc.}``21-22-.. _Stack Overflow: https://stackoverflow.com/questions/tagged/python-click?tab=Frequent23-24-25-Reporting issues26-----------------27-28-Include the following information in your post:29-30-- Describe what you expected to happen.31-- If possible, include a `minimal reproducible example`_ to help us32- identify the issue. This also helps check that the issue is not with33- your own code.34-- Describe what actually happened. Include the full traceback if there35- was an exception.36-- List your Python and Click versions. If possible, check if this37- issue is already fixed in the latest releases or the latest code in38- the repository.39-40-.. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example41-42-43-Submitting patches44-------------------45-46-If there is not an open issue for what you want to submit, prefer47-opening one for discussion before working on a PR. You can work on any48-issue that doesn't have an open PR linked to it or a maintainer assigned49-to it. These show up in the sidebar. No need to ask if you can work on50-an issue that interests you.51-52-Include the following in your patch:53-54-- Use `Black`_ to format your code. This and other tools will run55- automatically if you install `pre-commit`_ using the instructions56- below.57-- Include tests if your patch adds or changes code. Make sure the test58- fails without your patch.59-- Update any relevant docs pages and docstrings. Docs pages and60- docstrings should be wrapped at 72 characters.61-- Add an entry in ``CHANGES.rst``. Use the same style as other62- entries. Also include ``.. versionchanged::`` inline changelogs in63- relevant docstrings.64-65-.. _Black: https://black.readthedocs.io66-.. _pre-commit: https://pre-commit.com67-68-69-First time setup70-~~~~~~~~~~~~~~~~71-72-- Download and install the `latest version of git`_.73-- Configure git with your `username`_ and `email`_.74-75- .. code-block:: text76-77- $ git config --global user.name 'your name'78- $ git config --global user.email 'your email'79-80-- Make sure you have a `GitHub account`_.81-- Fork Click to your GitHub account by clicking the `Fork`_ button.82-- `Clone`_ the main repository locally.83-84- .. code-block:: text85-86- $ git clone https://github.com/pallets/click87- $ cd click88-89-- Add your fork as a remote to push your work to. Replace90- ``{username}`` with your username. This names the remote "fork", the91- default Pallets remote is "origin".92-93- .. code-block:: text94-95- $ git remote add fork https://github.com/{username}/click96-97-- Create a virtualenv.98-99- .. code-block:: text100-101- $ python3 -m venv env102- $ . env/bin/activate103-104- On Windows, activating is different.105-106- .. code-block:: text107-108- > env\Scripts\activate109-110-- Install the development dependencies, then install Click in111- editable mode.112-113- .. code-block:: text114-115- $ pip install -r requirements/dev.txt && pip install -e .116-117-- Install the pre-commit hooks.118-119- .. code-block:: text120-121- $ pre-commit install122-123-.. _latest version of git: https://git-scm.com/downloads124-.. _username: https://docs.github.com/en/github/using-git/setting-your-username-in-git125-.. _email: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address126-.. _GitHub account: https://github.com/join127-.. _Fork: https://github.com/pallets/click/fork128-.. _Clone: https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#step-2-create-a-local-clone-of-your-fork129-130-131-Start coding132-~~~~~~~~~~~~133-134-- Create a branch to identify the issue you would like to work on. If135- you're submitting a bug or documentation fix, branch off of the136- latest ".x" branch.137-138- .. code-block:: text139-140- $ git fetch origin141- $ git checkout -b your-branch-name origin/8.1.x142-143- If you're submitting a feature addition or change, branch off of the144- "main" branch.145-146- .. code-block:: text147-148- $ git fetch origin149- $ git checkout -b your-branch-name origin/main150-151-- Using your favorite editor, make your changes,152- `committing as you go`_.153-- Include tests that cover any code changes you make. Make sure the154- test fails without your patch. Run the tests as described below.155-- Push your commits to your fork on GitHub and156- `create a pull request`_. Link to the issue being addressed with157- ``fixes #123`` in the pull request.158-159- .. code-block:: text160-161- $ git push --set-upstream fork your-branch-name162-163-.. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes164-.. _create a pull request: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request165-166-167-Running the tests168-~~~~~~~~~~~~~~~~~169-170-Run the basic test suite with pytest.171-172-.. code-block:: text173-174- $ pytest175-176-This runs the tests for the current environment, which is usually177-sufficient. CI will run the full suite when you submit your pull178-request. You can run the full test suite with tox if you don't want to179-wait.180-181-.. code-block:: text182-183- $ tox184-185-186-Running test coverage187-~~~~~~~~~~~~~~~~~~~~~188-189-Generating a report of lines that do not have test coverage can indicate190-where to start contributing. Run ``pytest`` using ``coverage`` and191-generate a report.192-193-.. code-block:: text194-195- $ pip install coverage196- $ coverage run -m pytest197- $ coverage html198-199-Open ``htmlcov/index.html`` in your browser to explore the report.200-201-Read more about `coverage <https://coverage.readthedocs.io>`__.202-203-204-Building the docs205-~~~~~~~~~~~~~~~~~206-207-Build the docs in the ``docs`` directory using Sphinx.208-209-.. code-block:: text210-211- $ cd docs212- $ make html213-214-Open ``_build/html/index.html`` in your browser to view the docs.215-216-Read more about `Sphinx <https://www.sphinx-doc.org/en/stable/>`__.modified:pyproject.toml+120 added-14 removed
1 [project]2 name = "click"3-version = "8.2.0.dev"3+version = "8.2.2"4 description = "Composable command line interface toolkit"5 readme = "README.md"6-license = {file = "LICENSE.txt"}6+license = "BSD-3-Clause"7+license-files = ["LICENSE.txt"]8 maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}]9 classifiers = [10 "Development Status :: 5 - Production/Stable",11 "Intended Audience :: Developers",11- "License :: OSI Approved :: BSD License",12 "Operating System :: OS Independent",13 "Programming Language :: Python",14 "Typing :: Typed",15 ]16-requires-python = ">=3.8"16+requires-python = ">=3.10"17 dependencies = [18 "colorama; platform_system == 'Windows'",19 ]20 21 [project.urls]22 Donate = "https://palletsprojects.com/donate"23 Documentation = "https://click.palletsprojects.com/"24-Changes = "https://click.palletsprojects.com/changes/"24+Changes = "https://click.palletsprojects.com/page/changes/"25 Source = "https://github.com/pallets/click/"26 Chat = "https://discord.gg/pallets"27 28+[dependency-groups]29+dev = [30+ "ruff",31+ "tox",32+ "tox-uv",33+]34+docs = [35+ "myst-parser",36+ "pallets-sphinx-themes",37+ "sphinx",38+ "sphinx-tabs",39+ "sphinxcontrib-log-cabinet",40+]41+docs-auto = [42+ "sphinx-autobuild",43+]44+gha-update = [45+ "gha-update ; python_full_version >= '3.12'",46+]47+pre-commit = [48+ "pre-commit",49+ "pre-commit-uv",50+]51+tests = [52+ "pytest",53+]54+typing = [55+ "mypy",56+ "pyright",57+ "pytest",58+]59+60 [build-system]61 requires = ["flit_core<4"]62 build-backend = "flit_core.buildapi"63 2 unmodified lines66 67 [tool.flit.sdist]68 include = [69 "docs/",38- "requirements/",70 "tests/",71 "CHANGES.rst",41- "tox.ini",72+ "uv.lock"73 ]74 exclude = [75 "docs/_build/",76 ]77 78+[tool.uv]79+default-groups = ["dev", "pre-commit", "tests", "typing"]80+81 [tool.pytest.ini_options]82 testpaths = ["tests"]83 filterwarnings = [84 "error",5 unmodified lines90 91 [tool.coverage.paths]92 source = ["src", "*/site-packages"]93 94+[tool.coverage.report]95+exclude_also = [96+ "if t.TYPE_CHECKING",97+ "raise NotImplementedError",98+ ": \\.{3}",99+]100+101 [tool.mypy]61-python_version = "3.8"62-files = ["src/click", "tests/typing"]102+python_version = "3.10"103+files = ["src", "tests/typing"]104 show_error_codes = true105 pretty = true106 strict = true107 3 unmodified lines111 ]112 ignore_missing_imports = true113 114 [tool.pyright]74-pythonVersion = "3.8"75-include = ["src/click", "tests/typing"]115+pythonVersion = "3.10"116+include = ["src", "tests/typing"]117 typeCheckingMode = "basic"118 119 [tool.ruff]120 extend-exclude = ["examples/"]10 unmodified lines131 "I", # isort132 "UP", # pyupgrade133 "W", # pycodestyle warning134 ]135+ignore = [136+ "UP038", # keep isinstance tuple137+]138 139 [tool.ruff.lint.isort]140 force-single-line = true141 order-by-type = false142 99-[tool.gha-update]100-tag-only = [101- "slsa-framework/slsa-github-generator",143+[tool.tox]144+env_list = [145+ "py3.13", "py3.12", "py3.11", "py3.10",146+ "pypy3.11",147+ "style",148+ "typing",149+ "docs",150 ]151+152+[tool.tox.env_run_base]153+description = "pytest on latest dependency versions"154+runner = "uv-venv-lock-runner"155+package = "wheel"156+wheel_build_env = ".pkg"157+constrain_package_deps = true158+use_frozen_constraints = true159+dependency_groups = ["tests"]160+commands = [[161+ "pytest", "-v", "--tb=short", "--basetemp={env_tmp_dir}",162+ {replace = "posargs", default = [], extend = true},163+]]164+165+[tool.tox.env.style]166+description = "run all pre-commit hooks on all files"167+dependency_groups = ["pre-commit"]168+skip_install = true169+commands = [["pre-commit", "run", "--all-files"]]170+171+[tool.tox.env.typing]172+description = "run static type checkers"173+dependency_groups = ["typing"]174+commands = [175+ ["mypy"],176+]177+178+[tool.tox.env.docs]179+description = "build docs"180+dependency_groups = ["docs"]181+commands = [["sphinx-build", "-E", "-W", "-b", "dirhtml", "docs", "docs/_build/dirhtml"]]182+183+[tool.tox.env.docs-auto]184+description = "continuously rebuild docs and start a local server"185+dependency_groups = ["docs", "docs-auto"]186+commands = [["sphinx-autobuild", "-W", "-b", "dirhtml", "--watch", "src", "docs", "docs/_build/dirhtml"]]187+188+[tool.tox.env.update-actions]189+description = "update GitHub Actions pins"190+labels = ["update"]191+dependency_groups = ["gha-update"]192+skip_install = true193+commands = [["gha-update"]]194+195+[tool.tox.env.update-pre_commit]196+description = "update pre-commit pins"197+labels = ["update"]198+dependency_groups = ["pre-commit"]199+skip_install = true200+commands = [["pre-commit", "autoupdate", "--freeze", "-j4"]]201+202+[tool.tox.env.update-requirements]203+description = "update uv lock"204+labels = ["update"]205+dependency_groups = []206+no_default_groups = true207+skip_install = true208+commands = [["uv", "lock", {replace = "posargs", default = ["-U"], extend = true}]]modified:README.md+11 added-1 removed
1-# $ click_1+<div align="center"><img src="https://raw.githubusercontent.com/pallets/click/refs/heads/stable/docs/_static/click-name.svg" alt="" height="150"></div>2 3+# Click4+5 Click is a Python package for creating beautiful command line interfaces6 in a composable way with as little code as necessary. It's the "Command7 Line Interface Creation Kit". It's highly configurable but comes with8 sensible defaults out of the box.42 unmodified lines51 allow the maintainers to devote more time to the projects, [please52 donate today][].53 54 [please donate today]: https://palletsprojects.com/donate55+56+## Contributing57+58+See our [detailed contributing documentation][contrib] for many ways to59+contribute, including reporting issues, requesting features, asking or answering60+questions, and making PRs.61+62+[contrib]: https://palletsprojects.com/contributing/deleted:tox.ini-61 removed
1-[tox]2-envlist =3- py3{13,12,11,10,9,8}4- pypy3105- style6- typing7- docs8-skip_missing_interpreters = true9-10-[testenv]11-package = wheel12-wheel_build_env = .pkg13-constrain_package_deps = true14-use_frozen_constraints = true15-deps = -r requirements/tests.txt16-commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}17-18-[testenv:style]19-deps = pre-commit20-skip_install = true21-commands = pre-commit run --all-files22-23-[testenv:typing]24-deps = -r requirements/typing.txt25-commands =26- mypy --platform linux27- mypy --platform darwin28- mypy --platform win3229- pyright tests/typing --pythonplatform Linux30- pyright tests/typing --pythonplatform Darwin31- pyright tests/typing --pythonplatform Windows32- pyright --verifytypes click --ignoreexternal --pythonplatform Linux33- pyright --verifytypes click --ignoreexternal --pythonplatform Darwin34- pyright --verifytypes click --ignoreexternal --pythonplatform Windows35-36-[testenv:docs]37-deps = -r requirements/docs.txt38-commands = sphinx-build -E -W -b dirhtml docs docs/_build/dirhtml39-40-[testenv:update-actions]41-labels = update42-deps = gha-update43-commands = gha-update44-45-[testenv:update-pre_commit]46-labels = update47-deps = pre-commit48-skip_install = true49-commands = pre-commit autoupdate -j450-51-[testenv:update-requirements]52-labels = update53-deps = pip-tools54-skip_install = true55-change_dir = requirements56-commands =57- pip-compile build.in -q {posargs:-U}58- pip-compile docs.in -q {posargs:-U}59- pip-compile tests.in -q {posargs:-U}60- pip-compile typing.in -q {posargs:-U}61- pip-compile dev.in -q {posargs:-U}added:uv.lock+1222 added
1+version = 12+revision = 23+requires-python = ">=3.10"4+resolution-markers = [5+ "python_full_version >= '3.12'",6+ "python_full_version == '3.11.*'",7+ "python_full_version < '3.11'",8+]9+10+[[package]]11+name = "alabaster"12+version = "1.0.0"13+source = { registry = "https://pypi.org/simple" }14+sdist = { url = "https://files.pythonhosted.org/packages/a6/f8/d9c74d0daf3f742840fd818d69cfae176fa332022fd44e3469487d5a9420/alabaster-1.0.0.tar.gz", hash = "sha256:c00dca57bca26fa62a6d7d0a9fcce65f3e026e9bfe33e9c538fd3fbb2144fd9e", size = 24210, upload-time = "2024-07-26T18:15:03.762Z" }15+wheels = [16+ { url = "https://files.pythonhosted.org/packages/7e/b3/6b4067be973ae96ba0d615946e314c5ae35f9f993eca561b356540bb0c2b/alabaster-1.0.0-py3-none-any.whl", hash = "sha256:fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b", size = 13929, upload-time = "2024-07-26T18:15:02.05Z" },17+]18+19+[[package]]20+name = "anyio"21+version = "4.9.0"22+source = { registry = "https://pypi.org/simple" }23+dependencies = [24+ { name = "exceptiongroup", marker = "python_full_version < '3.11'" },25+ { name = "idna" },26+ { name = "sniffio" },27+ { name = "typing-extensions", marker = "python_full_version < '3.13'" },28+]29+sdist = { url = "https://files.pythonhosted.org/packages/95/7d/4c1bd541d4dffa1b52bd83fb8527089e097a106fc90b467a7313b105f840/anyio-4.9.0.tar.gz", hash = "sha256:673c0c244e15788651a4ff38710fea9675823028a6f08a5eda409e0c9840a028", size = 190949, upload-time = "2025-03-17T00:02:54.77Z" }30+wheels = [31+ { url = "https://files.pythonhosted.org/packages/a1/ee/48ca1a7c89ffec8b6a0c5d02b89c305671d5ffd8d3c94acf8b8c408575bb/anyio-4.9.0-py3-none-any.whl", hash = "sha256:9f76d541cad6e36af7beb62e978876f3b41e3e04f2c1fbf0884604c0a9c4d93c", size = 100916, upload-time = "2025-03-17T00:02:52.713Z" },32+]33+34+[[package]]35+name = "babel"36+version = "2.17.0"37+source = { registry = "https://pypi.org/simple" }38+sdist = { url = "https://files.pythonhosted.org/packages/7d/6b/d52e42361e1aa00709585ecc30b3f9684b3ab62530771402248b1b1d6240/babel-2.17.0.tar.gz", hash = "sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d", size = 9951852, upload-time = "2025-02-01T15:17:41.026Z" }39+wheels = [40+ { url = "https://files.pythonhosted.org/packages/b7/b8/3fe70c75fe32afc4bb507f75563d39bc5642255d1d94f1f23604725780bf/babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2", size = 10182537, upload-time = "2025-02-01T15:17:37.39Z" },41+]42+43+[[package]]44+name = "cachetools"45+version = "6.0.0"46+source = { registry = "https://pypi.org/simple" }47+sdist = { url = "https://files.pythonhosted.org/packages/c0/b0/f539a1ddff36644c28a61490056e5bae43bd7386d9f9c69beae2d7e7d6d1/cachetools-6.0.0.tar.gz", hash = "sha256:f225782b84438f828328fc2ad74346522f27e5b1440f4e9fd18b20ebfd1aa2cf", size = 30160, upload-time = "2025-05-23T20:01:13.076Z" }48+wheels = [49+ { url = "https://files.pythonhosted.org/packages/6a/c3/8bb087c903c95a570015ce84e0c23ae1d79f528c349cbc141b5c4e250293/cachetools-6.0.0-py3-none-any.whl", hash = "sha256:82e73ba88f7b30228b5507dce1a1f878498fc669d972aef2dde4f3a3c24f103e", size = 10964, upload-time = "2025-05-23T20:01:11.323Z" },50+]51+52+[[package]]53+name = "certifi"54+version = "2025.4.26"55+source = { registry = "https://pypi.org/simple" }56+sdist = { url = "https://files.pythonhosted.org/packages/e8/9e/c05b3920a3b7d20d3d3310465f50348e5b3694f4f88c6daf736eef3024c4/certifi-2025.4.26.tar.gz", hash = "sha256:0a816057ea3cdefcef70270d2c515e4506bbc954f417fa5ade2021213bb8f0c6", size = 160705, upload-time = "2025-04-26T02:12:29.51Z" }57+wheels = [58+ { url = "https://files.pythonhosted.org/packages/4a/7e/3db2bd1b1f9e95f7cddca6d6e75e2f2bd9f51b1246e546d88addca0106bd/certifi-2025.4.26-py3-none-any.whl", hash = "sha256:30350364dfe371162649852c63336a15c70c6510c2ad5015b21c2345311805f3", size = 159618, upload-time = "2025-04-26T02:12:27.662Z" },59+]60+61+[[package]]62+name = "cfgv"63+version = "3.4.0"64+source = { registry = "https://pypi.org/simple" }65+sdist = { url = "https://files.pythonhosted.org/packages/11/74/539e56497d9bd1d484fd863dd69cbbfa653cd2aa27abfe35653494d85e94/cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560", size = 7114, upload-time = "2023-08-12T20:38:17.776Z" }66+wheels = [67+ { url = "https://files.pythonhosted.org/packages/c5/55/51844dd50c4fc7a33b653bfaba4c2456f06955289ca770a5dbd5fd267374/cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9", size = 7249, upload-time = "2023-08-12T20:38:16.269Z" },68+]69+70+[[package]]71+name = "chardet"72+version = "5.2.0"73+source = { registry = "https://pypi.org/simple" }74+sdist = { url = "https://files.pythonhosted.org/packages/f3/0d/f7b6ab21ec75897ed80c17d79b15951a719226b9fababf1e40ea74d69079/chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7", size = 2069618, upload-time = "2023-08-01T19:23:02.662Z" }75+wheels = [76+ { url = "https://files.pythonhosted.org/packages/38/6f/f5fbc992a329ee4e0f288c1fe0e2ad9485ed064cac731ed2fe47dcc38cbf/chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970", size = 199385, upload-time = "2023-08-01T19:23:00.661Z" },77+]78+79+[[package]]80+name = "charset-normalizer"81+version = "3.4.2"82+source = { registry = "https://pypi.org/simple" }83+sdist = { url = "https://files.pythonhosted.org/packages/e4/33/89c2ced2b67d1c2a61c19c6751aa8902d46ce3dacb23600a283619f5a12d/charset_normalizer-3.4.2.tar.gz", hash = "sha256:5baececa9ecba31eff645232d59845c07aa030f0c81ee70184a90d35099a0e63", size = 126367, upload-time = "2025-05-02T08:34:42.01Z" }84+wheels = [85+ { url = "https://files.pythonhosted.org/packages/95/28/9901804da60055b406e1a1c5ba7aac1276fb77f1dde635aabfc7fd84b8ab/charset_normalizer-3.4.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7c48ed483eb946e6c04ccbe02c6b4d1d48e51944b6db70f697e089c193404941", size = 201818, upload-time = "2025-05-02T08:31:46.725Z" },86+ { url = "https://files.pythonhosted.org/packages/d9/9b/892a8c8af9110935e5adcbb06d9c6fe741b6bb02608c6513983048ba1a18/charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2d318c11350e10662026ad0eb71bb51c7812fc8590825304ae0bdd4ac283acd", size = 144649, upload-time = "2025-05-02T08:31:48.889Z" },87+ { url = "https://files.pythonhosted.org/packages/7b/a5/4179abd063ff6414223575e008593861d62abfc22455b5d1a44995b7c101/charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9cbfacf36cb0ec2897ce0ebc5d08ca44213af24265bd56eca54bee7923c48fd6", size = 155045, upload-time = "2025-05-02T08:31:50.757Z" },88+ { url = "https://files.pythonhosted.org/packages/3b/95/bc08c7dfeddd26b4be8c8287b9bb055716f31077c8b0ea1cd09553794665/charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:18dd2e350387c87dabe711b86f83c9c78af772c748904d372ade190b5c7c9d4d", size = 147356, upload-time = "2025-05-02T08:31:52.634Z" },89+ { url = "https://files.pythonhosted.org/packages/a8/2d/7a5b635aa65284bf3eab7653e8b4151ab420ecbae918d3e359d1947b4d61/charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8075c35cd58273fee266c58c0c9b670947c19df5fb98e7b66710e04ad4e9ff86", size = 149471, upload-time = "2025-05-02T08:31:56.207Z" },90+ { url = "https://files.pythonhosted.org/packages/ae/38/51fc6ac74251fd331a8cfdb7ec57beba8c23fd5493f1050f71c87ef77ed0/charset_normalizer-3.4.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5bf4545e3b962767e5c06fe1738f951f77d27967cb2caa64c28be7c4563e162c", size = 151317, upload-time = "2025-05-02T08:31:57.613Z" },91+ { url = "https://files.pythonhosted.org/packages/b7/17/edee1e32215ee6e9e46c3e482645b46575a44a2d72c7dfd49e49f60ce6bf/charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:7a6ab32f7210554a96cd9e33abe3ddd86732beeafc7a28e9955cdf22ffadbab0", size = 146368, upload-time = "2025-05-02T08:31:59.468Z" },92+ { url = "https://files.pythonhosted.org/packages/26/2c/ea3e66f2b5f21fd00b2825c94cafb8c326ea6240cd80a91eb09e4a285830/charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:b33de11b92e9f75a2b545d6e9b6f37e398d86c3e9e9653c4864eb7e89c5773ef", size = 154491, upload-time = "2025-05-02T08:32:01.219Z" },93+ { url = "https://files.pythonhosted.org/packages/52/47/7be7fa972422ad062e909fd62460d45c3ef4c141805b7078dbab15904ff7/charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8755483f3c00d6c9a77f490c17e6ab0c8729e39e6390328e42521ef175380ae6", size = 157695, upload-time = "2025-05-02T08:32:03.045Z" },94+ { url = "https://files.pythonhosted.org/packages/2f/42/9f02c194da282b2b340f28e5fb60762de1151387a36842a92b533685c61e/charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:68a328e5f55ec37c57f19ebb1fdc56a248db2e3e9ad769919a58672958e8f366", size = 154849, upload-time = "2025-05-02T08:32:04.651Z" },95+ { url = "https://files.pythonhosted.org/packages/67/44/89cacd6628f31fb0b63201a618049be4be2a7435a31b55b5eb1c3674547a/charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:21b2899062867b0e1fde9b724f8aecb1af14f2778d69aacd1a5a1853a597a5db", size = 150091, upload-time = "2025-05-02T08:32:06.719Z" },96+ { url = "https://files.pythonhosted.org/packages/1f/79/4b8da9f712bc079c0f16b6d67b099b0b8d808c2292c937f267d816ec5ecc/charset_normalizer-3.4.2-cp310-cp310-win32.whl", hash = "sha256:e8082b26888e2f8b36a042a58307d5b917ef2b1cacab921ad3323ef91901c71a", size = 98445, upload-time = "2025-05-02T08:32:08.66Z" },97+ { url = "https://files.pythonhosted.org/packages/7d/d7/96970afb4fb66497a40761cdf7bd4f6fca0fc7bafde3a84f836c1f57a926/charset_normalizer-3.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:f69a27e45c43520f5487f27627059b64aaf160415589230992cec34c5e18a509", size = 105782, upload-time = "2025-05-02T08:32:10.46Z" },98+ { url = "https://files.pythonhosted.org/packages/05/85/4c40d00dcc6284a1c1ad5de5e0996b06f39d8232f1031cd23c2f5c07ee86/charset_normalizer-3.4.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:be1e352acbe3c78727a16a455126d9ff83ea2dfdcbc83148d2982305a04714c2", size = 198794, upload-time = "2025-05-02T08:32:11.945Z" },99+ { url = "https://files.pythonhosted.org/packages/41/d9/7a6c0b9db952598e97e93cbdfcb91bacd89b9b88c7c983250a77c008703c/charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa88ca0b1932e93f2d961bf3addbb2db902198dca337d88c89e1559e066e7645", size = 142846, upload-time = "2025-05-02T08:32:13.946Z" },100+ { url = "https://files.pythonhosted.org/packages/66/82/a37989cda2ace7e37f36c1a8ed16c58cf48965a79c2142713244bf945c89/charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d524ba3f1581b35c03cb42beebab4a13e6cdad7b36246bd22541fa585a56cccd", size = 153350, upload-time = "2025-05-02T08:32:15.873Z" },101+ { url = "https://files.pythonhosted.org/packages/df/68/a576b31b694d07b53807269d05ec3f6f1093e9545e8607121995ba7a8313/charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28a1005facc94196e1fb3e82a3d442a9d9110b8434fc1ded7a24a2983c9888d8", size = 145657, upload-time = "2025-05-02T08:32:17.283Z" },102+ { url = "https://files.pythonhosted.org/packages/92/9b/ad67f03d74554bed3aefd56fe836e1623a50780f7c998d00ca128924a499/charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fdb20a30fe1175ecabed17cbf7812f7b804b8a315a25f24678bcdf120a90077f", size = 147260, upload-time = "2025-05-02T08:32:18.807Z" },103+ { url = "https://files.pythonhosted.org/packages/a6/e6/8aebae25e328160b20e31a7e9929b1578bbdc7f42e66f46595a432f8539e/charset_normalizer-3.4.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0f5d9ed7f254402c9e7d35d2f5972c9bbea9040e99cd2861bd77dc68263277c7", size = 149164, upload-time = "2025-05-02T08:32:20.333Z" },104+ { url = "https://files.pythonhosted.org/packages/8b/f2/b3c2f07dbcc248805f10e67a0262c93308cfa149a4cd3d1fe01f593e5fd2/charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:efd387a49825780ff861998cd959767800d54f8308936b21025326de4b5a42b9", size = 144571, upload-time = "2025-05-02T08:32:21.86Z" },105+ { url = "https://files.pythonhosted.org/packages/60/5b/c3f3a94bc345bc211622ea59b4bed9ae63c00920e2e8f11824aa5708e8b7/charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f0aa37f3c979cf2546b73e8222bbfa3dc07a641585340179d768068e3455e544", size = 151952, upload-time = "2025-05-02T08:32:23.434Z" },106+ { url = "https://files.pythonhosted.org/packages/e2/4d/ff460c8b474122334c2fa394a3f99a04cf11c646da895f81402ae54f5c42/charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:e70e990b2137b29dc5564715de1e12701815dacc1d056308e2b17e9095372a82", size = 155959, upload-time = "2025-05-02T08:32:24.993Z" },107+ { url = "https://files.pythonhosted.org/packages/a2/2b/b964c6a2fda88611a1fe3d4c400d39c66a42d6c169c924818c848f922415/charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:0c8c57f84ccfc871a48a47321cfa49ae1df56cd1d965a09abe84066f6853b9c0", size = 153030, upload-time = "2025-05-02T08:32:26.435Z" },108+ { url = "https://files.pythonhosted.org/packages/59/2e/d3b9811db26a5ebf444bc0fa4f4be5aa6d76fc6e1c0fd537b16c14e849b6/charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6b66f92b17849b85cad91259efc341dce9c1af48e2173bf38a85c6329f1033e5", size = 148015, upload-time = "2025-05-02T08:32:28.376Z" },109+ { url = "https://files.pythonhosted.org/packages/90/07/c5fd7c11eafd561bb51220d600a788f1c8d77c5eef37ee49454cc5c35575/charset_normalizer-3.4.2-cp311-cp311-win32.whl", hash = "sha256:daac4765328a919a805fa5e2720f3e94767abd632ae410a9062dff5412bae65a", size = 98106, upload-time = "2025-05-02T08:32:30.281Z" },110+ { url = "https://files.pythonhosted.org/packages/a8/05/5e33dbef7e2f773d672b6d79f10ec633d4a71cd96db6673625838a4fd532/charset_normalizer-3.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:e53efc7c7cee4c1e70661e2e112ca46a575f90ed9ae3fef200f2a25e954f4b28", size = 105402, upload-time = "2025-05-02T08:32:32.191Z" },111+ { url = "https://files.pythonhosted.org/packages/d7/a4/37f4d6035c89cac7930395a35cc0f1b872e652eaafb76a6075943754f095/charset_normalizer-3.4.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0c29de6a1a95f24b9a1aa7aefd27d2487263f00dfd55a77719b530788f75cff7", size = 199936, upload-time = "2025-05-02T08:32:33.712Z" },112+ { url = "https://files.pythonhosted.org/packages/ee/8a/1a5e33b73e0d9287274f899d967907cd0bf9c343e651755d9307e0dbf2b3/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cddf7bd982eaa998934a91f69d182aec997c6c468898efe6679af88283b498d3", size = 143790, upload-time = "2025-05-02T08:32:35.768Z" },113+ { url = "https://files.pythonhosted.org/packages/66/52/59521f1d8e6ab1482164fa21409c5ef44da3e9f653c13ba71becdd98dec3/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a", size = 153924, upload-time = "2025-05-02T08:32:37.284Z" },114+ { url = "https://files.pythonhosted.org/packages/86/2d/fb55fdf41964ec782febbf33cb64be480a6b8f16ded2dbe8db27a405c09f/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d41c4d287cfc69060fa91cae9683eacffad989f1a10811995fa309df656ec214", size = 146626, upload-time = "2025-05-02T08:32:38.803Z" },115+ { url = "https://files.pythonhosted.org/packages/8c/73/6ede2ec59bce19b3edf4209d70004253ec5f4e319f9a2e3f2f15601ed5f7/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4e594135de17ab3866138f496755f302b72157d115086d100c3f19370839dd3a", size = 148567, upload-time = "2025-05-02T08:32:40.251Z" },116+ { url = "https://files.pythonhosted.org/packages/09/14/957d03c6dc343c04904530b6bef4e5efae5ec7d7990a7cbb868e4595ee30/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf713fe9a71ef6fd5adf7a79670135081cd4431c2943864757f0fa3a65b1fafd", size = 150957, upload-time = "2025-05-02T08:32:41.705Z" },117+ { url = "https://files.pythonhosted.org/packages/0d/c8/8174d0e5c10ccebdcb1b53cc959591c4c722a3ad92461a273e86b9f5a302/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a370b3e078e418187da8c3674eddb9d983ec09445c99a3a263c2011993522981", size = 145408, upload-time = "2025-05-02T08:32:43.709Z" },118+ { url = "https://files.pythonhosted.org/packages/58/aa/8904b84bc8084ac19dc52feb4f5952c6df03ffb460a887b42615ee1382e8/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a955b438e62efdf7e0b7b52a64dc5c3396e2634baa62471768a64bc2adb73d5c", size = 153399, upload-time = "2025-05-02T08:32:46.197Z" },119+ { url = "https://files.pythonhosted.org/packages/c2/26/89ee1f0e264d201cb65cf054aca6038c03b1a0c6b4ae998070392a3ce605/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:7222ffd5e4de8e57e03ce2cef95a4c43c98fcb72ad86909abdfc2c17d227fc1b", size = 156815, upload-time = "2025-05-02T08:32:48.105Z" },120+ { url = "https://files.pythonhosted.org/packages/fd/07/68e95b4b345bad3dbbd3a8681737b4338ff2c9df29856a6d6d23ac4c73cb/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:bee093bf902e1d8fc0ac143c88902c3dfc8941f7ea1d6a8dd2bcb786d33db03d", size = 154537, upload-time = "2025-05-02T08:32:49.719Z" },121+ { url = "https://files.pythonhosted.org/packages/77/1a/5eefc0ce04affb98af07bc05f3bac9094513c0e23b0562d64af46a06aae4/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:dedb8adb91d11846ee08bec4c8236c8549ac721c245678282dcb06b221aab59f", size = 149565, upload-time = "2025-05-02T08:32:51.404Z" },122+ { url = "https://files.pythonhosted.org/packages/37/a0/2410e5e6032a174c95e0806b1a6585eb21e12f445ebe239fac441995226a/charset_normalizer-3.4.2-cp312-cp312-win32.whl", hash = "sha256:db4c7bf0e07fc3b7d89ac2a5880a6a8062056801b83ff56d8464b70f65482b6c", size = 98357, upload-time = "2025-05-02T08:32:53.079Z" },123+ { url = "https://files.pythonhosted.org/packages/6c/4f/c02d5c493967af3eda9c771ad4d2bbc8df6f99ddbeb37ceea6e8716a32bc/charset_normalizer-3.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:5a9979887252a82fefd3d3ed2a8e3b937a7a809f65dcb1e068b090e165bbe99e", size = 105776, upload-time = "2025-05-02T08:32:54.573Z" },124+ { url = "https://files.pythonhosted.org/packages/ea/12/a93df3366ed32db1d907d7593a94f1fe6293903e3e92967bebd6950ed12c/charset_normalizer-3.4.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:926ca93accd5d36ccdabd803392ddc3e03e6d4cd1cf17deff3b989ab8e9dbcf0", size = 199622, upload-time = "2025-05-02T08:32:56.363Z" },125+ { url = "https://files.pythonhosted.org/packages/04/93/bf204e6f344c39d9937d3c13c8cd5bbfc266472e51fc8c07cb7f64fcd2de/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eba9904b0f38a143592d9fc0e19e2df0fa2e41c3c3745554761c5f6447eedabf", size = 143435, upload-time = "2025-05-02T08:32:58.551Z" },126+ { url = "https://files.pythonhosted.org/packages/22/2a/ea8a2095b0bafa6c5b5a55ffdc2f924455233ee7b91c69b7edfcc9e02284/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3fddb7e2c84ac87ac3a947cb4e66d143ca5863ef48e4a5ecb83bd48619e4634e", size = 153653, upload-time = "2025-05-02T08:33:00.342Z" },127+ { url = "https://files.pythonhosted.org/packages/b6/57/1b090ff183d13cef485dfbe272e2fe57622a76694061353c59da52c9a659/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98f862da73774290f251b9df8d11161b6cf25b599a66baf087c1ffe340e9bfd1", size = 146231, upload-time = "2025-05-02T08:33:02.081Z" },128+ { url = "https://files.pythonhosted.org/packages/e2/28/ffc026b26f441fc67bd21ab7f03b313ab3fe46714a14b516f931abe1a2d8/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c9379d65defcab82d07b2a9dfbfc2e95bc8fe0ebb1b176a3190230a3ef0e07c", size = 148243, upload-time = "2025-05-02T08:33:04.063Z" },129+ { url = "https://files.pythonhosted.org/packages/c0/0f/9abe9bd191629c33e69e47c6ef45ef99773320e9ad8e9cb08b8ab4a8d4cb/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e635b87f01ebc977342e2697d05b56632f5f879a4f15955dfe8cef2448b51691", size = 150442, upload-time = "2025-05-02T08:33:06.418Z" },130+ { url = "https://files.pythonhosted.org/packages/67/7c/a123bbcedca91d5916c056407f89a7f5e8fdfce12ba825d7d6b9954a1a3c/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:1c95a1e2902a8b722868587c0e1184ad5c55631de5afc0eb96bc4b0d738092c0", size = 145147, upload-time = "2025-05-02T08:33:08.183Z" },131+ { url = "https://files.pythonhosted.org/packages/ec/fe/1ac556fa4899d967b83e9893788e86b6af4d83e4726511eaaad035e36595/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ef8de666d6179b009dce7bcb2ad4c4a779f113f12caf8dc77f0162c29d20490b", size = 153057, upload-time = "2025-05-02T08:33:09.986Z" },132+ { url = "https://files.pythonhosted.org/packages/2b/ff/acfc0b0a70b19e3e54febdd5301a98b72fa07635e56f24f60502e954c461/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:32fc0341d72e0f73f80acb0a2c94216bd704f4f0bce10aedea38f30502b271ff", size = 156454, upload-time = "2025-05-02T08:33:11.814Z" },133+ { url = "https://files.pythonhosted.org/packages/92/08/95b458ce9c740d0645feb0e96cea1f5ec946ea9c580a94adfe0b617f3573/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:289200a18fa698949d2b39c671c2cc7a24d44096784e76614899a7ccf2574b7b", size = 154174, upload-time = "2025-05-02T08:33:13.707Z" },134+ { url = "https://files.pythonhosted.org/packages/78/be/8392efc43487ac051eee6c36d5fbd63032d78f7728cb37aebcc98191f1ff/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4a476b06fbcf359ad25d34a057b7219281286ae2477cc5ff5e3f70a246971148", size = 149166, upload-time = "2025-05-02T08:33:15.458Z" },135+ { url = "https://files.pythonhosted.org/packages/44/96/392abd49b094d30b91d9fbda6a69519e95802250b777841cf3bda8fe136c/charset_normalizer-3.4.2-cp313-cp313-win32.whl", hash = "sha256:aaeeb6a479c7667fbe1099af9617c83aaca22182d6cf8c53966491a0f1b7ffb7", size = 98064, upload-time = "2025-05-02T08:33:17.06Z" },136+ { url = "https://files.pythonhosted.org/packages/e9/b0/0200da600134e001d91851ddc797809e2fe0ea72de90e09bec5a2fbdaccb/charset_normalizer-3.4.2-cp313-cp313-win_amd64.whl", hash = "sha256:aa6af9e7d59f9c12b33ae4e9450619cf2488e2bbe9b44030905877f0b2324980", size = 105641, upload-time = "2025-05-02T08:33:18.753Z" },137+ { url = "https://files.pythonhosted.org/packages/20/94/c5790835a017658cbfabd07f3bfb549140c3ac458cfc196323996b10095a/charset_normalizer-3.4.2-py3-none-any.whl", hash = "sha256:7f56930ab0abd1c45cd15be65cc741c28b1c9a34876ce8c17a2fa107810c0af0", size = 52626, upload-time = "2025-05-02T08:34:40.053Z" },138+]139+140+[[package]]141+name = "click"142+version = "8.2.2"143+source = { editable = "." }144+dependencies = [145+ { name = "colorama", marker = "sys_platform == 'win32'" },146+]147+148+[package.dev-dependencies]149+dev = [150+ { name = "ruff" },151+ { name = "tox" },152+ { name = "tox-uv" },153+]154+docs = [155+ { name = "myst-parser" },156+ { name = "pallets-sphinx-themes" },157+ { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },158+ { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },159+ { name = "sphinx-tabs" },160+ { name = "sphinxcontrib-log-cabinet" },161+]162+docs-auto = [163+ { name = "sphinx-autobuild" },164+]165+gha-update = [166+ { name = "gha-update", marker = "python_full_version >= '3.12'" },167+]168+pre-commit = [169+ { name = "pre-commit" },170+ { name = "pre-commit-uv" },171+]172+tests = [173+ { name = "pytest" },174+]175+typing = [176+ { name = "mypy" },177+ { name = "pyright" },178+ { name = "pytest" },179+]180+181+[package.metadata]182+requires-dist = [{ name = "colorama", marker = "sys_platform == 'win32'" }]183+184+[package.metadata.requires-dev]185+dev = [186+ { name = "ruff" },187+ { name = "tox" },188+ { name = "tox-uv" },189+]190+docs = [191+ { name = "myst-parser" },192+ { name = "pallets-sphinx-themes" },193+ { name = "sphinx" },194+ { name = "sphinx-tabs" },195+ { name = "sphinxcontrib-log-cabinet" },196+]197+docs-auto = [{ name = "sphinx-autobuild" }]198+gha-update = [{ name = "gha-update", marker = "python_full_version >= '3.12'" }]199+pre-commit = [200+ { name = "pre-commit" },201+ { name = "pre-commit-uv" },202+]203+tests = [{ name = "pytest" }]204+typing = [205+ { name = "mypy" },206+ { name = "pyright" },207+ { name = "pytest" },208+]209+210+[[package]]211+name = "colorama"212+version = "0.4.6"213+source = { registry = "https://pypi.org/simple" }214+sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }215+wheels = [216+ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },217+]218+219+[[package]]220+name = "distlib"221+version = "0.3.9"222+source = { registry = "https://pypi.org/simple" }223+sdist = { url = "https://files.pythonhosted.org/packages/0d/dd/1bec4c5ddb504ca60fc29472f3d27e8d4da1257a854e1d96742f15c1d02d/distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403", size = 613923, upload-time = "2024-10-09T18:35:47.551Z" }224+wheels = [225+ { url = "https://files.pythonhosted.org/packages/91/a1/cf2472db20f7ce4a6be1253a81cfdf85ad9c7885ffbed7047fb72c24cf87/distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87", size = 468973, upload-time = "2024-10-09T18:35:44.272Z" },226+]227+228+[[package]]229+name = "docutils"230+version = "0.21.2"231+source = { registry = "https://pypi.org/simple" }232+sdist = { url = "https://files.pythonhosted.org/packages/ae/ed/aefcc8cd0ba62a0560c3c18c33925362d46c6075480bfa4df87b28e169a9/docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f", size = 2204444, upload-time = "2024-04-23T18:57:18.24Z" }233+wheels = [234+ { url = "https://files.pythonhosted.org/packages/8f/d7/9322c609343d929e75e7e5e6255e614fcc67572cfd083959cdef3b7aad79/docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2", size = 587408, upload-time = "2024-04-23T18:57:14.835Z" },235+]236+237+[[package]]238+name = "exceptiongroup"239+version = "1.3.0"240+source = { registry = "https://pypi.org/simple" }241+dependencies = [242+ { name = "typing-extensions", marker = "python_full_version < '3.11'" },243+]244+sdist = { url = "https://files.pythonhosted.org/packages/0b/9f/a65090624ecf468cdca03533906e7c69ed7588582240cfe7cc9e770b50eb/exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88", size = 29749, upload-time = "2025-05-10T17:42:51.123Z" }245+wheels = [246+ { url = "https://files.pythonhosted.org/packages/36/f4/c6e662dade71f56cd2f3735141b265c3c79293c109549c1e6933b0651ffc/exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10", size = 16674, upload-time = "2025-05-10T17:42:49.33Z" },247+]248+249+[[package]]250+name = "filelock"251+version = "3.18.0"252+source = { registry = "https://pypi.org/simple" }253+sdist = { url = "https://files.pythonhosted.org/packages/0a/10/c23352565a6544bdc5353e0b15fc1c563352101f30e24bf500207a54df9a/filelock-3.18.0.tar.gz", hash = "sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2", size = 18075, upload-time = "2025-03-14T07:11:40.47Z" }254+wheels = [255+ { url = "https://files.pythonhosted.org/packages/4d/36/2a115987e2d8c300a974597416d9de88f2444426de9571f4b59b2cca3acc/filelock-3.18.0-py3-none-any.whl", hash = "sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de", size = 16215, upload-time = "2025-03-14T07:11:39.145Z" },256+]257+258+[[package]]259+name = "gha-update"260+version = "0.1.0"261+source = { registry = "https://pypi.org/simple" }262+dependencies = [263+ { name = "click", marker = "python_full_version >= '3.12'" },264+ { name = "httpx", marker = "python_full_version >= '3.12'" },265+]266+sdist = { url = "https://files.pythonhosted.org/packages/d5/ac/f1b6699a529bd298a777199861a8232590bb612eac92e15bf1033134f123/gha_update-0.1.0.tar.gz", hash = "sha256:8c0f55ed7bdc11fb061d67984814fd642bd3a1872028e34c15c913cd59202d53", size = 3345, upload-time = "2024-08-23T20:58:42.478Z" }267+wheels = [268+ { url = "https://files.pythonhosted.org/packages/98/06/832338d1b5f82f17e1f4985146d81050cd2709ea54dab3f15b343ad227cc/gha_update-0.1.0-py3-none-any.whl", hash = "sha256:ec110088749eed66b5f55cc7f15f41a6af037446a5ac6a435b0768a57d52e087", size = 4513, upload-time = "2024-08-23T20:58:41.364Z" },269+]270+271+[[package]]272+name = "h11"273+version = "0.16.0"274+source = { registry = "https://pypi.org/simple" }275+sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }276+wheels = [277+ { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },278+]279+280+[[package]]281+name = "httpcore"282+version = "1.0.9"283+source = { registry = "https://pypi.org/simple" }284+dependencies = [285+ { name = "certifi", marker = "python_full_version >= '3.12'" },286+ { name = "h11", marker = "python_full_version >= '3.12'" },287+]288+sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" }289+wheels = [290+ { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" },291+]292+293+[[package]]294+name = "httpx"295+version = "0.28.1"296+source = { registry = "https://pypi.org/simple" }297+dependencies = [298+ { name = "anyio", marker = "python_full_version >= '3.12'" },299+ { name = "certifi", marker = "python_full_version >= '3.12'" },300+ { name = "httpcore", marker = "python_full_version >= '3.12'" },301+ { name = "idna", marker = "python_full_version >= '3.12'" },302+]303+sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" }304+wheels = [305+ { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" },306+]307+308+[[package]]309+name = "identify"310+version = "2.6.12"311+source = { registry = "https://pypi.org/simple" }312+sdist = { url = "https://files.pythonhosted.org/packages/a2/88/d193a27416618628a5eea64e3223acd800b40749a96ffb322a9b55a49ed1/identify-2.6.12.tar.gz", hash = "sha256:d8de45749f1efb108badef65ee8386f0f7bb19a7f26185f74de6367bffbaf0e6", size = 99254, upload-time = "2025-05-23T20:37:53.3Z" }313+wheels = [314+ { url = "https://files.pythonhosted.org/packages/7a/cd/18f8da995b658420625f7ef13f037be53ae04ec5ad33f9b718240dcfd48c/identify-2.6.12-py2.py3-none-any.whl", hash = "sha256:ad9672d5a72e0d2ff7c5c8809b62dfa60458626352fb0eb7b55e69bdc45334a2", size = 99145, upload-time = "2025-05-23T20:37:51.495Z" },315+]316+317+[[package]]318+name = "idna"319+version = "3.10"320+source = { registry = "https://pypi.org/simple" }321+sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490, upload-time = "2024-09-15T18:07:39.745Z" }322+wheels = [323+ { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" },324+]325+326+[[package]]327+name = "imagesize"328+version = "1.4.1"329+source = { registry = "https://pypi.org/simple" }330+sdist = { url = "https://files.pythonhosted.org/packages/a7/84/62473fb57d61e31fef6e36d64a179c8781605429fd927b5dd608c997be31/imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a", size = 1280026, upload-time = "2022-07-01T12:21:05.687Z" }331+wheels = [332+ { url = "https://files.pythonhosted.org/packages/ff/62/85c4c919272577931d407be5ba5d71c20f0b616d31a0befe0ae45bb79abd/imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b", size = 8769, upload-time = "2022-07-01T12:21:02.467Z" },333+]334+335+[[package]]336+name = "iniconfig"337+version = "2.1.0"338+source = { registry = "https://pypi.org/simple" }339+sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793, upload-time = "2025-03-19T20:09:59.721Z" }340+wheels = [341+ { url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" },342+]343+344+[[package]]345+name = "jinja2"346+version = "3.1.6"347+source = { registry = "https://pypi.org/simple" }348+dependencies = [349+ { name = "markupsafe" },350+]351+sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" }352+wheels = [353+ { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },354+]355+356+[[package]]357+name = "markdown-it-py"358+version = "3.0.0"359+source = { registry = "https://pypi.org/simple" }360+dependencies = [361+ { name = "mdurl" },362+]363+sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596, upload-time = "2023-06-03T06:41:14.443Z" }364+wheels = [365+ { url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528, upload-time = "2023-06-03T06:41:11.019Z" },366+]367+368+[[package]]369+name = "markupsafe"370+version = "3.0.2"371+source = { registry = "https://pypi.org/simple" }372+sdist = { url = "https://files.pythonhosted.org/packages/b2/97/5d42485e71dfc078108a86d6de8fa46db44a1a9295e89c5d6d4a06e23a62/markupsafe-3.0.2.tar.gz", hash = "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0", size = 20537, upload-time = "2024-10-18T15:21:54.129Z" }373+wheels = [374+ { url = "https://files.pythonhosted.org/packages/04/90/d08277ce111dd22f77149fd1a5d4653eeb3b3eaacbdfcbae5afb2600eebd/MarkupSafe-3.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8", size = 14357, upload-time = "2024-10-18T15:20:51.44Z" },375+ { url = "https://files.pythonhosted.org/packages/04/e1/6e2194baeae0bca1fae6629dc0cbbb968d4d941469cbab11a3872edff374/MarkupSafe-3.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158", size = 12393, upload-time = "2024-10-18T15:20:52.426Z" },376+ { url = "https://files.pythonhosted.org/packages/1d/69/35fa85a8ece0a437493dc61ce0bb6d459dcba482c34197e3efc829aa357f/MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38a9ef736c01fccdd6600705b09dc574584b89bea478200c5fbf112a6b0d5579", size = 21732, upload-time = "2024-10-18T15:20:53.578Z" },377+ { url = "https://files.pythonhosted.org/packages/22/35/137da042dfb4720b638d2937c38a9c2df83fe32d20e8c8f3185dbfef05f7/MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbcb445fa71794da8f178f0f6d66789a28d7319071af7a496d4d507ed566270d", size = 20866, upload-time = "2024-10-18T15:20:55.06Z" },378+ { url = "https://files.pythonhosted.org/packages/29/28/6d029a903727a1b62edb51863232152fd335d602def598dade38996887f0/MarkupSafe-3.0.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:57cb5a3cf367aeb1d316576250f65edec5bb3be939e9247ae594b4bcbc317dfb", size = 20964, upload-time = "2024-10-18T15:20:55.906Z" },379+ { url = "https://files.pythonhosted.org/packages/cc/cd/07438f95f83e8bc028279909d9c9bd39e24149b0d60053a97b2bc4f8aa51/MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3809ede931876f5b2ec92eef964286840ed3540dadf803dd570c3b7e13141a3b", size = 21977, upload-time = "2024-10-18T15:20:57.189Z" },380+ { url = "https://files.pythonhosted.org/packages/29/01/84b57395b4cc062f9c4c55ce0df7d3108ca32397299d9df00fedd9117d3d/MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e07c3764494e3776c602c1e78e298937c3315ccc9043ead7e685b7f2b8d47b3c", size = 21366, upload-time = "2024-10-18T15:20:58.235Z" },381+ { url = "https://files.pythonhosted.org/packages/bd/6e/61ebf08d8940553afff20d1fb1ba7294b6f8d279df9fd0c0db911b4bbcfd/MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b424c77b206d63d500bcb69fa55ed8d0e6a3774056bdc4839fc9298a7edca171", size = 21091, upload-time = "2024-10-18T15:20:59.235Z" },382+ { url = "https://files.pythonhosted.org/packages/11/23/ffbf53694e8c94ebd1e7e491de185124277964344733c45481f32ede2499/MarkupSafe-3.0.2-cp310-cp310-win32.whl", hash = "sha256:fcabf5ff6eea076f859677f5f0b6b5c1a51e70a376b0579e0eadef8db48c6b50", size = 15065, upload-time = "2024-10-18T15:21:00.307Z" },383+ { url = "https://files.pythonhosted.org/packages/44/06/e7175d06dd6e9172d4a69a72592cb3f7a996a9c396eee29082826449bbc3/MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:6af100e168aa82a50e186c82875a5893c5597a0c1ccdb0d8b40240b1f28b969a", size = 15514, upload-time = "2024-10-18T15:21:01.122Z" },384+ { url = "https://files.pythonhosted.org/packages/6b/28/bbf83e3f76936960b850435576dd5e67034e200469571be53f69174a2dfd/MarkupSafe-3.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d", size = 14353, upload-time = "2024-10-18T15:21:02.187Z" },385+ { url = "https://files.pythonhosted.org/packages/6c/30/316d194b093cde57d448a4c3209f22e3046c5bb2fb0820b118292b334be7/MarkupSafe-3.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93", size = 12392, upload-time = "2024-10-18T15:21:02.941Z" },386+ { url = "https://files.pythonhosted.org/packages/f2/96/9cdafba8445d3a53cae530aaf83c38ec64c4d5427d975c974084af5bc5d2/MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832", size = 23984, upload-time = "2024-10-18T15:21:03.953Z" },387+ { url = "https://files.pythonhosted.org/packages/f1/a4/aefb044a2cd8d7334c8a47d3fb2c9f328ac48cb349468cc31c20b539305f/MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84", size = 23120, upload-time = "2024-10-18T15:21:06.495Z" },388+ { url = "https://files.pythonhosted.org/packages/8d/21/5e4851379f88f3fad1de30361db501300d4f07bcad047d3cb0449fc51f8c/MarkupSafe-3.0.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca", size = 23032, upload-time = "2024-10-18T15:21:07.295Z" },389+ { url = "https://files.pythonhosted.org/packages/00/7b/e92c64e079b2d0d7ddf69899c98842f3f9a60a1ae72657c89ce2655c999d/MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798", size = 24057, upload-time = "2024-10-18T15:21:08.073Z" },390+ { url = "https://files.pythonhosted.org/packages/f9/ac/46f960ca323037caa0a10662ef97d0a4728e890334fc156b9f9e52bcc4ca/MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e", size = 23359, upload-time = "2024-10-18T15:21:09.318Z" },391+ { url = "https://files.pythonhosted.org/packages/69/84/83439e16197337b8b14b6a5b9c2105fff81d42c2a7c5b58ac7b62ee2c3b1/MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4", size = 23306, upload-time = "2024-10-18T15:21:10.185Z" },392+ { url = "https://files.pythonhosted.org/packages/9a/34/a15aa69f01e2181ed8d2b685c0d2f6655d5cca2c4db0ddea775e631918cd/MarkupSafe-3.0.2-cp311-cp311-win32.whl", hash = "sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d", size = 15094, upload-time = "2024-10-18T15:21:11.005Z" },393+ { url = "https://files.pythonhosted.org/packages/da/b8/3a3bd761922d416f3dc5d00bfbed11f66b1ab89a0c2b6e887240a30b0f6b/MarkupSafe-3.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b", size = 15521, upload-time = "2024-10-18T15:21:12.911Z" },394+ { url = "https://files.pythonhosted.org/packages/22/09/d1f21434c97fc42f09d290cbb6350d44eb12f09cc62c9476effdb33a18aa/MarkupSafe-3.0.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf", size = 14274, upload-time = "2024-10-18T15:21:13.777Z" },395+ { url = "https://files.pythonhosted.org/packages/6b/b0/18f76bba336fa5aecf79d45dcd6c806c280ec44538b3c13671d49099fdd0/MarkupSafe-3.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225", size = 12348, upload-time = "2024-10-18T15:21:14.822Z" },396+ { url = "https://files.pythonhosted.org/packages/e0/25/dd5c0f6ac1311e9b40f4af06c78efde0f3b5cbf02502f8ef9501294c425b/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028", size = 24149, upload-time = "2024-10-18T15:21:15.642Z" },397+ { url = "https://files.pythonhosted.org/packages/f3/f0/89e7aadfb3749d0f52234a0c8c7867877876e0a20b60e2188e9850794c17/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8", size = 23118, upload-time = "2024-10-18T15:21:17.133Z" },398+ { url = "https://files.pythonhosted.org/packages/d5/da/f2eeb64c723f5e3777bc081da884b414671982008c47dcc1873d81f625b6/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c", size = 22993, upload-time = "2024-10-18T15:21:18.064Z" },399+ { url = "https://files.pythonhosted.org/packages/da/0e/1f32af846df486dce7c227fe0f2398dc7e2e51d4a370508281f3c1c5cddc/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557", size = 24178, upload-time = "2024-10-18T15:21:18.859Z" },400+ { url = "https://files.pythonhosted.org/packages/c4/f6/bb3ca0532de8086cbff5f06d137064c8410d10779c4c127e0e47d17c0b71/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22", size = 23319, upload-time = "2024-10-18T15:21:19.671Z" },401+ { url = "https://files.pythonhosted.org/packages/a2/82/8be4c96ffee03c5b4a034e60a31294daf481e12c7c43ab8e34a1453ee48b/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48", size = 23352, upload-time = "2024-10-18T15:21:20.971Z" },402+ { url = "https://files.pythonhosted.org/packages/51/ae/97827349d3fcffee7e184bdf7f41cd6b88d9919c80f0263ba7acd1bbcb18/MarkupSafe-3.0.2-cp312-cp312-win32.whl", hash = "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30", size = 15097, upload-time = "2024-10-18T15:21:22.646Z" },403+ { url = "https://files.pythonhosted.org/packages/c1/80/a61f99dc3a936413c3ee4e1eecac96c0da5ed07ad56fd975f1a9da5bc630/MarkupSafe-3.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87", size = 15601, upload-time = "2024-10-18T15:21:23.499Z" },404+ { url = "https://files.pythonhosted.org/packages/83/0e/67eb10a7ecc77a0c2bbe2b0235765b98d164d81600746914bebada795e97/MarkupSafe-3.0.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd", size = 14274, upload-time = "2024-10-18T15:21:24.577Z" },405+ { url = "https://files.pythonhosted.org/packages/2b/6d/9409f3684d3335375d04e5f05744dfe7e9f120062c9857df4ab490a1031a/MarkupSafe-3.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430", size = 12352, upload-time = "2024-10-18T15:21:25.382Z" },406+ { url = "https://files.pythonhosted.org/packages/d2/f5/6eadfcd3885ea85fe2a7c128315cc1bb7241e1987443d78c8fe712d03091/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094", size = 24122, upload-time = "2024-10-18T15:21:26.199Z" },407+ { url = "https://files.pythonhosted.org/packages/0c/91/96cf928db8236f1bfab6ce15ad070dfdd02ed88261c2afafd4b43575e9e9/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396", size = 23085, upload-time = "2024-10-18T15:21:27.029Z" },408+ { url = "https://files.pythonhosted.org/packages/c2/cf/c9d56af24d56ea04daae7ac0940232d31d5a8354f2b457c6d856b2057d69/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79", size = 22978, upload-time = "2024-10-18T15:21:27.846Z" },409+ { url = "https://files.pythonhosted.org/packages/2a/9f/8619835cd6a711d6272d62abb78c033bda638fdc54c4e7f4272cf1c0962b/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a", size = 24208, upload-time = "2024-10-18T15:21:28.744Z" },410+ { url = "https://files.pythonhosted.org/packages/f9/bf/176950a1792b2cd2102b8ffeb5133e1ed984547b75db47c25a67d3359f77/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca", size = 23357, upload-time = "2024-10-18T15:21:29.545Z" },411+ { url = "https://files.pythonhosted.org/packages/ce/4f/9a02c1d335caabe5c4efb90e1b6e8ee944aa245c1aaaab8e8a618987d816/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c", size = 23344, upload-time = "2024-10-18T15:21:30.366Z" },412+ { url = "https://files.pythonhosted.org/packages/ee/55/c271b57db36f748f0e04a759ace9f8f759ccf22b4960c270c78a394f58be/MarkupSafe-3.0.2-cp313-cp313-win32.whl", hash = "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1", size = 15101, upload-time = "2024-10-18T15:21:31.207Z" },413+ { url = "https://files.pythonhosted.org/packages/29/88/07df22d2dd4df40aba9f3e402e6dc1b8ee86297dddbad4872bd5e7b0094f/MarkupSafe-3.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f", size = 15603, upload-time = "2024-10-18T15:21:32.032Z" },414+ { url = "https://files.pythonhosted.org/packages/62/6a/8b89d24db2d32d433dffcd6a8779159da109842434f1dd2f6e71f32f738c/MarkupSafe-3.0.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c", size = 14510, upload-time = "2024-10-18T15:21:33.625Z" },415+ { url = "https://files.pythonhosted.org/packages/7a/06/a10f955f70a2e5a9bf78d11a161029d278eeacbd35ef806c3fd17b13060d/MarkupSafe-3.0.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb", size = 12486, upload-time = "2024-10-18T15:21:34.611Z" },416+ { url = "https://files.pythonhosted.org/packages/34/cf/65d4a571869a1a9078198ca28f39fba5fbb910f952f9dbc5220afff9f5e6/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c", size = 25480, upload-time = "2024-10-18T15:21:35.398Z" },417+ { url = "https://files.pythonhosted.org/packages/0c/e3/90e9651924c430b885468b56b3d597cabf6d72be4b24a0acd1fa0e12af67/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d", size = 23914, upload-time = "2024-10-18T15:21:36.231Z" },418+ { url = "https://files.pythonhosted.org/packages/66/8c/6c7cf61f95d63bb866db39085150df1f2a5bd3335298f14a66b48e92659c/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe", size = 23796, upload-time = "2024-10-18T15:21:37.073Z" },419+ { url = "https://files.pythonhosted.org/packages/bb/35/cbe9238ec3f47ac9a7c8b3df7a808e7cb50fe149dc7039f5f454b3fba218/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5", size = 25473, upload-time = "2024-10-18T15:21:37.932Z" },420+ { url = "https://files.pythonhosted.org/packages/e6/32/7621a4382488aa283cc05e8984a9c219abad3bca087be9ec77e89939ded9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a", size = 24114, upload-time = "2024-10-18T15:21:39.799Z" },421+ { url = "https://files.pythonhosted.org/packages/0d/80/0985960e4b89922cb5a0bac0ed39c5b96cbc1a536a99f30e8c220a996ed9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9", size = 24098, upload-time = "2024-10-18T15:21:40.813Z" },422+ { url = "https://files.pythonhosted.org/packages/82/78/fedb03c7d5380df2427038ec8d973587e90561b2d90cd472ce9254cf348b/MarkupSafe-3.0.2-cp313-cp313t-win32.whl", hash = "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6", size = 15208, upload-time = "2024-10-18T15:21:41.814Z" },423+ { url = "https://files.pythonhosted.org/packages/4f/65/6079a46068dfceaeabb5dcad6d674f5f5c61a6fa5673746f42a9f4c233b3/MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", size = 15739, upload-time = "2024-10-18T15:21:42.784Z" },424+]425+426+[[package]]427+name = "mdit-py-plugins"428+version = "0.4.2"429+source = { registry = "https://pypi.org/simple" }430+dependencies = [431+ { name = "markdown-it-py" },432+]433+sdist = { url = "https://files.pythonhosted.org/packages/19/03/a2ecab526543b152300717cf232bb4bb8605b6edb946c845016fa9c9c9fd/mdit_py_plugins-0.4.2.tar.gz", hash = "sha256:5f2cd1fdb606ddf152d37ec30e46101a60512bc0e5fa1a7002c36647b09e26b5", size = 43542, upload-time = "2024-09-09T20:27:49.564Z" }434+wheels = [435+ { url = "https://files.pythonhosted.org/packages/a7/f7/7782a043553ee469c1ff49cfa1cdace2d6bf99a1f333cf38676b3ddf30da/mdit_py_plugins-0.4.2-py3-none-any.whl", hash = "sha256:0c673c3f889399a33b95e88d2f0d111b4447bdfea7f237dab2d488f459835636", size = 55316, upload-time = "2024-09-09T20:27:48.397Z" },436+]437+438+[[package]]439+name = "mdurl"440+version = "0.1.2"441+source = { registry = "https://pypi.org/simple" }442+sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" }443+wheels = [444+ { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" },445+]446+447+[[package]]448+name = "mypy"449+version = "1.16.0"450+source = { registry = "https://pypi.org/simple" }451+dependencies = [452+ { name = "mypy-extensions" },453+ { name = "pathspec" },454+ { name = "tomli", marker = "python_full_version < '3.11'" },455+ { name = "typing-extensions" },456+]457+sdist = { url = "https://files.pythonhosted.org/packages/d4/38/13c2f1abae94d5ea0354e146b95a1be9b2137a0d506728e0da037c4276f6/mypy-1.16.0.tar.gz", hash = "sha256:84b94283f817e2aa6350a14b4a8fb2a35a53c286f97c9d30f53b63620e7af8ab", size = 3323139, upload-time = "2025-05-29T13:46:12.532Z" }458+wheels = [459+ { url = "https://files.pythonhosted.org/packages/64/5e/a0485f0608a3d67029d3d73cec209278b025e3493a3acfda3ef3a88540fd/mypy-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7909541fef256527e5ee9c0a7e2aeed78b6cda72ba44298d1334fe7881b05c5c", size = 10967416, upload-time = "2025-05-29T13:34:17.783Z" },460+ { url = "https://files.pythonhosted.org/packages/4b/53/5837c221f74c0d53a4bfc3003296f8179c3a2a7f336d7de7bbafbe96b688/mypy-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e71d6f0090c2256c713ed3d52711d01859c82608b5d68d4fa01a3fe30df95571", size = 10087654, upload-time = "2025-05-29T13:32:37.878Z" },461+ { url = "https://files.pythonhosted.org/packages/29/59/5fd2400352c3093bed4c09017fe671d26bc5bb7e6ef2d4bf85f2a2488104/mypy-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:936ccfdd749af4766be824268bfe22d1db9eb2f34a3ea1d00ffbe5b5265f5491", size = 11875192, upload-time = "2025-05-29T13:34:54.281Z" },462+ { url = "https://files.pythonhosted.org/packages/ad/3e/4bfec74663a64c2012f3e278dbc29ffe82b121bc551758590d1b6449ec0c/mypy-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4086883a73166631307fdd330c4a9080ce24913d4f4c5ec596c601b3a4bdd777", size = 12612939, upload-time = "2025-05-29T13:33:14.766Z" },463+ { url = "https://files.pythonhosted.org/packages/88/1f/fecbe3dcba4bf2ca34c26ca016383a9676711907f8db4da8354925cbb08f/mypy-1.16.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:feec38097f71797da0231997e0de3a58108c51845399669ebc532c815f93866b", size = 12874719, upload-time = "2025-05-29T13:21:52.09Z" },464+ { url = "https://files.pythonhosted.org/packages/f3/51/c2d280601cd816c43dfa512a759270d5a5ef638d7ac9bea9134c8305a12f/mypy-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:09a8da6a0ee9a9770b8ff61b39c0bb07971cda90e7297f4213741b48a0cc8d93", size = 9487053, upload-time = "2025-05-29T13:33:29.797Z" },465+ { url = "https://files.pythonhosted.org/packages/24/c4/ff2f79db7075c274fe85b5fff8797d29c6b61b8854c39e3b7feb556aa377/mypy-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9f826aaa7ff8443bac6a494cf743f591488ea940dd360e7dd330e30dd772a5ab", size = 10884498, upload-time = "2025-05-29T13:18:54.066Z" },466+ { url = "https://files.pythonhosted.org/packages/02/07/12198e83006235f10f6a7808917376b5d6240a2fd5dce740fe5d2ebf3247/mypy-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:82d056e6faa508501af333a6af192c700b33e15865bda49611e3d7d8358ebea2", size = 10011755, upload-time = "2025-05-29T13:34:00.851Z" },467+ { url = "https://files.pythonhosted.org/packages/f1/9b/5fd5801a72b5d6fb6ec0105ea1d0e01ab2d4971893076e558d4b6d6b5f80/mypy-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:089bedc02307c2548eb51f426e085546db1fa7dd87fbb7c9fa561575cf6eb1ff", size = 11800138, upload-time = "2025-05-29T13:32:55.082Z" },468+ { url = "https://files.pythonhosted.org/packages/2e/81/a117441ea5dfc3746431e51d78a4aca569c677aa225bca2cc05a7c239b61/mypy-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6a2322896003ba66bbd1318c10d3afdfe24e78ef12ea10e2acd985e9d684a666", size = 12533156, upload-time = "2025-05-29T13:19:12.963Z" },469+ { url = "https://files.pythonhosted.org/packages/3f/38/88ec57c6c86014d3f06251e00f397b5a7daa6888884d0abf187e4f5f587f/mypy-1.16.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:021a68568082c5b36e977d54e8f1de978baf401a33884ffcea09bd8e88a98f4c", size = 12742426, upload-time = "2025-05-29T13:20:22.72Z" },470+ { url = "https://files.pythonhosted.org/packages/bd/53/7e9d528433d56e6f6f77ccf24af6ce570986c2d98a5839e4c2009ef47283/mypy-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:54066fed302d83bf5128632d05b4ec68412e1f03ef2c300434057d66866cea4b", size = 9478319, upload-time = "2025-05-29T13:21:17.582Z" },471+ { url = "https://files.pythonhosted.org/packages/70/cf/158e5055e60ca2be23aec54a3010f89dcffd788732634b344fc9cb1e85a0/mypy-1.16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c5436d11e89a3ad16ce8afe752f0f373ae9620841c50883dc96f8b8805620b13", size = 11062927, upload-time = "2025-05-29T13:35:52.328Z" },472+ { url = "https://files.pythonhosted.org/packages/94/34/cfff7a56be1609f5d10ef386342ce3494158e4d506516890142007e6472c/mypy-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f2622af30bf01d8fc36466231bdd203d120d7a599a6d88fb22bdcb9dbff84090", size = 10083082, upload-time = "2025-05-29T13:35:33.378Z" },473+ { url = "https://files.pythonhosted.org/packages/b3/7f/7242062ec6288c33d8ad89574df87c3903d394870e5e6ba1699317a65075/mypy-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d045d33c284e10a038f5e29faca055b90eee87da3fc63b8889085744ebabb5a1", size = 11828306, upload-time = "2025-05-29T13:21:02.164Z" },474+ { url = "https://files.pythonhosted.org/packages/6f/5f/b392f7b4f659f5b619ce5994c5c43caab3d80df2296ae54fa888b3d17f5a/mypy-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b4968f14f44c62e2ec4a038c8797a87315be8df7740dc3ee8d3bfe1c6bf5dba8", size = 12702764, upload-time = "2025-05-29T13:20:42.826Z" },475+ { url = "https://files.pythonhosted.org/packages/9b/c0/7646ef3a00fa39ac9bc0938626d9ff29d19d733011be929cfea59d82d136/mypy-1.16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:eb14a4a871bb8efb1e4a50360d4e3c8d6c601e7a31028a2c79f9bb659b63d730", size = 12896233, upload-time = "2025-05-29T13:18:37.446Z" },476+ { url = "https://files.pythonhosted.org/packages/6d/38/52f4b808b3fef7f0ef840ee8ff6ce5b5d77381e65425758d515cdd4f5bb5/mypy-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:bd4e1ebe126152a7bbaa4daedd781c90c8f9643c79b9748caa270ad542f12bec", size = 9565547, upload-time = "2025-05-29T13:20:02.836Z" },477+ { url = "https://files.pythonhosted.org/packages/97/9c/ca03bdbefbaa03b264b9318a98950a9c683e06472226b55472f96ebbc53d/mypy-1.16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a9e056237c89f1587a3be1a3a70a06a698d25e2479b9a2f57325ddaaffc3567b", size = 11059753, upload-time = "2025-05-29T13:18:18.167Z" },478+ { url = "https://files.pythonhosted.org/packages/36/92/79a969b8302cfe316027c88f7dc6fee70129490a370b3f6eb11d777749d0/mypy-1.16.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0b07e107affb9ee6ce1f342c07f51552d126c32cd62955f59a7db94a51ad12c0", size = 10073338, upload-time = "2025-05-29T13:19:48.079Z" },479+ { url = "https://files.pythonhosted.org/packages/14/9b/a943f09319167da0552d5cd722104096a9c99270719b1afeea60d11610aa/mypy-1.16.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c6fb60cbd85dc65d4d63d37cb5c86f4e3a301ec605f606ae3a9173e5cf34997b", size = 11827764, upload-time = "2025-05-29T13:46:04.47Z" },480+ { url = "https://files.pythonhosted.org/packages/ec/64/ff75e71c65a0cb6ee737287c7913ea155845a556c64144c65b811afdb9c7/mypy-1.16.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a7e32297a437cc915599e0578fa6bc68ae6a8dc059c9e009c628e1c47f91495d", size = 12701356, upload-time = "2025-05-29T13:35:13.553Z" },481+ { url = "https://files.pythonhosted.org/packages/0a/ad/0e93c18987a1182c350f7a5fab70550852f9fabe30ecb63bfbe51b602074/mypy-1.16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:afe420c9380ccec31e744e8baff0d406c846683681025db3531b32db56962d52", size = 12900745, upload-time = "2025-05-29T13:17:24.409Z" },482+ { url = "https://files.pythonhosted.org/packages/28/5d/036c278d7a013e97e33f08c047fe5583ab4f1fc47c9a49f985f1cdd2a2d7/mypy-1.16.0-cp313-cp313-win_amd64.whl", hash = "sha256:55f9076c6ce55dd3f8cd0c6fff26a008ca8e5131b89d5ba6d86bd3f47e736eeb", size = 9572200, upload-time = "2025-05-29T13:33:44.92Z" },483+ { url = "https://files.pythonhosted.org/packages/99/a3/6ed10530dec8e0fdc890d81361260c9ef1f5e5c217ad8c9b21ecb2b8366b/mypy-1.16.0-py3-none-any.whl", hash = "sha256:29e1499864a3888bca5c1542f2d7232c6e586295183320caa95758fc84034031", size = 2265773, upload-time = "2025-05-29T13:35:18.762Z" },484+]485+486+[[package]]487+name = "mypy-extensions"488+version = "1.1.0"489+source = { registry = "https://pypi.org/simple" }490+sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" }491+wheels = [492+ { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" },493+]494+495+[[package]]496+name = "myst-parser"497+version = "4.0.1"498+source = { registry = "https://pypi.org/simple" }499+dependencies = [500+ { name = "docutils" },501+ { name = "jinja2" },502+ { name = "markdown-it-py" },503+ { name = "mdit-py-plugins" },504+ { name = "pyyaml" },505+ { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },506+ { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },507+]508+sdist = { url = "https://files.pythonhosted.org/packages/66/a5/9626ba4f73555b3735ad86247a8077d4603aa8628537687c839ab08bfe44/myst_parser-4.0.1.tar.gz", hash = "sha256:5cfea715e4f3574138aecbf7d54132296bfd72bb614d31168f48c477a830a7c4", size = 93985, upload-time = "2025-02-12T10:53:03.833Z" }509+wheels = [510+ { url = "https://files.pythonhosted.org/packages/5f/df/76d0321c3797b54b60fef9ec3bd6f4cfd124b9e422182156a1dd418722cf/myst_parser-4.0.1-py3-none-any.whl", hash = "sha256:9134e88959ec3b5780aedf8a99680ea242869d012e8821db3126d427edc9c95d", size = 84579, upload-time = "2025-02-12T10:53:02.078Z" },511+]512+513+[[package]]514+name = "nodeenv"515+version = "1.9.1"516+source = { registry = "https://pypi.org/simple" }517+sdist = { url = "https://files.pythonhosted.org/packages/43/16/fc88b08840de0e0a72a2f9d8c6bae36be573e475a6326ae854bcc549fc45/nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f", size = 47437, upload-time = "2024-06-04T18:44:11.171Z" }518+wheels = [519+ { url = "https://files.pythonhosted.org/packages/d2/1d/1b658dbd2b9fa9c4c9f32accbfc0205d532c8c6194dc0f2a4c0428e7128a/nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9", size = 22314, upload-time = "2024-06-04T18:44:08.352Z" },520+]521+522+[[package]]523+name = "packaging"524+version = "25.0"525+source = { registry = "https://pypi.org/simple" }526+sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" }527+wheels = [528+ { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" },529+]530+531+[[package]]532+name = "pallets-sphinx-themes"533+version = "2.3.0"534+source = { registry = "https://pypi.org/simple" }535+dependencies = [536+ { name = "packaging" },537+ { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },538+ { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },539+ { name = "sphinx-notfound-page" },540+]541+sdist = { url = "https://files.pythonhosted.org/packages/3b/08/c57dd89e45dbc976930200a2cb7826ed76f3c9791454a9fcd1cde3f17177/pallets_sphinx_themes-2.3.0.tar.gz", hash = "sha256:6293ced11a1d5d3de7268af1acd60428732b5a9e6051a47a596c6d9a083e60d9", size = 21029, upload-time = "2024-10-24T18:52:38.574Z" }542+wheels = [543+ { url = "https://files.pythonhosted.org/packages/ff/7d/a4aa06e452e031559dcfb066e035d2615ebfa6148e93514d7c36030004c1/pallets_sphinx_themes-2.3.0-py3-none-any.whl", hash = "sha256:7ed13de3743c462c2804e2aa63d96cc9ffa82cb76d0251cea03de9bcd9f8dbec", size = 24745, upload-time = "2024-10-24T18:52:37.265Z" },544+]545+546+[[package]]547+name = "pathspec"548+version = "0.12.1"549+source = { registry = "https://pypi.org/simple" }550+sdist = { url = "https://files.pythonhosted.org/packages/ca/bc/f35b8446f4531a7cb215605d100cd88b7ac6f44ab3fc94870c120ab3adbf/pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712", size = 51043, upload-time = "2023-12-10T22:30:45Z" }551+wheels = [552+ { url = "https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", size = 31191, upload-time = "2023-12-10T22:30:43.14Z" },553+]554+555+[[package]]556+name = "platformdirs"557+version = "4.3.8"558+source = { registry = "https://pypi.org/simple" }559+sdist = { url = "https://files.pythonhosted.org/packages/fe/8b/3c73abc9c759ecd3f1f7ceff6685840859e8070c4d947c93fae71f6a0bf2/platformdirs-4.3.8.tar.gz", hash = "sha256:3d512d96e16bcb959a814c9f348431070822a6496326a4be0911c40b5a74c2bc", size = 21362, upload-time = "2025-05-07T22:47:42.121Z" }560+wheels = [561+ { url = "https://files.pythonhosted.org/packages/fe/39/979e8e21520d4e47a0bbe349e2713c0aac6f3d853d0e5b34d76206c439aa/platformdirs-4.3.8-py3-none-any.whl", hash = "sha256:ff7059bb7eb1179e2685604f4aaf157cfd9535242bd23742eadc3c13542139b4", size = 18567, upload-time = "2025-05-07T22:47:40.376Z" },562+]563+564+[[package]]565+name = "pluggy"566+version = "1.6.0"567+source = { registry = "https://pypi.org/simple" }568+sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }569+wheels = [570+ { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },571+]572+573+[[package]]574+name = "pre-commit"575+version = "4.2.0"576+source = { registry = "https://pypi.org/simple" }577+dependencies = [578+ { name = "cfgv" },579+ { name = "identify" },580+ { name = "nodeenv" },581+ { name = "pyyaml" },582+ { name = "virtualenv" },583+]584+sdist = { url = "https://files.pythonhosted.org/packages/08/39/679ca9b26c7bb2999ff122d50faa301e49af82ca9c066ec061cfbc0c6784/pre_commit-4.2.0.tar.gz", hash = "sha256:601283b9757afd87d40c4c4a9b2b5de9637a8ea02eaff7adc2d0fb4e04841146", size = 193424, upload-time = "2025-03-18T21:35:20.987Z" }585+wheels = [586+ { url = "https://files.pythonhosted.org/packages/88/74/a88bf1b1efeae488a0c0b7bdf71429c313722d1fc0f377537fbe554e6180/pre_commit-4.2.0-py2.py3-none-any.whl", hash = "sha256:a009ca7205f1eb497d10b845e52c838a98b6cdd2102a6c8e4540e94ee75c58bd", size = 220707, upload-time = "2025-03-18T21:35:19.343Z" },587+]588+589+[[package]]590+name = "pre-commit-uv"591+version = "4.1.4"592+source = { registry = "https://pypi.org/simple" }593+dependencies = [594+ { name = "pre-commit" },595+ { name = "uv" },596+]597+sdist = { url = "https://files.pythonhosted.org/packages/b1/6c/c3c1d01698c8abb0b546defc0304971fa7fb2ba84ad35587b9dad095d73f/pre_commit_uv-4.1.4.tar.gz", hash = "sha256:3db606a79b226127b27dbbd8381b78c0e30de3ac775a8492c576a68e9250535c", size = 6493, upload-time = "2024-10-29T23:07:28.918Z" }598+wheels = [599+ { url = "https://files.pythonhosted.org/packages/f1/70/1b65f9118ef64f6ffe5d57a67170bbff25d4f4a3d1cb78e8ed3392e16114/pre_commit_uv-4.1.4-py3-none-any.whl", hash = "sha256:7f01fb494fa1caa5097d20a38f71df7cea0209197b2564699cef9b3f3aa9d135", size = 5578, upload-time = "2024-10-29T23:07:27.128Z" },600+]601+602+[[package]]603+name = "pygments"604+version = "2.19.1"605+source = { registry = "https://pypi.org/simple" }606+sdist = { url = "https://files.pythonhosted.org/packages/7c/2d/c3338d48ea6cc0feb8446d8e6937e1408088a72a39937982cc6111d17f84/pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", size = 4968581, upload-time = "2025-01-06T17:26:30.443Z" }607+wheels = [608+ { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293, upload-time = "2025-01-06T17:26:25.553Z" },609+]610+611+[[package]]612+name = "pyproject-api"613+version = "1.9.1"614+source = { registry = "https://pypi.org/simple" }615+dependencies = [616+ { name = "packaging" },617+ { name = "tomli", marker = "python_full_version < '3.11'" },618+]619+sdist = { url = "https://files.pythonhosted.org/packages/19/fd/437901c891f58a7b9096511750247535e891d2d5a5a6eefbc9386a2b41d5/pyproject_api-1.9.1.tar.gz", hash = "sha256:43c9918f49daab37e302038fc1aed54a8c7a91a9fa935d00b9a485f37e0f5335", size = 22710, upload-time = "2025-05-12T14:41:58.025Z" }620+wheels = [621+ { url = "https://files.pythonhosted.org/packages/ef/e6/c293c06695d4a3ab0260ef124a74ebadba5f4c511ce3a4259e976902c00b/pyproject_api-1.9.1-py3-none-any.whl", hash = "sha256:7d6238d92f8962773dd75b5f0c4a6a27cce092a14b623b811dba656f3b628948", size = 13158, upload-time = "2025-05-12T14:41:56.217Z" },622+]623+624+[[package]]625+name = "pyright"626+version = "1.1.401"627+source = { registry = "https://pypi.org/simple" }628+dependencies = [629+ { name = "nodeenv" },630+ { name = "typing-extensions" },631+]632+sdist = { url = "https://files.pythonhosted.org/packages/79/9a/7ab2b333b921b2d6bfcffe05a0e0a0bbeff884bd6fb5ed50cd68e2898e53/pyright-1.1.401.tar.gz", hash = "sha256:788a82b6611fa5e34a326a921d86d898768cddf59edde8e93e56087d277cc6f1", size = 3894193, upload-time = "2025-05-21T10:44:52.03Z" }633+wheels = [634+ { url = "https://files.pythonhosted.org/packages/0d/e6/1f908fce68b0401d41580e0f9acc4c3d1b248adcff00dfaad75cd21a1370/pyright-1.1.401-py3-none-any.whl", hash = "sha256:6fde30492ba5b0d7667c16ecaf6c699fab8d7a1263f6a18549e0b00bf7724c06", size = 5629193, upload-time = "2025-05-21T10:44:50.129Z" },635+]636+637+[[package]]638+name = "pytest"639+version = "8.4.0"640+source = { registry = "https://pypi.org/simple" }641+dependencies = [642+ { name = "colorama", marker = "sys_platform == 'win32'" },643+ { name = "exceptiongroup", marker = "python_full_version < '3.11'" },644+ { name = "iniconfig" },645+ { name = "packaging" },646+ { name = "pluggy" },647+ { name = "pygments" },648+ { name = "tomli", marker = "python_full_version < '3.11'" },649+]650+sdist = { url = "https://files.pythonhosted.org/packages/fb/aa/405082ce2749be5398045152251ac69c0f3578c7077efc53431303af97ce/pytest-8.4.0.tar.gz", hash = "sha256:14d920b48472ea0dbf68e45b96cd1ffda4705f33307dcc86c676c1b5104838a6", size = 1515232, upload-time = "2025-06-02T17:36:30.03Z" }651+wheels = [652+ { url = "https://files.pythonhosted.org/packages/2f/de/afa024cbe022b1b318a3d224125aa24939e99b4ff6f22e0ba639a2eaee47/pytest-8.4.0-py3-none-any.whl", hash = "sha256:f40f825768ad76c0977cbacdf1fd37c6f7a468e460ea6a0636078f8972d4517e", size = 363797, upload-time = "2025-06-02T17:36:27.859Z" },653+]654+655+[[package]]656+name = "pyyaml"657+version = "6.0.2"658+source = { registry = "https://pypi.org/simple" }659+sdist = { url = "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e", size = 130631, upload-time = "2024-08-06T20:33:50.674Z" }660+wheels = [661+ { url = "https://files.pythonhosted.org/packages/9b/95/a3fac87cb7158e231b5a6012e438c647e1a87f09f8e0d123acec8ab8bf71/PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086", size = 184199, upload-time = "2024-08-06T20:31:40.178Z" },662+ { url = "https://files.pythonhosted.org/packages/c7/7a/68bd47624dab8fd4afbfd3c48e3b79efe09098ae941de5b58abcbadff5cb/PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf", size = 171758, upload-time = "2024-08-06T20:31:42.173Z" },663+ { url = "https://files.pythonhosted.org/packages/49/ee/14c54df452143b9ee9f0f29074d7ca5516a36edb0b4cc40c3f280131656f/PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237", size = 718463, upload-time = "2024-08-06T20:31:44.263Z" },664+ { url = "https://files.pythonhosted.org/packages/4d/61/de363a97476e766574650d742205be468921a7b532aa2499fcd886b62530/PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b", size = 719280, upload-time = "2024-08-06T20:31:50.199Z" },665+ { url = "https://files.pythonhosted.org/packages/6b/4e/1523cb902fd98355e2e9ea5e5eb237cbc5f3ad5f3075fa65087aa0ecb669/PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed", size = 751239, upload-time = "2024-08-06T20:31:52.292Z" },666+ { url = "https://files.pythonhosted.org/packages/b7/33/5504b3a9a4464893c32f118a9cc045190a91637b119a9c881da1cf6b7a72/PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180", size = 695802, upload-time = "2024-08-06T20:31:53.836Z" },667+ { url = "https://files.pythonhosted.org/packages/5c/20/8347dcabd41ef3a3cdc4f7b7a2aff3d06598c8779faa189cdbf878b626a4/PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68", size = 720527, upload-time = "2024-08-06T20:31:55.565Z" },668+ { url = "https://files.pythonhosted.org/packages/be/aa/5afe99233fb360d0ff37377145a949ae258aaab831bde4792b32650a4378/PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99", size = 144052, upload-time = "2024-08-06T20:31:56.914Z" },669+ { url = "https://files.pythonhosted.org/packages/b5/84/0fa4b06f6d6c958d207620fc60005e241ecedceee58931bb20138e1e5776/PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e", size = 161774, upload-time = "2024-08-06T20:31:58.304Z" },670+ { url = "https://files.pythonhosted.org/packages/f8/aa/7af4e81f7acba21a4c6be026da38fd2b872ca46226673c89a758ebdc4fd2/PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774", size = 184612, upload-time = "2024-08-06T20:32:03.408Z" },671+ { url = "https://files.pythonhosted.org/packages/8b/62/b9faa998fd185f65c1371643678e4d58254add437edb764a08c5a98fb986/PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee", size = 172040, upload-time = "2024-08-06T20:32:04.926Z" },672+ { url = "https://files.pythonhosted.org/packages/ad/0c/c804f5f922a9a6563bab712d8dcc70251e8af811fce4524d57c2c0fd49a4/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c", size = 736829, upload-time = "2024-08-06T20:32:06.459Z" },673+ { url = "https://files.pythonhosted.org/packages/51/16/6af8d6a6b210c8e54f1406a6b9481febf9c64a3109c541567e35a49aa2e7/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317", size = 764167, upload-time = "2024-08-06T20:32:08.338Z" },674+ { url = "https://files.pythonhosted.org/packages/75/e4/2c27590dfc9992f73aabbeb9241ae20220bd9452df27483b6e56d3975cc5/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85", size = 762952, upload-time = "2024-08-06T20:32:14.124Z" },675+ { url = "https://files.pythonhosted.org/packages/9b/97/ecc1abf4a823f5ac61941a9c00fe501b02ac3ab0e373c3857f7d4b83e2b6/PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4", size = 735301, upload-time = "2024-08-06T20:32:16.17Z" },676+ { url = "https://files.pythonhosted.org/packages/45/73/0f49dacd6e82c9430e46f4a027baa4ca205e8b0a9dce1397f44edc23559d/PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e", size = 756638, upload-time = "2024-08-06T20:32:18.555Z" },677+ { url = "https://files.pythonhosted.org/packages/22/5f/956f0f9fc65223a58fbc14459bf34b4cc48dec52e00535c79b8db361aabd/PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5", size = 143850, upload-time = "2024-08-06T20:32:19.889Z" },678+ { url = "https://files.pythonhosted.org/packages/ed/23/8da0bbe2ab9dcdd11f4f4557ccaf95c10b9811b13ecced089d43ce59c3c8/PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44", size = 161980, upload-time = "2024-08-06T20:32:21.273Z" },679+ { url = "https://files.pythonhosted.org/packages/86/0c/c581167fc46d6d6d7ddcfb8c843a4de25bdd27e4466938109ca68492292c/PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab", size = 183873, upload-time = "2024-08-06T20:32:25.131Z" },680+ { url = "https://files.pythonhosted.org/packages/a8/0c/38374f5bb272c051e2a69281d71cba6fdb983413e6758b84482905e29a5d/PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725", size = 173302, upload-time = "2024-08-06T20:32:26.511Z" },681+ { url = "https://files.pythonhosted.org/packages/c3/93/9916574aa8c00aa06bbac729972eb1071d002b8e158bd0e83a3b9a20a1f7/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5", size = 739154, upload-time = "2024-08-06T20:32:28.363Z" },682+ { url = "https://files.pythonhosted.org/packages/95/0f/b8938f1cbd09739c6da569d172531567dbcc9789e0029aa070856f123984/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425", size = 766223, upload-time = "2024-08-06T20:32:30.058Z" },683+ { url = "https://files.pythonhosted.org/packages/b9/2b/614b4752f2e127db5cc206abc23a8c19678e92b23c3db30fc86ab731d3bd/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476", size = 767542, upload-time = "2024-08-06T20:32:31.881Z" },684+ { url = "https://files.pythonhosted.org/packages/d4/00/dd137d5bcc7efea1836d6264f049359861cf548469d18da90cd8216cf05f/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48", size = 731164, upload-time = "2024-08-06T20:32:37.083Z" },685+ { url = "https://files.pythonhosted.org/packages/c9/1f/4f998c900485e5c0ef43838363ba4a9723ac0ad73a9dc42068b12aaba4e4/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b", size = 756611, upload-time = "2024-08-06T20:32:38.898Z" },686+ { url = "https://files.pythonhosted.org/packages/df/d1/f5a275fdb252768b7a11ec63585bc38d0e87c9e05668a139fea92b80634c/PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4", size = 140591, upload-time = "2024-08-06T20:32:40.241Z" },687+ { url = "https://files.pythonhosted.org/packages/0c/e8/4f648c598b17c3d06e8753d7d13d57542b30d56e6c2dedf9c331ae56312e/PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8", size = 156338, upload-time = "2024-08-06T20:32:41.93Z" },688+ { url = "https://files.pythonhosted.org/packages/ef/e3/3af305b830494fa85d95f6d95ef7fa73f2ee1cc8ef5b495c7c3269fb835f/PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba", size = 181309, upload-time = "2024-08-06T20:32:43.4Z" },689+ { url = "https://files.pythonhosted.org/packages/45/9f/3b1c20a0b7a3200524eb0076cc027a970d320bd3a6592873c85c92a08731/PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1", size = 171679, upload-time = "2024-08-06T20:32:44.801Z" },690+ { url = "https://files.pythonhosted.org/packages/7c/9a/337322f27005c33bcb656c655fa78325b730324c78620e8328ae28b64d0c/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133", size = 733428, upload-time = "2024-08-06T20:32:46.432Z" },691+ { url = "https://files.pythonhosted.org/packages/a3/69/864fbe19e6c18ea3cc196cbe5d392175b4cf3d5d0ac1403ec3f2d237ebb5/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484", size = 763361, upload-time = "2024-08-06T20:32:51.188Z" },692+ { url = "https://files.pythonhosted.org/packages/04/24/b7721e4845c2f162d26f50521b825fb061bc0a5afcf9a386840f23ea19fa/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5", size = 759523, upload-time = "2024-08-06T20:32:53.019Z" },693+ { url = "https://files.pythonhosted.org/packages/2b/b2/e3234f59ba06559c6ff63c4e10baea10e5e7df868092bf9ab40e5b9c56b6/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc", size = 726660, upload-time = "2024-08-06T20:32:54.708Z" },694+ { url = "https://files.pythonhosted.org/packages/fe/0f/25911a9f080464c59fab9027482f822b86bf0608957a5fcc6eaac85aa515/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", size = 751597, upload-time = "2024-08-06T20:32:56.985Z" },695+ { url = "https://files.pythonhosted.org/packages/14/0d/e2c3b43bbce3cf6bd97c840b46088a3031085179e596d4929729d8d68270/PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", size = 140527, upload-time = "2024-08-06T20:33:03.001Z" },696+ { url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446, upload-time = "2024-08-06T20:33:04.33Z" },697+]698+699+[[package]]700+name = "requests"701+version = "2.32.3"702+source = { registry = "https://pypi.org/simple" }703+dependencies = [704+ { name = "certifi" },705+ { name = "charset-normalizer" },706+ { name = "idna" },707+ { name = "urllib3" },708+]709+sdist = { url = "https://files.pythonhosted.org/packages/63/70/2bf7780ad2d390a8d301ad0b550f1581eadbd9a20f896afe06353c2a2913/requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", size = 131218, upload-time = "2024-05-29T15:37:49.536Z" }710+wheels = [711+ { url = "https://files.pythonhosted.org/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6", size = 64928, upload-time = "2024-05-29T15:37:47.027Z" },712+]713+714+[[package]]715+name = "roman-numerals-py"716+version = "3.1.0"717+source = { registry = "https://pypi.org/simple" }718+sdist = { url = "https://files.pythonhosted.org/packages/30/76/48fd56d17c5bdbdf65609abbc67288728a98ed4c02919428d4f52d23b24b/roman_numerals_py-3.1.0.tar.gz", hash = "sha256:be4bf804f083a4ce001b5eb7e3c0862479d10f94c936f6c4e5f250aa5ff5bd2d", size = 9017, upload-time = "2025-02-22T07:34:54.333Z" }719+wheels = [720+ { url = "https://files.pythonhosted.org/packages/53/97/d2cbbaa10c9b826af0e10fdf836e1bf344d9f0abb873ebc34d1f49642d3f/roman_numerals_py-3.1.0-py3-none-any.whl", hash = "sha256:9da2ad2fb670bcf24e81070ceb3be72f6c11c440d73bd579fbeca1e9f330954c", size = 7742, upload-time = "2025-02-22T07:34:52.422Z" },721+]722+723+[[package]]724+name = "ruff"725+version = "0.11.13"726+source = { registry = "https://pypi.org/simple" }727+sdist = { url = "https://files.pythonhosted.org/packages/ed/da/9c6f995903b4d9474b39da91d2d626659af3ff1eeb43e9ae7c119349dba6/ruff-0.11.13.tar.gz", hash = "sha256:26fa247dc68d1d4e72c179e08889a25ac0c7ba4d78aecfc835d49cbfd60bf514", size = 4282054, upload-time = "2025-06-05T21:00:15.721Z" }728+wheels = [729+ { url = "https://files.pythonhosted.org/packages/7d/ce/a11d381192966e0b4290842cc8d4fac7dc9214ddf627c11c1afff87da29b/ruff-0.11.13-py3-none-linux_armv6l.whl", hash = "sha256:4bdfbf1240533f40042ec00c9e09a3aade6f8c10b6414cf11b519488d2635d46", size = 10292516, upload-time = "2025-06-05T20:59:32.944Z" },730+ { url = "https://files.pythonhosted.org/packages/78/db/87c3b59b0d4e753e40b6a3b4a2642dfd1dcaefbff121ddc64d6c8b47ba00/ruff-0.11.13-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:aef9c9ed1b5ca28bb15c7eac83b8670cf3b20b478195bd49c8d756ba0a36cf48", size = 11106083, upload-time = "2025-06-05T20:59:37.03Z" },731+ { url = "https://files.pythonhosted.org/packages/77/79/d8cec175856ff810a19825d09ce700265f905c643c69f45d2b737e4a470a/ruff-0.11.13-py3-none-macosx_11_0_arm64.whl", hash = "sha256:53b15a9dfdce029c842e9a5aebc3855e9ab7771395979ff85b7c1dedb53ddc2b", size = 10436024, upload-time = "2025-06-05T20:59:39.741Z" },732+ { url = "https://files.pythonhosted.org/packages/8b/5b/f6d94f2980fa1ee854b41568368a2e1252681b9238ab2895e133d303538f/ruff-0.11.13-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ab153241400789138d13f362c43f7edecc0edfffce2afa6a68434000ecd8f69a", size = 10646324, upload-time = "2025-06-05T20:59:42.185Z" },733+ { url = "https://files.pythonhosted.org/packages/6c/9c/b4c2acf24ea4426016d511dfdc787f4ce1ceb835f3c5fbdbcb32b1c63bda/ruff-0.11.13-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6c51f93029d54a910d3d24f7dd0bb909e31b6cd989a5e4ac513f4eb41629f0dc", size = 10174416, upload-time = "2025-06-05T20:59:44.319Z" },734+ { url = "https://files.pythonhosted.org/packages/f3/10/e2e62f77c65ede8cd032c2ca39c41f48feabedb6e282bfd6073d81bb671d/ruff-0.11.13-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1808b3ed53e1a777c2ef733aca9051dc9bf7c99b26ece15cb59a0320fbdbd629", size = 11724197, upload-time = "2025-06-05T20:59:46.935Z" },735+ { url = "https://files.pythonhosted.org/packages/bb/f0/466fe8469b85c561e081d798c45f8a1d21e0b4a5ef795a1d7f1a9a9ec182/ruff-0.11.13-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d28ce58b5ecf0f43c1b71edffabe6ed7f245d5336b17805803312ec9bc665933", size = 12511615, upload-time = "2025-06-05T20:59:49.534Z" },736+ { url = "https://files.pythonhosted.org/packages/17/0e/cefe778b46dbd0cbcb03a839946c8f80a06f7968eb298aa4d1a4293f3448/ruff-0.11.13-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:55e4bc3a77842da33c16d55b32c6cac1ec5fb0fbec9c8c513bdce76c4f922165", size = 12117080, upload-time = "2025-06-05T20:59:51.654Z" },737+ { url = "https://files.pythonhosted.org/packages/5d/2c/caaeda564cbe103bed145ea557cb86795b18651b0f6b3ff6a10e84e5a33f/ruff-0.11.13-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:633bf2c6f35678c56ec73189ba6fa19ff1c5e4807a78bf60ef487b9dd272cc71", size = 11326315, upload-time = "2025-06-05T20:59:54.469Z" },738+ { url = "https://files.pythonhosted.org/packages/75/f0/782e7d681d660eda8c536962920c41309e6dd4ebcea9a2714ed5127d44bd/ruff-0.11.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ffbc82d70424b275b089166310448051afdc6e914fdab90e08df66c43bb5ca9", size = 11555640, upload-time = "2025-06-05T20:59:56.986Z" },739+ { url = "https://files.pythonhosted.org/packages/5d/d4/3d580c616316c7f07fb3c99dbecfe01fbaea7b6fd9a82b801e72e5de742a/ruff-0.11.13-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4a9ddd3ec62a9a89578c85842b836e4ac832d4a2e0bfaad3b02243f930ceafcc", size = 10507364, upload-time = "2025-06-05T20:59:59.154Z" },740+ { url = "https://files.pythonhosted.org/packages/5a/dc/195e6f17d7b3ea6b12dc4f3e9de575db7983db187c378d44606e5d503319/ruff-0.11.13-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d237a496e0778d719efb05058c64d28b757c77824e04ffe8796c7436e26712b7", size = 10141462, upload-time = "2025-06-05T21:00:01.481Z" },741+ { url = "https://files.pythonhosted.org/packages/f4/8e/39a094af6967faa57ecdeacb91bedfb232474ff8c3d20f16a5514e6b3534/ruff-0.11.13-py3-none-musllinux_1_2_i686.whl", hash = "sha256:26816a218ca6ef02142343fd24c70f7cd8c5aa6c203bca284407adf675984432", size = 11121028, upload-time = "2025-06-05T21:00:04.06Z" },742+ { url = "https://files.pythonhosted.org/packages/5a/c0/b0b508193b0e8a1654ec683ebab18d309861f8bd64e3a2f9648b80d392cb/ruff-0.11.13-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:51c3f95abd9331dc5b87c47ac7f376db5616041173826dfd556cfe3d4977f492", size = 11602992, upload-time = "2025-06-05T21:00:06.249Z" },743+ { url = "https://files.pythonhosted.org/packages/7c/91/263e33ab93ab09ca06ce4f8f8547a858cc198072f873ebc9be7466790bae/ruff-0.11.13-py3-none-win32.whl", hash = "sha256:96c27935418e4e8e77a26bb05962817f28b8ef3843a6c6cc49d8783b5507f250", size = 10474944, upload-time = "2025-06-05T21:00:08.459Z" },744+ { url = "https://files.pythonhosted.org/packages/46/f4/7c27734ac2073aae8efb0119cae6931b6fb48017adf048fdf85c19337afc/ruff-0.11.13-py3-none-win_amd64.whl", hash = "sha256:29c3189895a8a6a657b7af4e97d330c8a3afd2c9c8f46c81e2fc5a31866517e3", size = 11548669, upload-time = "2025-06-05T21:00:11.147Z" },745+ { url = "https://files.pythonhosted.org/packages/ec/bf/b273dd11673fed8a6bd46032c0ea2a04b2ac9bfa9c628756a5856ba113b0/ruff-0.11.13-py3-none-win_arm64.whl", hash = "sha256:b4385285e9179d608ff1d2fb9922062663c658605819a6876d8beef0c30b7f3b", size = 10683928, upload-time = "2025-06-05T21:00:13.758Z" },746+]747+748+[[package]]749+name = "sniffio"750+version = "1.3.1"751+source = { registry = "https://pypi.org/simple" }752+sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372, upload-time = "2024-02-25T23:20:04.057Z" }753+wheels = [754+ { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" },755+]756+757+[[package]]758+name = "snowballstemmer"759+version = "3.0.1"760+source = { registry = "https://pypi.org/simple" }761+sdist = { url = "https://files.pythonhosted.org/packages/75/a7/9810d872919697c9d01295633f5d574fb416d47e535f258272ca1f01f447/snowballstemmer-3.0.1.tar.gz", hash = "sha256:6d5eeeec8e9f84d4d56b847692bacf79bc2c8e90c7f80ca4444ff8b6f2e52895", size = 105575, upload-time = "2025-05-09T16:34:51.843Z" }762+wheels = [763+ { url = "https://files.pythonhosted.org/packages/c8/78/3565d011c61f5a43488987ee32b6f3f656e7f107ac2782dd57bdd7d91d9a/snowballstemmer-3.0.1-py3-none-any.whl", hash = "sha256:6cd7b3897da8d6c9ffb968a6781fa6532dce9c3618a4b127d920dab764a19064", size = 103274, upload-time = "2025-05-09T16:34:50.371Z" },764+]765+766+[[package]]767+name = "sphinx"768+version = "8.1.3"769+source = { registry = "https://pypi.org/simple" }770+resolution-markers = [771+ "python_full_version < '3.11'",772+]773+dependencies = [774+ { name = "alabaster", marker = "python_full_version < '3.11'" },775+ { name = "babel", marker = "python_full_version < '3.11'" },776+ { name = "colorama", marker = "python_full_version < '3.11' and sys_platform == 'win32'" },777+ { name = "docutils", marker = "python_full_version < '3.11'" },778+ { name = "imagesize", marker = "python_full_version < '3.11'" },779+ { name = "jinja2", marker = "python_full_version < '3.11'" },780+ { name = "packaging", marker = "python_full_version < '3.11'" },781+ { name = "pygments", marker = "python_full_version < '3.11'" },782+ { name = "requests", marker = "python_full_version < '3.11'" },783+ { name = "snowballstemmer", marker = "python_full_version < '3.11'" },784+ { name = "sphinxcontrib-applehelp", marker = "python_full_version < '3.11'" },785+ { name = "sphinxcontrib-devhelp", marker = "python_full_version < '3.11'" },786+ { name = "sphinxcontrib-htmlhelp", marker = "python_full_version < '3.11'" },787+ { name = "sphinxcontrib-jsmath", marker = "python_full_version < '3.11'" },788+ { name = "sphinxcontrib-qthelp", marker = "python_full_version < '3.11'" },789+ { name = "sphinxcontrib-serializinghtml", marker = "python_full_version < '3.11'" },790+ { name = "tomli", marker = "python_full_version < '3.11'" },791+]792+sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/be0b61178fe2cdcb67e2a92fc9ebb488e3c51c4f74a36a7824c0adf23425/sphinx-8.1.3.tar.gz", hash = "sha256:43c1911eecb0d3e161ad78611bc905d1ad0e523e4ddc202a58a821773dc4c927", size = 8184611, upload-time = "2024-10-13T20:27:13.93Z" }793+wheels = [794+ { url = "https://files.pythonhosted.org/packages/26/60/1ddff83a56d33aaf6f10ec8ce84b4c007d9368b21008876fceda7e7381ef/sphinx-8.1.3-py3-none-any.whl", hash = "sha256:09719015511837b76bf6e03e42eb7595ac8c2e41eeb9c29c5b755c6b677992a2", size = 3487125, upload-time = "2024-10-13T20:27:10.448Z" },795+]796+797+[[package]]798+name = "sphinx"799+version = "8.2.3"800+source = { registry = "https://pypi.org/simple" }801+resolution-markers = [802+ "python_full_version >= '3.12'",803+ "python_full_version == '3.11.*'",804+]805+dependencies = [806+ { name = "alabaster", marker = "python_full_version >= '3.11'" },807+ { name = "babel", marker = "python_full_version >= '3.11'" },808+ { name = "colorama", marker = "python_full_version >= '3.11' and sys_platform == 'win32'" },809+ { name = "docutils", marker = "python_full_version >= '3.11'" },810+ { name = "imagesize", marker = "python_full_version >= '3.11'" },811+ { name = "jinja2", marker = "python_full_version >= '3.11'" },812+ { name = "packaging", marker = "python_full_version >= '3.11'" },813+ { name = "pygments", marker = "python_full_version >= '3.11'" },814+ { name = "requests", marker = "python_full_version >= '3.11'" },815+ { name = "roman-numerals-py", marker = "python_full_version >= '3.11'" },816+ { name = "snowballstemmer", marker = "python_full_version >= '3.11'" },817+ { name = "sphinxcontrib-applehelp", marker = "python_full_version >= '3.11'" },818+ { name = "sphinxcontrib-devhelp", marker = "python_full_version >= '3.11'" },819+ { name = "sphinxcontrib-htmlhelp", marker = "python_full_version >= '3.11'" },820+ { name = "sphinxcontrib-jsmath", marker = "python_full_version >= '3.11'" },821+ { name = "sphinxcontrib-qthelp", marker = "python_full_version >= '3.11'" },822+ { name = "sphinxcontrib-serializinghtml", marker = "python_full_version >= '3.11'" },823+]824+sdist = { url = "https://files.pythonhosted.org/packages/38/ad/4360e50ed56cb483667b8e6dadf2d3fda62359593faabbe749a27c4eaca6/sphinx-8.2.3.tar.gz", hash = "sha256:398ad29dee7f63a75888314e9424d40f52ce5a6a87ae88e7071e80af296ec348", size = 8321876, upload-time = "2025-03-02T22:31:59.658Z" }825+wheels = [826+ { url = "https://files.pythonhosted.org/packages/31/53/136e9eca6e0b9dc0e1962e2c908fbea2e5ac000c2a2fbd9a35797958c48b/sphinx-8.2.3-py3-none-any.whl", hash = "sha256:4405915165f13521d875a8c29c8970800a0141c14cc5416a38feca4ea5d9b9c3", size = 3589741, upload-time = "2025-03-02T22:31:56.836Z" },827+]828+829+[[package]]830+name = "sphinx-autobuild"831+version = "2024.10.3"832+source = { registry = "https://pypi.org/simple" }833+dependencies = [834+ { name = "colorama" },835+ { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },836+ { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },837+ { name = "starlette" },838+ { name = "uvicorn" },839+ { name = "watchfiles" },840+ { name = "websockets" },841+]842+sdist = { url = "https://files.pythonhosted.org/packages/a5/2c/155e1de2c1ba96a72e5dba152c509a8b41e047ee5c2def9e9f0d812f8be7/sphinx_autobuild-2024.10.3.tar.gz", hash = "sha256:248150f8f333e825107b6d4b86113ab28fa51750e5f9ae63b59dc339be951fb1", size = 14023, upload-time = "2024-10-02T23:15:30.172Z" }843+wheels = [844+ { url = "https://files.pythonhosted.org/packages/18/c0/eba125db38c84d3c74717008fd3cb5000b68cd7e2cbafd1349c6a38c3d3b/sphinx_autobuild-2024.10.3-py3-none-any.whl", hash = "sha256:158e16c36f9d633e613c9aaf81c19b0fc458ca78b112533b20dafcda430d60fa", size = 11908, upload-time = "2024-10-02T23:15:28.739Z" },845+]846+847+[[package]]848+name = "sphinx-notfound-page"849+version = "1.1.0"850+source = { registry = "https://pypi.org/simple" }851+dependencies = [852+ { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },853+ { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },854+]855+sdist = { url = "https://files.pythonhosted.org/packages/6a/b2/67603444a8ee97b4a8ea71b0a9d6bab1727ed65e362c87e02f818ee57b8a/sphinx_notfound_page-1.1.0.tar.gz", hash = "sha256:913e1754370bb3db201d9300d458a8b8b5fb22e9246a816643a819a9ea2b8067", size = 7392, upload-time = "2025-01-28T18:45:02.871Z" }856+wheels = [857+ { url = "https://files.pythonhosted.org/packages/cd/d4/019fe439c840a7966012bbb95ccbdd81c5c10271749706793b43beb05145/sphinx_notfound_page-1.1.0-py3-none-any.whl", hash = "sha256:835dc76ff7914577a1f58d80a2c8418fb6138c0932c8da8adce4d9096fbcd389", size = 8167, upload-time = "2025-01-28T18:45:00.465Z" },858+]859+860+[[package]]861+name = "sphinx-tabs"862+version = "3.4.7"863+source = { registry = "https://pypi.org/simple" }864+dependencies = [865+ { name = "docutils" },866+ { name = "pygments" },867+ { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },868+ { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },869+]870+sdist = { url = "https://files.pythonhosted.org/packages/6a/53/a9a91995cb365e589f413b77fc75f1c0e9b4ac61bfa8da52a779ad855cc0/sphinx-tabs-3.4.7.tar.gz", hash = "sha256:991ad4a424ff54119799ba1491701aa8130dd43509474aef45a81c42d889784d", size = 15891, upload-time = "2024-10-08T13:37:27.887Z" }871+wheels = [872+ { url = "https://files.pythonhosted.org/packages/6b/c6/f47505b564b918a3ba60c1e99232d4942c4a7e44ecaae603e829e3d05dae/sphinx_tabs-3.4.7-py3-none-any.whl", hash = "sha256:c12d7a36fd413b369e9e9967a0a4015781b71a9c393575419834f19204bd1915", size = 9727, upload-time = "2024-10-08T13:37:26.192Z" },873+]874+875+[[package]]876+name = "sphinxcontrib-applehelp"877+version = "2.0.0"878+source = { registry = "https://pypi.org/simple" }879+sdist = { url = "https://files.pythonhosted.org/packages/ba/6e/b837e84a1a704953c62ef8776d45c3e8d759876b4a84fe14eba2859106fe/sphinxcontrib_applehelp-2.0.0.tar.gz", hash = "sha256:2f29ef331735ce958efa4734873f084941970894c6090408b079c61b2e1c06d1", size = 20053, upload-time = "2024-07-29T01:09:00.465Z" }880+wheels = [881+ { url = "https://files.pythonhosted.org/packages/5d/85/9ebeae2f76e9e77b952f4b274c27238156eae7979c5421fba91a28f4970d/sphinxcontrib_applehelp-2.0.0-py3-none-any.whl", hash = "sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5", size = 119300, upload-time = "2024-07-29T01:08:58.99Z" },882+]883+884+[[package]]885+name = "sphinxcontrib-devhelp"886+version = "2.0.0"887+source = { registry = "https://pypi.org/simple" }888+sdist = { url = "https://files.pythonhosted.org/packages/f6/d2/5beee64d3e4e747f316bae86b55943f51e82bb86ecd325883ef65741e7da/sphinxcontrib_devhelp-2.0.0.tar.gz", hash = "sha256:411f5d96d445d1d73bb5d52133377b4248ec79db5c793ce7dbe59e074b4dd1ad", size = 12967, upload-time = "2024-07-29T01:09:23.417Z" }889+wheels = [890+ { url = "https://files.pythonhosted.org/packages/35/7a/987e583882f985fe4d7323774889ec58049171828b58c2217e7f79cdf44e/sphinxcontrib_devhelp-2.0.0-py3-none-any.whl", hash = "sha256:aefb8b83854e4b0998877524d1029fd3e6879210422ee3780459e28a1f03a8a2", size = 82530, upload-time = "2024-07-29T01:09:21.945Z" },891+]892+893+[[package]]894+name = "sphinxcontrib-htmlhelp"895+version = "2.1.0"896+source = { registry = "https://pypi.org/simple" }897+sdist = { url = "https://files.pythonhosted.org/packages/43/93/983afd9aa001e5201eab16b5a444ed5b9b0a7a010541e0ddfbbfd0b2470c/sphinxcontrib_htmlhelp-2.1.0.tar.gz", hash = "sha256:c9e2916ace8aad64cc13a0d233ee22317f2b9025b9cf3295249fa985cc7082e9", size = 22617, upload-time = "2024-07-29T01:09:37.889Z" }898+wheels = [899+ { url = "https://files.pythonhosted.org/packages/0a/7b/18a8c0bcec9182c05a0b3ec2a776bba4ead82750a55ff798e8d406dae604/sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl", hash = "sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8", size = 98705, upload-time = "2024-07-29T01:09:36.407Z" },900+]901+902+[[package]]903+name = "sphinxcontrib-jsmath"904+version = "1.0.1"905+source = { registry = "https://pypi.org/simple" }906+sdist = { url = "https://files.pythonhosted.org/packages/b2/e8/9ed3830aeed71f17c026a07a5097edcf44b692850ef215b161b8ad875729/sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8", size = 5787, upload-time = "2019-01-21T16:10:16.347Z" }907+wheels = [908+ { url = "https://files.pythonhosted.org/packages/c2/42/4c8646762ee83602e3fb3fbe774c2fac12f317deb0b5dbeeedd2d3ba4b77/sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178", size = 5071, upload-time = "2019-01-21T16:10:14.333Z" },909+]910+911+[[package]]912+name = "sphinxcontrib-log-cabinet"913+version = "1.0.1"914+source = { registry = "https://pypi.org/simple" }915+dependencies = [916+ { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },917+ { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },918+]919+sdist = { url = "https://files.pythonhosted.org/packages/75/26/0687391e10c605a4d0c7ebe118c57c51ecc687128bcdae5803d9b96def81/sphinxcontrib-log-cabinet-1.0.1.tar.gz", hash = "sha256:103b2e62df4e57abb943bea05ee9c2beb7da922222c8b77314ffd6ab9901c558", size = 4072, upload-time = "2019-07-05T23:22:34.596Z" }920+wheels = [921+ { url = "https://files.pythonhosted.org/packages/27/e7/dbfc155c1b4c429a9a8149032a56bfb7bab4efabc656abb24ab4619c715d/sphinxcontrib_log_cabinet-1.0.1-py2.py3-none-any.whl", hash = "sha256:3decc888e8e453d1912cd95d50efb0794a4670a214efa65e71a7de277dcfe2cd", size = 4887, upload-time = "2019-07-05T23:22:32.969Z" },922+]923+924+[[package]]925+name = "sphinxcontrib-qthelp"926+version = "2.0.0"927+source = { registry = "https://pypi.org/simple" }928+sdist = { url = "https://files.pythonhosted.org/packages/68/bc/9104308fc285eb3e0b31b67688235db556cd5b0ef31d96f30e45f2e51cae/sphinxcontrib_qthelp-2.0.0.tar.gz", hash = "sha256:4fe7d0ac8fc171045be623aba3e2a8f613f8682731f9153bb2e40ece16b9bbab", size = 17165, upload-time = "2024-07-29T01:09:56.435Z" }929+wheels = [930+ { url = "https://files.pythonhosted.org/packages/27/83/859ecdd180cacc13b1f7e857abf8582a64552ea7a061057a6c716e790fce/sphinxcontrib_qthelp-2.0.0-py3-none-any.whl", hash = "sha256:b18a828cdba941ccd6ee8445dbe72ffa3ef8cbe7505d8cd1fa0d42d3f2d5f3eb", size = 88743, upload-time = "2024-07-29T01:09:54.885Z" },931+]932+933+[[package]]934+name = "sphinxcontrib-serializinghtml"935+version = "2.0.0"936+source = { registry = "https://pypi.org/simple" }937+sdist = { url = "https://files.pythonhosted.org/packages/3b/44/6716b257b0aa6bfd51a1b31665d1c205fb12cb5ad56de752dfa15657de2f/sphinxcontrib_serializinghtml-2.0.0.tar.gz", hash = "sha256:e9d912827f872c029017a53f0ef2180b327c3f7fd23c87229f7a8e8b70031d4d", size = 16080, upload-time = "2024-07-29T01:10:09.332Z" }938+wheels = [939+ { url = "https://files.pythonhosted.org/packages/52/a7/d2782e4e3f77c8450f727ba74a8f12756d5ba823d81b941f1b04da9d033a/sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl", hash = "sha256:6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331", size = 92072, upload-time = "2024-07-29T01:10:08.203Z" },940+]941+942+[[package]]943+name = "starlette"944+version = "0.47.0"945+source = { registry = "https://pypi.org/simple" }946+dependencies = [947+ { name = "anyio" },948+]949+sdist = { url = "https://files.pythonhosted.org/packages/8b/d0/0332bd8a25779a0e2082b0e179805ad39afad642938b371ae0882e7f880d/starlette-0.47.0.tar.gz", hash = "sha256:1f64887e94a447fed5f23309fb6890ef23349b7e478faa7b24a851cd4eb844af", size = 2582856, upload-time = "2025-05-29T15:45:27.628Z" }950+wheels = [951+ { url = "https://files.pythonhosted.org/packages/e3/81/c60b35fe9674f63b38a8feafc414fca0da378a9dbd5fa1e0b8d23fcc7a9b/starlette-0.47.0-py3-none-any.whl", hash = "sha256:9d052d4933683af40ffd47c7465433570b4949dc937e20ad1d73b34e72f10c37", size = 72796, upload-time = "2025-05-29T15:45:26.305Z" },952+]953+954+[[package]]955+name = "tomli"956+version = "2.2.1"957+source = { registry = "https://pypi.org/simple" }958+sdist = { url = "https://files.pythonhosted.org/packages/18/87/302344fed471e44a87289cf4967697d07e532f2421fdaf868a303cbae4ff/tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff", size = 17175, upload-time = "2024-11-27T22:38:36.873Z" }959+wheels = [960+ { url = "https://files.pythonhosted.org/packages/43/ca/75707e6efa2b37c77dadb324ae7d9571cb424e61ea73fad7c56c2d14527f/tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249", size = 131077, upload-time = "2024-11-27T22:37:54.956Z" },961+ { url = "https://files.pythonhosted.org/packages/c7/16/51ae563a8615d472fdbffc43a3f3d46588c264ac4f024f63f01283becfbb/tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6", size = 123429, upload-time = "2024-11-27T22:37:56.698Z" },962+ { url = "https://files.pythonhosted.org/packages/f1/dd/4f6cd1e7b160041db83c694abc78e100473c15d54620083dbd5aae7b990e/tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a", size = 226067, upload-time = "2024-11-27T22:37:57.63Z" },963+ { url = "https://files.pythonhosted.org/packages/a9/6b/c54ede5dc70d648cc6361eaf429304b02f2871a345bbdd51e993d6cdf550/tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee", size = 236030, upload-time = "2024-11-27T22:37:59.344Z" },964+ { url = "https://files.pythonhosted.org/packages/1f/47/999514fa49cfaf7a92c805a86c3c43f4215621855d151b61c602abb38091/tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e", size = 240898, upload-time = "2024-11-27T22:38:00.429Z" },965+ { url = "https://files.pythonhosted.org/packages/73/41/0a01279a7ae09ee1573b423318e7934674ce06eb33f50936655071d81a24/tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4", size = 229894, upload-time = "2024-11-27T22:38:02.094Z" },966+ { url = "https://files.pythonhosted.org/packages/55/18/5d8bc5b0a0362311ce4d18830a5d28943667599a60d20118074ea1b01bb7/tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106", size = 245319, upload-time = "2024-11-27T22:38:03.206Z" },967+ { url = "https://files.pythonhosted.org/packages/92/a3/7ade0576d17f3cdf5ff44d61390d4b3febb8a9fc2b480c75c47ea048c646/tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8", size = 238273, upload-time = "2024-11-27T22:38:04.217Z" },968+ { url = "https://files.pythonhosted.org/packages/72/6f/fa64ef058ac1446a1e51110c375339b3ec6be245af9d14c87c4a6412dd32/tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff", size = 98310, upload-time = "2024-11-27T22:38:05.908Z" },969+ { url = "https://files.pythonhosted.org/packages/6a/1c/4a2dcde4a51b81be3530565e92eda625d94dafb46dbeb15069df4caffc34/tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b", size = 108309, upload-time = "2024-11-27T22:38:06.812Z" },970+ { url = "https://files.pythonhosted.org/packages/52/e1/f8af4c2fcde17500422858155aeb0d7e93477a0d59a98e56cbfe75070fd0/tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea", size = 132762, upload-time = "2024-11-27T22:38:07.731Z" },971+ { url = "https://files.pythonhosted.org/packages/03/b8/152c68bb84fc00396b83e7bbddd5ec0bd3dd409db4195e2a9b3e398ad2e3/tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8", size = 123453, upload-time = "2024-11-27T22:38:09.384Z" },972+ { url = "https://files.pythonhosted.org/packages/c8/d6/fc9267af9166f79ac528ff7e8c55c8181ded34eb4b0e93daa767b8841573/tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192", size = 233486, upload-time = "2024-11-27T22:38:10.329Z" },973+ { url = "https://files.pythonhosted.org/packages/5c/51/51c3f2884d7bab89af25f678447ea7d297b53b5a3b5730a7cb2ef6069f07/tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222", size = 242349, upload-time = "2024-11-27T22:38:11.443Z" },974+ { url = "https://files.pythonhosted.org/packages/ab/df/bfa89627d13a5cc22402e441e8a931ef2108403db390ff3345c05253935e/tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77", size = 252159, upload-time = "2024-11-27T22:38:13.099Z" },975+ { url = "https://files.pythonhosted.org/packages/9e/6e/fa2b916dced65763a5168c6ccb91066f7639bdc88b48adda990db10c8c0b/tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6", size = 237243, upload-time = "2024-11-27T22:38:14.766Z" },976+ { url = "https://files.pythonhosted.org/packages/b4/04/885d3b1f650e1153cbb93a6a9782c58a972b94ea4483ae4ac5cedd5e4a09/tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd", size = 259645, upload-time = "2024-11-27T22:38:15.843Z" },977+ { url = "https://files.pythonhosted.org/packages/9c/de/6b432d66e986e501586da298e28ebeefd3edc2c780f3ad73d22566034239/tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e", size = 244584, upload-time = "2024-11-27T22:38:17.645Z" },978+ { url = "https://files.pythonhosted.org/packages/1c/9a/47c0449b98e6e7d1be6cbac02f93dd79003234ddc4aaab6ba07a9a7482e2/tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98", size = 98875, upload-time = "2024-11-27T22:38:19.159Z" },979+ { url = "https://files.pythonhosted.org/packages/ef/60/9b9638f081c6f1261e2688bd487625cd1e660d0a85bd469e91d8db969734/tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4", size = 109418, upload-time = "2024-11-27T22:38:20.064Z" },980+ { url = "https://files.pythonhosted.org/packages/04/90/2ee5f2e0362cb8a0b6499dc44f4d7d48f8fff06d28ba46e6f1eaa61a1388/tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7", size = 132708, upload-time = "2024-11-27T22:38:21.659Z" },981+ { url = "https://files.pythonhosted.org/packages/c0/ec/46b4108816de6b385141f082ba99e315501ccd0a2ea23db4a100dd3990ea/tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c", size = 123582, upload-time = "2024-11-27T22:38:22.693Z" },982+ { url = "https://files.pythonhosted.org/packages/a0/bd/b470466d0137b37b68d24556c38a0cc819e8febe392d5b199dcd7f578365/tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13", size = 232543, upload-time = "2024-11-27T22:38:24.367Z" },983+ { url = "https://files.pythonhosted.org/packages/d9/e5/82e80ff3b751373f7cead2815bcbe2d51c895b3c990686741a8e56ec42ab/tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281", size = 241691, upload-time = "2024-11-27T22:38:26.081Z" },984+ { url = "https://files.pythonhosted.org/packages/05/7e/2a110bc2713557d6a1bfb06af23dd01e7dde52b6ee7dadc589868f9abfac/tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272", size = 251170, upload-time = "2024-11-27T22:38:27.921Z" },985+ { url = "https://files.pythonhosted.org/packages/64/7b/22d713946efe00e0adbcdfd6d1aa119ae03fd0b60ebed51ebb3fa9f5a2e5/tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140", size = 236530, upload-time = "2024-11-27T22:38:29.591Z" },986+ { url = "https://files.pythonhosted.org/packages/38/31/3a76f67da4b0cf37b742ca76beaf819dca0ebef26d78fc794a576e08accf/tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2", size = 258666, upload-time = "2024-11-27T22:38:30.639Z" },987+ { url = "https://files.pythonhosted.org/packages/07/10/5af1293da642aded87e8a988753945d0cf7e00a9452d3911dd3bb354c9e2/tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744", size = 243954, upload-time = "2024-11-27T22:38:31.702Z" },988+ { url = "https://files.pythonhosted.org/packages/5b/b9/1ed31d167be802da0fc95020d04cd27b7d7065cc6fbefdd2f9186f60d7bd/tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec", size = 98724, upload-time = "2024-11-27T22:38:32.837Z" },989+ { url = "https://files.pythonhosted.org/packages/c7/32/b0963458706accd9afcfeb867c0f9175a741bf7b19cd424230714d722198/tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69", size = 109383, upload-time = "2024-11-27T22:38:34.455Z" },990+ { url = "https://files.pythonhosted.org/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", size = 14257, upload-time = "2024-11-27T22:38:35.385Z" },991+]992+993+[[package]]994+name = "tox"995+version = "4.26.0"996+source = { registry = "https://pypi.org/simple" }997+dependencies = [998+ { name = "cachetools" },999+ { name = "chardet" },1000+ { name = "colorama" },1001+ { name = "filelock" },1002+ { name = "packaging" },1003+ { name = "platformdirs" },1004+ { name = "pluggy" },1005+ { name = "pyproject-api" },1006+ { name = "tomli", marker = "python_full_version < '3.11'" },1007+ { name = "typing-extensions", marker = "python_full_version < '3.11'" },1008+ { name = "virtualenv" },1009+]1010+sdist = { url = "https://files.pythonhosted.org/packages/fd/3c/dcec0c00321a107f7f697fd00754c5112572ea6dcacb40b16d8c3eea7c37/tox-4.26.0.tar.gz", hash = "sha256:a83b3b67b0159fa58e44e646505079e35a43317a62d2ae94725e0586266faeca", size = 197260, upload-time = "2025-05-13T15:04:28.481Z" }1011+wheels = [1012+ { url = "https://files.pythonhosted.org/packages/de/14/f58b4087cf248b18c795b5c838c7a8d1428dfb07cb468dad3ec7f54041ab/tox-4.26.0-py3-none-any.whl", hash = "sha256:75f17aaf09face9b97bd41645028d9f722301e912be8b4c65a3f938024560224", size = 172761, upload-time = "2025-05-13T15:04:26.207Z" },1013+]1014+1015+[[package]]1016+name = "tox-uv"1017+version = "1.26.0"1018+source = { registry = "https://pypi.org/simple" }1019+dependencies = [1020+ { name = "packaging" },1021+ { name = "tox" },1022+ { name = "uv" },1023+]1024+sdist = { url = "https://files.pythonhosted.org/packages/7e/da/37790b4a176f05b0ec7a699f54979078fc726f743640aa5c10c551c27edb/tox_uv-1.26.0.tar.gz", hash = "sha256:5045880c467eed58a98f7eaa7fe286b7ef688e2c56f2123d53e275011495c381", size = 21523, upload-time = "2025-05-27T14:51:42.702Z" }1025+wheels = [1026+ { url = "https://files.pythonhosted.org/packages/46/b8/04c5cb83da072a3f96d357d68a551f5e97e162573c2011a09437df995811/tox_uv-1.26.0-py3-none-any.whl", hash = "sha256:894b2e7274fd6131c3bd1012813edc858753cad67727050c21cd973a08e691c8", size = 16562, upload-time = "2025-05-27T14:51:40.803Z" },1027+]1028+1029+[[package]]1030+name = "typing-extensions"1031+version = "4.14.0"1032+source = { registry = "https://pypi.org/simple" }1033+sdist = { url = "https://files.pythonhosted.org/packages/d1/bc/51647cd02527e87d05cb083ccc402f93e441606ff1f01739a62c8ad09ba5/typing_extensions-4.14.0.tar.gz", hash = "sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4", size = 107423, upload-time = "2025-06-02T14:52:11.399Z" }1034+wheels = [1035+ { url = "https://files.pythonhosted.org/packages/69/e0/552843e0d356fbb5256d21449fa957fa4eff3bbc135a74a691ee70c7c5da/typing_extensions-4.14.0-py3-none-any.whl", hash = "sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af", size = 43839, upload-time = "2025-06-02T14:52:10.026Z" },1036+]1037+1038+[[package]]1039+name = "urllib3"1040+version = "2.4.0"1041+source = { registry = "https://pypi.org/simple" }1042+sdist = { url = "https://files.pythonhosted.org/packages/8a/78/16493d9c386d8e60e442a35feac5e00f0913c0f4b7c217c11e8ec2ff53e0/urllib3-2.4.0.tar.gz", hash = "sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466", size = 390672, upload-time = "2025-04-10T15:23:39.232Z" }1043+wheels = [1044+ { url = "https://files.pythonhosted.org/packages/6b/11/cc635220681e93a0183390e26485430ca2c7b5f9d33b15c74c2861cb8091/urllib3-2.4.0-py3-none-any.whl", hash = "sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813", size = 128680, upload-time = "2025-04-10T15:23:37.377Z" },1045+]1046+1047+[[package]]1048+name = "uv"1049+version = "0.7.12"1050+source = { registry = "https://pypi.org/simple" }1051+sdist = { url = "https://files.pythonhosted.org/packages/67/35/360a4aa325254b7f11d0898d30588861428659011b34f1e19c40fdd15db6/uv-0.7.12.tar.gz", hash = "sha256:4aa152e6a70d5662ca66a918f697bf8fb710f391068aa7d04e032af2edebb095", size = 3298683, upload-time = "2025-06-06T20:39:04.308Z" }1052+wheels = [1053+ { url = "https://files.pythonhosted.org/packages/f8/64/ee9f1b27f006c49a6765e9655ab93e7c8cbd6f0bf8b731f30f608b0be9fd/uv-0.7.12-py3-none-linux_armv6l.whl", hash = "sha256:81824caf5756ffee54b4c937d92d7c8c224c416270c90a83b9b4a973f6e4e559", size = 17024991, upload-time = "2025-06-06T20:38:17.053Z" },1054+ { url = "https://files.pythonhosted.org/packages/43/aa/f42707faa13a9c1b4f662456b2dca4bde169eb921f135319d8856c6e5e8e/uv-0.7.12-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:02e67c5f9d141fb25976cddb28abceaf715412ed83070cb9b87c5c488c8451af", size = 17097383, upload-time = "2025-06-06T20:38:21.174Z" },1055+ { url = "https://files.pythonhosted.org/packages/b9/a9/0f27e16e161f98240a328b5201b8abf178b751fde4fc56c54c1321812cd5/uv-0.7.12-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e70a4393fd6a09b056e1ac500fe2b796d26c30783194868c6801ea08c3bbf863", size = 15812649, upload-time = "2025-06-06T20:38:23.51Z" },1056+ { url = "https://files.pythonhosted.org/packages/0b/eb/605d8f1d08606024209d0e31c3799c696199a887260ee1db52663e4da2e8/uv-0.7.12-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:bb47326b9c4802db28e11f1aab174d5c9c0a8b26ed0a83094d3882dd8f5049ad", size = 16344497, upload-time = "2025-06-06T20:38:25.899Z" },1057+ { url = "https://files.pythonhosted.org/packages/b7/86/3503eb869fa17d607cc296a6514db52ec73c2ec85ad608952a207fd2e8ff/uv-0.7.12-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:14214a51e0ae0f0e8dbcac35a29722c45dbf40d0fd37309897642f7989af6caf", size = 16773525, upload-time = "2025-06-06T20:38:28.619Z" },1058+ { url = "https://files.pythonhosted.org/packages/9b/d6/868fb3f0b9f2a0d2f14cb8079171b862adbd782e47e0469dad3d3d71c938/uv-0.7.12-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0fa630d865111c26f26c5e6f4547a73b13284f098471a4ca982d7b0caf0e658b", size = 17551173, upload-time = "2025-06-06T20:38:31.166Z" },1059+ { url = "https://files.pythonhosted.org/packages/d4/a8/b5be1c67c7894caf178e850903ac25f465e3508a6eada2ae735b187dc39d/uv-0.7.12-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:1557a154d2c36030ff0b707f3c2bfafd977e54fcd4d628dd0fa8a265449e9f13", size = 18359491, upload-time = "2025-06-06T20:38:33.569Z" },1060+ { url = "https://files.pythonhosted.org/packages/95/23/f62bab13f67ed785f7ad01546c499809d1db71b03f94950380f0bc407625/uv-0.7.12-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7e0ba7767b21d58d65703c3cd43814ccfe06d7664ac42b3589d5f2b72486b903", size = 18098855, upload-time = "2025-06-06T20:38:36.029Z" },1061+ { url = "https://files.pythonhosted.org/packages/a6/4a/db21a5d3839771799af2df366cc5ed0933ebe9fc9e920f212e33dc00136e/uv-0.7.12-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e0672dc5dc1b0ae7191d11ecae8bb794c7e860936b66c2bc3855bd0dee17fca1", size = 18206282, upload-time = "2025-06-06T20:38:38.582Z" },1062+ { url = "https://files.pythonhosted.org/packages/bc/ae/fcfd916cbc109c5626dc25b208395b47ba12b27af82f3bb8e247b4e95692/uv-0.7.12-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e34b4ad4288828210c2e075934009903514ca97bd603aced7d0755040b4d0489", size = 17777690, upload-time = "2025-06-06T20:38:41.021Z" },1063+ { url = "https://files.pythonhosted.org/packages/92/78/608163b35ffaf1054cd10197646b6336e7be7b6a51dfef6d98a91600c6be/uv-0.7.12-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:8a7ed9e94ec409bfc7181ee274d1b0ed6292698a20df0ae035ce422224863af5", size = 16599406, upload-time = "2025-06-06T20:38:43.72Z" },1064+ { url = "https://files.pythonhosted.org/packages/d4/d6/6fe3b16390472a9d31dd1e0e7e3759b884d71e8a0dff1baf4a753b4adaaa/uv-0.7.12-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:85e8d3dea95016a45ed8c48343f98734d1b5c4be7bba26257d4c8873059646fa", size = 16714823, upload-time = "2025-06-06T20:38:45.949Z" },1065+ { url = "https://files.pythonhosted.org/packages/b3/a5/b0432a25eaa23e9f909649321784b8e4be4579e9957eb5d369aa30c79164/uv-0.7.12-py3-none-musllinux_1_1_i686.whl", hash = "sha256:01310c45d55f6e7580124c9b1f7e3586b9609c4f8e5a78558a75951b03541bb2", size = 17086446, upload-time = "2025-06-06T20:38:48.648Z" },1066+ { url = "https://files.pythonhosted.org/packages/da/d8/673591f34f897aa4216144a513e60c2004399155c47e7b550612960359c6/uv-0.7.12-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:4c697ef9d9f6b6f42df5a661efa8a745c0e4c330039d45b549b2ca7e7b66f8a5", size = 17903789, upload-time = "2025-06-06T20:38:51.864Z" },1067+ { url = "https://files.pythonhosted.org/packages/15/09/e476187c0a1da78b9c2021f3c3ab31ed2469a70d222bde5dc892236b3c4f/uv-0.7.12-py3-none-win32.whl", hash = "sha256:6008abf92c8d37060944377d89bf9f514aa18370391d9d63dc7d449dac94aca1", size = 17344011, upload-time = "2025-06-06T20:38:54.276Z" },1068+ { url = "https://files.pythonhosted.org/packages/08/9e/c52c7f50280e57110ca79b6805877f50514d9a777d31a683a4eb1de52312/uv-0.7.12-py3-none-win_amd64.whl", hash = "sha256:bb57bd26becd86194788f832af373b6ba431314fa0f6f7e904c90cac1818a7dc", size = 18803328, upload-time = "2025-06-06T20:38:59.368Z" },1069+ { url = "https://files.pythonhosted.org/packages/8e/35/4800ff7bc1663d9f967eabc8440074f906c8a98ea28d1aae66d2d19b7ae9/uv-0.7.12-py3-none-win_arm64.whl", hash = "sha256:8aba24e12ded2f2974a2f213e55daabf78002613d3772c1396fc924c6682cd27", size = 17450522, upload-time = "2025-06-06T20:39:01.963Z" },1070+]1071+1072+[[package]]1073+name = "uvicorn"1074+version = "0.34.3"1075+source = { registry = "https://pypi.org/simple" }1076+dependencies = [1077+ { name = "click" },1078+ { name = "h11" },1079+ { name = "typing-extensions", marker = "python_full_version < '3.11'" },1080+]1081+sdist = { url = "https://files.pythonhosted.org/packages/de/ad/713be230bcda622eaa35c28f0d328c3675c371238470abdea52417f17a8e/uvicorn-0.34.3.tar.gz", hash = "sha256:35919a9a979d7a59334b6b10e05d77c1d0d574c50e0fc98b8b1a0f165708b55a", size = 76631, upload-time = "2025-06-01T07:48:17.531Z" }1082+wheels = [1083+ { url = "https://files.pythonhosted.org/packages/6d/0d/8adfeaa62945f90d19ddc461c55f4a50c258af7662d34b6a3d5d1f8646f6/uvicorn-0.34.3-py3-none-any.whl", hash = "sha256:16246631db62bdfbf069b0645177d6e8a77ba950cfedbfd093acef9444e4d885", size = 62431, upload-time = "2025-06-01T07:48:15.664Z" },1084+]1085+1086+[[package]]1087+name = "virtualenv"1088+version = "20.31.2"1089+source = { registry = "https://pypi.org/simple" }1090+dependencies = [1091+ { name = "distlib" },1092+ { name = "filelock" },1093+ { name = "platformdirs" },1094+]1095+sdist = { url = "https://files.pythonhosted.org/packages/56/2c/444f465fb2c65f40c3a104fd0c495184c4f2336d65baf398e3c75d72ea94/virtualenv-20.31.2.tar.gz", hash = "sha256:e10c0a9d02835e592521be48b332b6caee6887f332c111aa79a09b9e79efc2af", size = 6076316, upload-time = "2025-05-08T17:58:23.811Z" }1096+wheels = [1097+ { url = "https://files.pythonhosted.org/packages/f3/40/b1c265d4b2b62b58576588510fc4d1fe60a86319c8de99fd8e9fec617d2c/virtualenv-20.31.2-py3-none-any.whl", hash = "sha256:36efd0d9650ee985f0cad72065001e66d49a6f24eb44d98980f630686243cf11", size = 6057982, upload-time = "2025-05-08T17:58:21.15Z" },1098+]1099+1100+[[package]]1101+name = "watchfiles"1102+version = "1.0.5"1103+source = { registry = "https://pypi.org/simple" }1104+dependencies = [1105+ { name = "anyio" },1106+]1107+sdist = { url = "https://files.pythonhosted.org/packages/03/e2/8ed598c42057de7aa5d97c472254af4906ff0a59a66699d426fc9ef795d7/watchfiles-1.0.5.tar.gz", hash = "sha256:b7529b5dcc114679d43827d8c35a07c493ad6f083633d573d81c660abc5979e9", size = 94537, upload-time = "2025-04-08T10:36:26.722Z" }1108+wheels = [1109+ { url = "https://files.pythonhosted.org/packages/af/4d/d02e6ea147bb7fff5fd109c694a95109612f419abed46548a930e7f7afa3/watchfiles-1.0.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:5c40fe7dd9e5f81e0847b1ea64e1f5dd79dd61afbedb57759df06767ac719b40", size = 405632, upload-time = "2025-04-08T10:34:41.832Z" },1110+ { url = "https://files.pythonhosted.org/packages/60/31/9ee50e29129d53a9a92ccf1d3992751dc56fc3c8f6ee721be1c7b9c81763/watchfiles-1.0.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8c0db396e6003d99bb2d7232c957b5f0b5634bbd1b24e381a5afcc880f7373fb", size = 395734, upload-time = "2025-04-08T10:34:44.236Z" },1111+ { url = "https://files.pythonhosted.org/packages/ad/8c/759176c97195306f028024f878e7f1c776bda66ccc5c68fa51e699cf8f1d/watchfiles-1.0.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b551d4fb482fc57d852b4541f911ba28957d051c8776e79c3b4a51eb5e2a1b11", size = 455008, upload-time = "2025-04-08T10:34:45.617Z" },1112+ { url = "https://files.pythonhosted.org/packages/55/1a/5e977250c795ee79a0229e3b7f5e3a1b664e4e450756a22da84d2f4979fe/watchfiles-1.0.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:830aa432ba5c491d52a15b51526c29e4a4b92bf4f92253787f9726fe01519487", size = 459029, upload-time = "2025-04-08T10:34:46.814Z" },1113+ { url = "https://files.pythonhosted.org/packages/e6/17/884cf039333605c1d6e296cf5be35fad0836953c3dfd2adb71b72f9dbcd0/watchfiles-1.0.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a16512051a822a416b0d477d5f8c0e67b67c1a20d9acecb0aafa3aa4d6e7d256", size = 488916, upload-time = "2025-04-08T10:34:48.571Z" },1114+ { url = "https://files.pythonhosted.org/packages/ef/e0/bcb6e64b45837056c0a40f3a2db3ef51c2ced19fda38484fa7508e00632c/watchfiles-1.0.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bfe0cbc787770e52a96c6fda6726ace75be7f840cb327e1b08d7d54eadc3bc85", size = 523763, upload-time = "2025-04-08T10:34:50.268Z" },1115+ { url = "https://files.pythonhosted.org/packages/24/e9/f67e9199f3bb35c1837447ecf07e9830ec00ff5d35a61e08c2cd67217949/watchfiles-1.0.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d363152c5e16b29d66cbde8fa614f9e313e6f94a8204eaab268db52231fe5358", size = 502891, upload-time = "2025-04-08T10:34:51.419Z" },1116+ { url = "https://files.pythonhosted.org/packages/23/ed/a6cf815f215632f5c8065e9c41fe872025ffea35aa1f80499f86eae922db/watchfiles-1.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ee32c9a9bee4d0b7bd7cbeb53cb185cf0b622ac761efaa2eba84006c3b3a614", size = 454921, upload-time = "2025-04-08T10:34:52.67Z" },1117+ { url = "https://files.pythonhosted.org/packages/92/4c/e14978599b80cde8486ab5a77a821e8a982ae8e2fcb22af7b0886a033ec8/watchfiles-1.0.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:29c7fd632ccaf5517c16a5188e36f6612d6472ccf55382db6c7fe3fcccb7f59f", size = 631422, upload-time = "2025-04-08T10:34:53.985Z" },1118+ { url = "https://files.pythonhosted.org/packages/b2/1a/9263e34c3458f7614b657f974f4ee61fd72f58adce8b436e16450e054efd/watchfiles-1.0.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8e637810586e6fe380c8bc1b3910accd7f1d3a9a7262c8a78d4c8fb3ba6a2b3d", size = 625675, upload-time = "2025-04-08T10:34:55.173Z" },1119+ { url = "https://files.pythonhosted.org/packages/96/1f/1803a18bd6ab04a0766386a19bcfe64641381a04939efdaa95f0e3b0eb58/watchfiles-1.0.5-cp310-cp310-win32.whl", hash = "sha256:cd47d063fbeabd4c6cae1d4bcaa38f0902f8dc5ed168072874ea11d0c7afc1ff", size = 277921, upload-time = "2025-04-08T10:34:56.318Z" },1120+ { url = "https://files.pythonhosted.org/packages/c2/3b/29a89de074a7d6e8b4dc67c26e03d73313e4ecf0d6e97e942a65fa7c195e/watchfiles-1.0.5-cp310-cp310-win_amd64.whl", hash = "sha256:86c0df05b47a79d80351cd179893f2f9c1b1cae49d96e8b3290c7f4bd0ca0a92", size = 291526, upload-time = "2025-04-08T10:34:57.95Z" },1121+ { url = "https://files.pythonhosted.org/packages/39/f4/41b591f59021786ef517e1cdc3b510383551846703e03f204827854a96f8/watchfiles-1.0.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:237f9be419e977a0f8f6b2e7b0475ababe78ff1ab06822df95d914a945eac827", size = 405336, upload-time = "2025-04-08T10:34:59.359Z" },1122+ { url = "https://files.pythonhosted.org/packages/ae/06/93789c135be4d6d0e4f63e96eea56dc54050b243eacc28439a26482b5235/watchfiles-1.0.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e0da39ff917af8b27a4bdc5a97ac577552a38aac0d260a859c1517ea3dc1a7c4", size = 395977, upload-time = "2025-04-08T10:35:00.522Z" },1123+ { url = "https://files.pythonhosted.org/packages/d2/db/1cd89bd83728ca37054512d4d35ab69b5f12b8aa2ac9be3b0276b3bf06cc/watchfiles-1.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2cfcb3952350e95603f232a7a15f6c5f86c5375e46f0bd4ae70d43e3e063c13d", size = 455232, upload-time = "2025-04-08T10:35:01.698Z" },1124+ { url = "https://files.pythonhosted.org/packages/40/90/d8a4d44ffe960517e487c9c04f77b06b8abf05eb680bed71c82b5f2cad62/watchfiles-1.0.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:68b2dddba7a4e6151384e252a5632efcaa9bc5d1c4b567f3cb621306b2ca9f63", size = 459151, upload-time = "2025-04-08T10:35:03.358Z" },1125+ { url = "https://files.pythonhosted.org/packages/6c/da/267a1546f26465dead1719caaba3ce660657f83c9d9c052ba98fb8856e13/watchfiles-1.0.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:95cf944fcfc394c5f9de794ce581914900f82ff1f855326f25ebcf24d5397418", size = 489054, upload-time = "2025-04-08T10:35:04.561Z" },1126+ { url = "https://files.pythonhosted.org/packages/b1/31/33850dfd5c6efb6f27d2465cc4c6b27c5a6f5ed53c6fa63b7263cf5f60f6/watchfiles-1.0.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ecf6cd9f83d7c023b1aba15d13f705ca7b7d38675c121f3cc4a6e25bd0857ee9", size = 523955, upload-time = "2025-04-08T10:35:05.786Z" },1127+ { url = "https://files.pythonhosted.org/packages/09/84/b7d7b67856efb183a421f1416b44ca975cb2ea6c4544827955dfb01f7dc2/watchfiles-1.0.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:852de68acd6212cd6d33edf21e6f9e56e5d98c6add46f48244bd479d97c967c6", size = 502234, upload-time = "2025-04-08T10:35:07.187Z" },1128+ { url = "https://files.pythonhosted.org/packages/71/87/6dc5ec6882a2254cfdd8b0718b684504e737273903b65d7338efaba08b52/watchfiles-1.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5730f3aa35e646103b53389d5bc77edfbf578ab6dab2e005142b5b80a35ef25", size = 454750, upload-time = "2025-04-08T10:35:08.859Z" },1129+ { url = "https://files.pythonhosted.org/packages/3d/6c/3786c50213451a0ad15170d091570d4a6554976cf0df19878002fc96075a/watchfiles-1.0.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:18b3bd29954bc4abeeb4e9d9cf0b30227f0f206c86657674f544cb032296acd5", size = 631591, upload-time = "2025-04-08T10:35:10.64Z" },1130+ { url = "https://files.pythonhosted.org/packages/1b/b3/1427425ade4e359a0deacce01a47a26024b2ccdb53098f9d64d497f6684c/watchfiles-1.0.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ba5552a1b07c8edbf197055bc9d518b8f0d98a1c6a73a293bc0726dce068ed01", size = 625370, upload-time = "2025-04-08T10:35:12.412Z" },1131+ { url = "https://files.pythonhosted.org/packages/15/ba/f60e053b0b5b8145d682672024aa91370a29c5c921a88977eb565de34086/watchfiles-1.0.5-cp311-cp311-win32.whl", hash = "sha256:2f1fefb2e90e89959447bc0420fddd1e76f625784340d64a2f7d5983ef9ad246", size = 277791, upload-time = "2025-04-08T10:35:13.719Z" },1132+ { url = "https://files.pythonhosted.org/packages/50/ed/7603c4e164225c12c0d4e8700b64bb00e01a6c4eeea372292a3856be33a4/watchfiles-1.0.5-cp311-cp311-win_amd64.whl", hash = "sha256:b6e76ceb1dd18c8e29c73f47d41866972e891fc4cc7ba014f487def72c1cf096", size = 291622, upload-time = "2025-04-08T10:35:15.071Z" },1133+ { url = "https://files.pythonhosted.org/packages/a2/c2/99bb7c96b4450e36877fde33690ded286ff555b5a5c1d925855d556968a1/watchfiles-1.0.5-cp311-cp311-win_arm64.whl", hash = "sha256:266710eb6fddc1f5e51843c70e3bebfb0f5e77cf4f27129278c70554104d19ed", size = 283699, upload-time = "2025-04-08T10:35:16.732Z" },1134+ { url = "https://files.pythonhosted.org/packages/2a/8c/4f0b9bdb75a1bfbd9c78fad7d8854369283f74fe7cf03eb16be77054536d/watchfiles-1.0.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b5eb568c2aa6018e26da9e6c86f3ec3fd958cee7f0311b35c2630fa4217d17f2", size = 401511, upload-time = "2025-04-08T10:35:17.956Z" },1135+ { url = "https://files.pythonhosted.org/packages/dc/4e/7e15825def77f8bd359b6d3f379f0c9dac4eb09dd4ddd58fd7d14127179c/watchfiles-1.0.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0a04059f4923ce4e856b4b4e5e783a70f49d9663d22a4c3b3298165996d1377f", size = 392715, upload-time = "2025-04-08T10:35:19.202Z" },1136+ { url = "https://files.pythonhosted.org/packages/58/65/b72fb817518728e08de5840d5d38571466c1b4a3f724d190cec909ee6f3f/watchfiles-1.0.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e380c89983ce6e6fe2dd1e1921b9952fb4e6da882931abd1824c092ed495dec", size = 454138, upload-time = "2025-04-08T10:35:20.586Z" },1137+ { url = "https://files.pythonhosted.org/packages/3e/a4/86833fd2ea2e50ae28989f5950b5c3f91022d67092bfec08f8300d8b347b/watchfiles-1.0.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fe43139b2c0fdc4a14d4f8d5b5d967f7a2777fd3d38ecf5b1ec669b0d7e43c21", size = 458592, upload-time = "2025-04-08T10:35:21.87Z" },1138+ { url = "https://files.pythonhosted.org/packages/38/7e/42cb8df8be9a37e50dd3a818816501cf7a20d635d76d6bd65aae3dbbff68/watchfiles-1.0.5-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee0822ce1b8a14fe5a066f93edd20aada932acfe348bede8aa2149f1a4489512", size = 487532, upload-time = "2025-04-08T10:35:23.143Z" },1139+ { url = "https://files.pythonhosted.org/packages/fc/fd/13d26721c85d7f3df6169d8b495fcac8ab0dc8f0945ebea8845de4681dab/watchfiles-1.0.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a0dbcb1c2d8f2ab6e0a81c6699b236932bd264d4cef1ac475858d16c403de74d", size = 522865, upload-time = "2025-04-08T10:35:24.702Z" },1140+ { url = "https://files.pythonhosted.org/packages/a1/0d/7f9ae243c04e96c5455d111e21b09087d0eeaf9a1369e13a01c7d3d82478/watchfiles-1.0.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a2014a2b18ad3ca53b1f6c23f8cd94a18ce930c1837bd891262c182640eb40a6", size = 499887, upload-time = "2025-04-08T10:35:25.969Z" },1141+ { url = "https://files.pythonhosted.org/packages/8e/0f/a257766998e26aca4b3acf2ae97dff04b57071e991a510857d3799247c67/watchfiles-1.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10f6ae86d5cb647bf58f9f655fcf577f713915a5d69057a0371bc257e2553234", size = 454498, upload-time = "2025-04-08T10:35:27.353Z" },1142+ { url = "https://files.pythonhosted.org/packages/81/79/8bf142575a03e0af9c3d5f8bcae911ee6683ae93a625d349d4ecf4c8f7df/watchfiles-1.0.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1a7bac2bde1d661fb31f4d4e8e539e178774b76db3c2c17c4bb3e960a5de07a2", size = 630663, upload-time = "2025-04-08T10:35:28.685Z" },1143+ { url = "https://files.pythonhosted.org/packages/f1/80/abe2e79f610e45c63a70d271caea90c49bbf93eb00fa947fa9b803a1d51f/watchfiles-1.0.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4ab626da2fc1ac277bbf752446470b367f84b50295264d2d313e28dc4405d663", size = 625410, upload-time = "2025-04-08T10:35:30.42Z" },1144+ { url = "https://files.pythonhosted.org/packages/91/6f/bc7fbecb84a41a9069c2c6eb6319f7f7df113adf113e358c57fc1aff7ff5/watchfiles-1.0.5-cp312-cp312-win32.whl", hash = "sha256:9f4571a783914feda92018ef3901dab8caf5b029325b5fe4558c074582815249", size = 277965, upload-time = "2025-04-08T10:35:32.023Z" },1145+ { url = "https://files.pythonhosted.org/packages/99/a5/bf1c297ea6649ec59e935ab311f63d8af5faa8f0b86993e3282b984263e3/watchfiles-1.0.5-cp312-cp312-win_amd64.whl", hash = "sha256:360a398c3a19672cf93527f7e8d8b60d8275119c5d900f2e184d32483117a705", size = 291693, upload-time = "2025-04-08T10:35:33.225Z" },1146+ { url = "https://files.pythonhosted.org/packages/7f/7b/fd01087cc21db5c47e5beae507b87965db341cce8a86f9eb12bf5219d4e0/watchfiles-1.0.5-cp312-cp312-win_arm64.whl", hash = "sha256:1a2902ede862969077b97523987c38db28abbe09fb19866e711485d9fbf0d417", size = 283287, upload-time = "2025-04-08T10:35:34.568Z" },1147+ { url = "https://files.pythonhosted.org/packages/c7/62/435766874b704f39b2fecd8395a29042db2b5ec4005bd34523415e9bd2e0/watchfiles-1.0.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:0b289572c33a0deae62daa57e44a25b99b783e5f7aed81b314232b3d3c81a11d", size = 401531, upload-time = "2025-04-08T10:35:35.792Z" },1148+ { url = "https://files.pythonhosted.org/packages/6e/a6/e52a02c05411b9cb02823e6797ef9bbba0bfaf1bb627da1634d44d8af833/watchfiles-1.0.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a056c2f692d65bf1e99c41045e3bdcaea3cb9e6b5a53dcaf60a5f3bd95fc9763", size = 392417, upload-time = "2025-04-08T10:35:37.048Z" },1149+ { url = "https://files.pythonhosted.org/packages/3f/53/c4af6819770455932144e0109d4854437769672d7ad897e76e8e1673435d/watchfiles-1.0.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b9dca99744991fc9850d18015c4f0438865414e50069670f5f7eee08340d8b40", size = 453423, upload-time = "2025-04-08T10:35:38.357Z" },1150+ { url = "https://files.pythonhosted.org/packages/cb/d1/8e88df58bbbf819b8bc5cfbacd3c79e01b40261cad0fc84d1e1ebd778a07/watchfiles-1.0.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:894342d61d355446d02cd3988a7326af344143eb33a2fd5d38482a92072d9563", size = 458185, upload-time = "2025-04-08T10:35:39.708Z" },1151+ { url = "https://files.pythonhosted.org/packages/ff/70/fffaa11962dd5429e47e478a18736d4e42bec42404f5ee3b92ef1b87ad60/watchfiles-1.0.5-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ab44e1580924d1ffd7b3938e02716d5ad190441965138b4aa1d1f31ea0877f04", size = 486696, upload-time = "2025-04-08T10:35:41.469Z" },1152+ { url = "https://files.pythonhosted.org/packages/39/db/723c0328e8b3692d53eb273797d9a08be6ffb1d16f1c0ba2bdbdc2a3852c/watchfiles-1.0.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d6f9367b132078b2ceb8d066ff6c93a970a18c3029cea37bfd7b2d3dd2e5db8f", size = 522327, upload-time = "2025-04-08T10:35:43.289Z" },1153+ { url = "https://files.pythonhosted.org/packages/cd/05/9fccc43c50c39a76b68343484b9da7b12d42d0859c37c61aec018c967a32/watchfiles-1.0.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f2e55a9b162e06e3f862fb61e399fe9f05d908d019d87bf5b496a04ef18a970a", size = 499741, upload-time = "2025-04-08T10:35:44.574Z" },1154+ { url = "https://files.pythonhosted.org/packages/23/14/499e90c37fa518976782b10a18b18db9f55ea73ca14641615056f8194bb3/watchfiles-1.0.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0125f91f70e0732a9f8ee01e49515c35d38ba48db507a50c5bdcad9503af5827", size = 453995, upload-time = "2025-04-08T10:35:46.336Z" },1155+ { url = "https://files.pythonhosted.org/packages/61/d9/f75d6840059320df5adecd2c687fbc18960a7f97b55c300d20f207d48aef/watchfiles-1.0.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:13bb21f8ba3248386337c9fa51c528868e6c34a707f729ab041c846d52a0c69a", size = 629693, upload-time = "2025-04-08T10:35:48.161Z" },1156+ { url = "https://files.pythonhosted.org/packages/fc/17/180ca383f5061b61406477218c55d66ec118e6c0c51f02d8142895fcf0a9/watchfiles-1.0.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:839ebd0df4a18c5b3c1b890145b5a3f5f64063c2a0d02b13c76d78fe5de34936", size = 624677, upload-time = "2025-04-08T10:35:49.65Z" },1157+ { url = "https://files.pythonhosted.org/packages/bf/15/714d6ef307f803f236d69ee9d421763707899d6298d9f3183e55e366d9af/watchfiles-1.0.5-cp313-cp313-win32.whl", hash = "sha256:4a8ec1e4e16e2d5bafc9ba82f7aaecfeec990ca7cd27e84fb6f191804ed2fcfc", size = 277804, upload-time = "2025-04-08T10:35:51.093Z" },1158+ { url = "https://files.pythonhosted.org/packages/a8/b4/c57b99518fadf431f3ef47a610839e46e5f8abf9814f969859d1c65c02c7/watchfiles-1.0.5-cp313-cp313-win_amd64.whl", hash = "sha256:f436601594f15bf406518af922a89dcaab416568edb6f65c4e5bbbad1ea45c11", size = 291087, upload-time = "2025-04-08T10:35:52.458Z" },1159+ { url = "https://files.pythonhosted.org/packages/1a/03/81f9fcc3963b3fc415cd4b0b2b39ee8cc136c42fb10a36acf38745e9d283/watchfiles-1.0.5-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f59b870db1f1ae5a9ac28245707d955c8721dd6565e7f411024fa374b5362d1d", size = 405947, upload-time = "2025-04-08T10:36:13.721Z" },1160+ { url = "https://files.pythonhosted.org/packages/54/97/8c4213a852feb64807ec1d380f42d4fc8bfaef896bdbd94318f8fd7f3e4e/watchfiles-1.0.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:9475b0093767e1475095f2aeb1d219fb9664081d403d1dff81342df8cd707034", size = 397276, upload-time = "2025-04-08T10:36:15.131Z" },1161+ { url = "https://files.pythonhosted.org/packages/78/12/d4464d19860cb9672efa45eec1b08f8472c478ed67dcd30647c51ada7aef/watchfiles-1.0.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc533aa50664ebd6c628b2f30591956519462f5d27f951ed03d6c82b2dfd9965", size = 455550, upload-time = "2025-04-08T10:36:16.635Z" },1162+ { url = "https://files.pythonhosted.org/packages/90/fb/b07bcdf1034d8edeaef4c22f3e9e3157d37c5071b5f9492ffdfa4ad4bed7/watchfiles-1.0.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fed1cd825158dcaae36acce7b2db33dcbfd12b30c34317a88b8ed80f0541cc57", size = 455542, upload-time = "2025-04-08T10:36:18.655Z" },1163+]1164+1165+[[package]]1166+name = "websockets"1167+version = "15.0.1"1168+source = { registry = "https://pypi.org/simple" }1169+sdist = { url = "https://files.pythonhosted.org/packages/21/e6/26d09fab466b7ca9c7737474c52be4f76a40301b08362eb2dbc19dcc16c1/websockets-15.0.1.tar.gz", hash = "sha256:82544de02076bafba038ce055ee6412d68da13ab47f0c60cab827346de828dee", size = 177016, upload-time = "2025-03-05T20:03:41.606Z" }1170+wheels = [1171+ { url = "https://files.pythonhosted.org/packages/1e/da/6462a9f510c0c49837bbc9345aca92d767a56c1fb2939e1579df1e1cdcf7/websockets-15.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d63efaa0cd96cf0c5fe4d581521d9fa87744540d4bc999ae6e08595a1014b45b", size = 175423, upload-time = "2025-03-05T20:01:35.363Z" },1172+ { url = "https://files.pythonhosted.org/packages/1c/9f/9d11c1a4eb046a9e106483b9ff69bce7ac880443f00e5ce64261b47b07e7/websockets-15.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ac60e3b188ec7574cb761b08d50fcedf9d77f1530352db4eef1707fe9dee7205", size = 173080, upload-time = "2025-03-05T20:01:37.304Z" },1173+ { url = "https://files.pythonhosted.org/packages/d5/4f/b462242432d93ea45f297b6179c7333dd0402b855a912a04e7fc61c0d71f/websockets-15.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5756779642579d902eed757b21b0164cd6fe338506a8083eb58af5c372e39d9a", size = 173329, upload-time = "2025-03-05T20:01:39.668Z" },1174+ { url = "https://files.pythonhosted.org/packages/6e/0c/6afa1f4644d7ed50284ac59cc70ef8abd44ccf7d45850d989ea7310538d0/websockets-15.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fdfe3e2a29e4db3659dbd5bbf04560cea53dd9610273917799f1cde46aa725e", size = 182312, upload-time = "2025-03-05T20:01:41.815Z" },1175+ { url = "https://files.pythonhosted.org/packages/dd/d4/ffc8bd1350b229ca7a4db2a3e1c482cf87cea1baccd0ef3e72bc720caeec/websockets-15.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c2529b320eb9e35af0fa3016c187dffb84a3ecc572bcee7c3ce302bfeba52bf", size = 181319, upload-time = "2025-03-05T20:01:43.967Z" },1176+ { url = "https://files.pythonhosted.org/packages/97/3a/5323a6bb94917af13bbb34009fac01e55c51dfde354f63692bf2533ffbc2/websockets-15.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac1e5c9054fe23226fb11e05a6e630837f074174c4c2f0fe442996112a6de4fb", size = 181631, upload-time = "2025-03-05T20:01:46.104Z" },1177+ { url = "https://files.pythonhosted.org/packages/a6/cc/1aeb0f7cee59ef065724041bb7ed667b6ab1eeffe5141696cccec2687b66/websockets-15.0.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5df592cd503496351d6dc14f7cdad49f268d8e618f80dce0cd5a36b93c3fc08d", size = 182016, upload-time = "2025-03-05T20:01:47.603Z" },1178+ { url = "https://files.pythonhosted.org/packages/79/f9/c86f8f7af208e4161a7f7e02774e9d0a81c632ae76db2ff22549e1718a51/websockets-15.0.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0a34631031a8f05657e8e90903e656959234f3a04552259458aac0b0f9ae6fd9", size = 181426, upload-time = "2025-03-05T20:01:48.949Z" },1179+ { url = "https://files.pythonhosted.org/packages/c7/b9/828b0bc6753db905b91df6ae477c0b14a141090df64fb17f8a9d7e3516cf/websockets-15.0.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3d00075aa65772e7ce9e990cab3ff1de702aa09be3940d1dc88d5abf1ab8a09c", size = 181360, upload-time = "2025-03-05T20:01:50.938Z" },1180+ { url = "https://files.pythonhosted.org/packages/89/fb/250f5533ec468ba6327055b7d98b9df056fb1ce623b8b6aaafb30b55d02e/websockets-15.0.1-cp310-cp310-win32.whl", hash = "sha256:1234d4ef35db82f5446dca8e35a7da7964d02c127b095e172e54397fb6a6c256", size = 176388, upload-time = "2025-03-05T20:01:52.213Z" },1181+ { url = "https://files.pythonhosted.org/packages/1c/46/aca7082012768bb98e5608f01658ff3ac8437e563eca41cf068bd5849a5e/websockets-15.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:39c1fec2c11dc8d89bba6b2bf1556af381611a173ac2b511cf7231622058af41", size = 176830, upload-time = "2025-03-05T20:01:53.922Z" },1182+ { url = "https://files.pythonhosted.org/packages/9f/32/18fcd5919c293a398db67443acd33fde142f283853076049824fc58e6f75/websockets-15.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:823c248b690b2fd9303ba00c4f66cd5e2d8c3ba4aa968b2779be9532a4dad431", size = 175423, upload-time = "2025-03-05T20:01:56.276Z" },1183+ { url = "https://files.pythonhosted.org/packages/76/70/ba1ad96b07869275ef42e2ce21f07a5b0148936688c2baf7e4a1f60d5058/websockets-15.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678999709e68425ae2593acf2e3ebcbcf2e69885a5ee78f9eb80e6e371f1bf57", size = 173082, upload-time = "2025-03-05T20:01:57.563Z" },1184+ { url = "https://files.pythonhosted.org/packages/86/f2/10b55821dd40eb696ce4704a87d57774696f9451108cff0d2824c97e0f97/websockets-15.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d50fd1ee42388dcfb2b3676132c78116490976f1300da28eb629272d5d93e905", size = 173330, upload-time = "2025-03-05T20:01:59.063Z" },1185+ { url = "https://files.pythonhosted.org/packages/a5/90/1c37ae8b8a113d3daf1065222b6af61cc44102da95388ac0018fcb7d93d9/websockets-15.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d99e5546bf73dbad5bf3547174cd6cb8ba7273062a23808ffea025ecb1cf8562", size = 182878, upload-time = "2025-03-05T20:02:00.305Z" },1186+ { url = "https://files.pythonhosted.org/packages/8e/8d/96e8e288b2a41dffafb78e8904ea7367ee4f891dafc2ab8d87e2124cb3d3/websockets-15.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:66dd88c918e3287efc22409d426c8f729688d89a0c587c88971a0faa2c2f3792", size = 181883, upload-time = "2025-03-05T20:02:03.148Z" },1187+ { url = "https://files.pythonhosted.org/packages/93/1f/5d6dbf551766308f6f50f8baf8e9860be6182911e8106da7a7f73785f4c4/websockets-15.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8dd8327c795b3e3f219760fa603dcae1dcc148172290a8ab15158cf85a953413", size = 182252, upload-time = "2025-03-05T20:02:05.29Z" },1188+ { url = "https://files.pythonhosted.org/packages/d4/78/2d4fed9123e6620cbf1706c0de8a1632e1a28e7774d94346d7de1bba2ca3/websockets-15.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8fdc51055e6ff4adeb88d58a11042ec9a5eae317a0a53d12c062c8a8865909e8", size = 182521, upload-time = "2025-03-05T20:02:07.458Z" },1189+ { url = "https://files.pythonhosted.org/packages/e7/3b/66d4c1b444dd1a9823c4a81f50231b921bab54eee2f69e70319b4e21f1ca/websockets-15.0.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:693f0192126df6c2327cce3baa7c06f2a117575e32ab2308f7f8216c29d9e2e3", size = 181958, upload-time = "2025-03-05T20:02:09.842Z" },1190+ { url = "https://files.pythonhosted.org/packages/08/ff/e9eed2ee5fed6f76fdd6032ca5cd38c57ca9661430bb3d5fb2872dc8703c/websockets-15.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:54479983bd5fb469c38f2f5c7e3a24f9a4e70594cd68cd1fa6b9340dadaff7cf", size = 181918, upload-time = "2025-03-05T20:02:11.968Z" },1191+ { url = "https://files.pythonhosted.org/packages/d8/75/994634a49b7e12532be6a42103597b71098fd25900f7437d6055ed39930a/websockets-15.0.1-cp311-cp311-win32.whl", hash = "sha256:16b6c1b3e57799b9d38427dda63edcbe4926352c47cf88588c0be4ace18dac85", size = 176388, upload-time = "2025-03-05T20:02:13.32Z" },1192+ { url = "https://files.pythonhosted.org/packages/98/93/e36c73f78400a65f5e236cd376713c34182e6663f6889cd45a4a04d8f203/websockets-15.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:27ccee0071a0e75d22cb35849b1db43f2ecd3e161041ac1ee9d2352ddf72f065", size = 176828, upload-time = "2025-03-05T20:02:14.585Z" },1193+ { url = "https://files.pythonhosted.org/packages/51/6b/4545a0d843594f5d0771e86463606a3988b5a09ca5123136f8a76580dd63/websockets-15.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3e90baa811a5d73f3ca0bcbf32064d663ed81318ab225ee4f427ad4e26e5aff3", size = 175437, upload-time = "2025-03-05T20:02:16.706Z" },1194+ { url = "https://files.pythonhosted.org/packages/f4/71/809a0f5f6a06522af902e0f2ea2757f71ead94610010cf570ab5c98e99ed/websockets-15.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:592f1a9fe869c778694f0aa806ba0374e97648ab57936f092fd9d87f8bc03665", size = 173096, upload-time = "2025-03-05T20:02:18.832Z" },1195+ { url = "https://files.pythonhosted.org/packages/3d/69/1a681dd6f02180916f116894181eab8b2e25b31e484c5d0eae637ec01f7c/websockets-15.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0701bc3cfcb9164d04a14b149fd74be7347a530ad3bbf15ab2c678a2cd3dd9a2", size = 173332, upload-time = "2025-03-05T20:02:20.187Z" },1196+ { url = "https://files.pythonhosted.org/packages/a6/02/0073b3952f5bce97eafbb35757f8d0d54812b6174ed8dd952aa08429bcc3/websockets-15.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8b56bdcdb4505c8078cb6c7157d9811a85790f2f2b3632c7d1462ab5783d215", size = 183152, upload-time = "2025-03-05T20:02:22.286Z" },1197+ { url = "https://files.pythonhosted.org/packages/74/45/c205c8480eafd114b428284840da0b1be9ffd0e4f87338dc95dc6ff961a1/websockets-15.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0af68c55afbd5f07986df82831c7bff04846928ea8d1fd7f30052638788bc9b5", size = 182096, upload-time = "2025-03-05T20:02:24.368Z" },1198+ { url = "https://files.pythonhosted.org/packages/14/8f/aa61f528fba38578ec553c145857a181384c72b98156f858ca5c8e82d9d3/websockets-15.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64dee438fed052b52e4f98f76c5790513235efaa1ef7f3f2192c392cd7c91b65", size = 182523, upload-time = "2025-03-05T20:02:25.669Z" },1199+ { url = "https://files.pythonhosted.org/packages/ec/6d/0267396610add5bc0d0d3e77f546d4cd287200804fe02323797de77dbce9/websockets-15.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d5f6b181bb38171a8ad1d6aa58a67a6aa9d4b38d0f8c5f496b9e42561dfc62fe", size = 182790, upload-time = "2025-03-05T20:02:26.99Z" },1200+ { url = "https://files.pythonhosted.org/packages/02/05/c68c5adbf679cf610ae2f74a9b871ae84564462955d991178f95a1ddb7dd/websockets-15.0.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:5d54b09eba2bada6011aea5375542a157637b91029687eb4fdb2dab11059c1b4", size = 182165, upload-time = "2025-03-05T20:02:30.291Z" },1201+ { url = "https://files.pythonhosted.org/packages/29/93/bb672df7b2f5faac89761cb5fa34f5cec45a4026c383a4b5761c6cea5c16/websockets-15.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3be571a8b5afed347da347bfcf27ba12b069d9d7f42cb8c7028b5e98bbb12597", size = 182160, upload-time = "2025-03-05T20:02:31.634Z" },1202+ { url = "https://files.pythonhosted.org/packages/ff/83/de1f7709376dc3ca9b7eeb4b9a07b4526b14876b6d372a4dc62312bebee0/websockets-15.0.1-cp312-cp312-win32.whl", hash = "sha256:c338ffa0520bdb12fbc527265235639fb76e7bc7faafbb93f6ba80d9c06578a9", size = 176395, upload-time = "2025-03-05T20:02:33.017Z" },1203+ { url = "https://files.pythonhosted.org/packages/7d/71/abf2ebc3bbfa40f391ce1428c7168fb20582d0ff57019b69ea20fa698043/websockets-15.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcd5cf9e305d7b8338754470cf69cf81f420459dbae8a3b40cee57417f4614a7", size = 176841, upload-time = "2025-03-05T20:02:34.498Z" },1204+ { url = "https://files.pythonhosted.org/packages/cb/9f/51f0cf64471a9d2b4d0fc6c534f323b664e7095640c34562f5182e5a7195/websockets-15.0.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ee443ef070bb3b6ed74514f5efaa37a252af57c90eb33b956d35c8e9c10a1931", size = 175440, upload-time = "2025-03-05T20:02:36.695Z" },1205+ { url = "https://files.pythonhosted.org/packages/8a/05/aa116ec9943c718905997412c5989f7ed671bc0188ee2ba89520e8765d7b/websockets-15.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5a939de6b7b4e18ca683218320fc67ea886038265fd1ed30173f5ce3f8e85675", size = 173098, upload-time = "2025-03-05T20:02:37.985Z" },1206+ { url = "https://files.pythonhosted.org/packages/ff/0b/33cef55ff24f2d92924923c99926dcce78e7bd922d649467f0eda8368923/websockets-15.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:746ee8dba912cd6fc889a8147168991d50ed70447bf18bcda7039f7d2e3d9151", size = 173329, upload-time = "2025-03-05T20:02:39.298Z" },1207+ { url = "https://files.pythonhosted.org/packages/31/1d/063b25dcc01faa8fada1469bdf769de3768b7044eac9d41f734fd7b6ad6d/websockets-15.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:595b6c3969023ecf9041b2936ac3827e4623bfa3ccf007575f04c5a6aa318c22", size = 183111, upload-time = "2025-03-05T20:02:40.595Z" },1208+ { url = "https://files.pythonhosted.org/packages/93/53/9a87ee494a51bf63e4ec9241c1ccc4f7c2f45fff85d5bde2ff74fcb68b9e/websockets-15.0.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c714d2fc58b5ca3e285461a4cc0c9a66bd0e24c5da9911e30158286c9b5be7f", size = 182054, upload-time = "2025-03-05T20:02:41.926Z" },1209+ { url = "https://files.pythonhosted.org/packages/ff/b2/83a6ddf56cdcbad4e3d841fcc55d6ba7d19aeb89c50f24dd7e859ec0805f/websockets-15.0.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f3c1e2ab208db911594ae5b4f79addeb3501604a165019dd221c0bdcabe4db8", size = 182496, upload-time = "2025-03-05T20:02:43.304Z" },1210+ { url = "https://files.pythonhosted.org/packages/98/41/e7038944ed0abf34c45aa4635ba28136f06052e08fc2168520bb8b25149f/websockets-15.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:229cf1d3ca6c1804400b0a9790dc66528e08a6a1feec0d5040e8b9eb14422375", size = 182829, upload-time = "2025-03-05T20:02:48.812Z" },1211+ { url = "https://files.pythonhosted.org/packages/e0/17/de15b6158680c7623c6ef0db361da965ab25d813ae54fcfeae2e5b9ef910/websockets-15.0.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:756c56e867a90fb00177d530dca4b097dd753cde348448a1012ed6c5131f8b7d", size = 182217, upload-time = "2025-03-05T20:02:50.14Z" },1212+ { url = "https://files.pythonhosted.org/packages/33/2b/1f168cb6041853eef0362fb9554c3824367c5560cbdaad89ac40f8c2edfc/websockets-15.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:558d023b3df0bffe50a04e710bc87742de35060580a293c2a984299ed83bc4e4", size = 182195, upload-time = "2025-03-05T20:02:51.561Z" },1213+ { url = "https://files.pythonhosted.org/packages/86/eb/20b6cdf273913d0ad05a6a14aed4b9a85591c18a987a3d47f20fa13dcc47/websockets-15.0.1-cp313-cp313-win32.whl", hash = "sha256:ba9e56e8ceeeedb2e080147ba85ffcd5cd0711b89576b83784d8605a7df455fa", size = 176393, upload-time = "2025-03-05T20:02:53.814Z" },1214+ { url = "https://files.pythonhosted.org/packages/1b/6c/c65773d6cab416a64d191d6ee8a8b1c68a09970ea6909d16965d26bfed1e/websockets-15.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:e09473f095a819042ecb2ab9465aee615bd9c2028e4ef7d933600a8401c79561", size = 176837, upload-time = "2025-03-05T20:02:55.237Z" },1215+ { url = "https://files.pythonhosted.org/packages/02/9e/d40f779fa16f74d3468357197af8d6ad07e7c5a27ea1ca74ceb38986f77a/websockets-15.0.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0c9e74d766f2818bb95f84c25be4dea09841ac0f734d1966f415e4edfc4ef1c3", size = 173109, upload-time = "2025-03-05T20:03:17.769Z" },1216+ { url = "https://files.pythonhosted.org/packages/bc/cd/5b887b8585a593073fd92f7c23ecd3985cd2c3175025a91b0d69b0551372/websockets-15.0.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1009ee0c7739c08a0cd59de430d6de452a55e42d6b522de7aa15e6f67db0b8e1", size = 173343, upload-time = "2025-03-05T20:03:19.094Z" },1217+ { url = "https://files.pythonhosted.org/packages/fe/ae/d34f7556890341e900a95acf4886833646306269f899d58ad62f588bf410/websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76d1f20b1c7a2fa82367e04982e708723ba0e7b8d43aa643d3dcd404d74f1475", size = 174599, upload-time = "2025-03-05T20:03:21.1Z" },1218+ { url = "https://files.pythonhosted.org/packages/71/e6/5fd43993a87db364ec60fc1d608273a1a465c0caba69176dd160e197ce42/websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f29d80eb9a9263b8d109135351caf568cc3f80b9928bccde535c235de55c22d9", size = 174207, upload-time = "2025-03-05T20:03:23.221Z" },1219+ { url = "https://files.pythonhosted.org/packages/2b/fb/c492d6daa5ec067c2988ac80c61359ace5c4c674c532985ac5a123436cec/websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b359ed09954d7c18bbc1680f380c7301f92c60bf924171629c5db97febb12f04", size = 174155, upload-time = "2025-03-05T20:03:25.321Z" },1220+ { url = "https://files.pythonhosted.org/packages/68/a1/dcb68430b1d00b698ae7a7e0194433bce4f07ded185f0ee5fb21e2a2e91e/websockets-15.0.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:cad21560da69f4ce7658ca2cb83138fb4cf695a2ba3e475e0559e05991aa8122", size = 176884, upload-time = "2025-03-05T20:03:27.934Z" },1221+ { url = "https://files.pythonhosted.org/packages/fa/a8/5b41e0da817d64113292ab1f8247140aac61cbf6cfd085d6a0fa77f4984f/websockets-15.0.1-py3-none-any.whl", hash = "sha256:f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736f", size = 169743, upload-time = "2025-03-05T20:03:39.41Z" },1222+]