Skip to content
Myr

Merge branch '8.1.x'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parents f8857cb, 525c5f1 · Browse files · 25 files+276 added−424 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

25 files+276 added−424 removed

  • tests:+1 added−1 removed
  • other:+275 added−423 removed

25 files+276 added−424 removed

added:.devcontainer/devcontainer.json+17 added
added:.devcontainer/on-create-command.sh+7 added
modified:.github/ISSUE_TEMPLATE/bug-report.md+1 added-1 removed
modified:.github/ISSUE_TEMPLATE/config.yml+5 added-8 removed
modified:.github/ISSUE_TEMPLATE/feature-request.md+3 added-3 removed
modified:.github/workflows/lock.yaml+6 added-5 removed
modified:.github/workflows/publish.yaml+12 added-15 removed
modified:.github/workflows/tests.yaml+30 added-22 removed
13 unmodified lines
14 - '*.md'15 - '*.rst'16jobs:17 tests:18 name: ${{ matrix.name }}19 runs-on: ${{ matrix.os }}18 name: ${{ matrix.name || matrix.python }}19 runs-on: ${{ matrix.os || 'ubuntu-latest' }}20 strategy:21 fail-fast: false22 matrix:23 include:24 - {name: Linux, python: '3.12', os: ubuntu-latest, tox: py312}25 - {name: Windows, python: '3.12', os: windows-latest, tox: py312}26 - {name: Mac, python: '3.12', os: macos-latest, tox: py312}27 - {name: '3.11', python: '3.11', os: ubuntu-latest, tox: py311}28 - {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}29 - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}30 - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}31 - {name: 'PyPy', python: 'pypy-3.10', os: ubuntu-latest, tox: pypy310}32 - {name: Typing, python: '3.12', os: ubuntu-latest, tox: typing}24 - {python: '3.12'}25 - {name: Windows, python: '3.12', os: windows-latest}26 - {name: Mac, python: '3.12', os: macos-latest}27 - {python: '3.11'}28 - {python: '3.10'}29 - {python: '3.9'}30 - {python: '3.8'}31 - {python: '3.7'}32 - {name: PyPy, python: 'pypy-3.10', tox: pypy310}33 - {name: Minimum Versions, python: '3.12', tox: py-min}34 - {name: Development Versions, python: '3.8', tox: py-dev}35 steps:34 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.135 - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.036 - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.237 - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.038 with:39 python-version: ${{ matrix.python }}40 allow-prereleases: true41 cache: pip39 cache-dependency-path: requirements/*.txt40 - name: update pip41 run: |42 pip install -U wheel43 pip install -U setuptools44 python -m pip install -U pip42 cache-dependency-path: requirements*/*.txt43 - run: pip install tox44 - run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }}45 typing:46 runs-on: ubuntu-latest47 steps:48 - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.249 - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.050 with:51 python-version: '3.x'52 cache: pip53 cache-dependency-path: requirements*/*.txt54 - name: cache mypy55 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.256 with:57 path: ./.mypy_cache49 key: mypy|${{ matrix.python }}|${{ hashFiles('setup.cfg') }}50 if: matrix.tox == 'typing'58 key: mypy|${{ hashFiles('pyproject.toml') }}59 - run: pip install tox52 - run: tox run -e ${{ matrix.tox }}60 - run: tox run -e typing
modified:.github/pull_request_template.md+10 added-15 removed
1<!--2Before opening a PR, open a ticket describing the issue or feature the3PR will address. Follow the steps in CONTRIBUTING.rst.3PR will address. An issue is not required for fixing typos in4documentation, or other simple non-code changes.56Replace this comment with a description of the change. Describe how it7addresses the linked ticket.8-->910<!--11Link to relevant issues or previous PRs, one per line. Use "fixes" to12automatically close an issue.1314fixes #<issue number>15-->1614- fixes #<issue number>1517<!--17Ensure each step in CONTRIBUTING.rst is complete by adding an "x" to18each box below.18Ensure each step in CONTRIBUTING.rst is complete, especially the following:1920If only docs were changed, these aren't relevant and can be removed.20- Add tests that demonstrate the correct behavior of the change. Tests21 should fail without the change.22- Add or update relevant docs, in the docs folder and in code.23- Add an entry in CHANGES.rst summarizing the change and linking to the issue.24- Add `.. versionchanged::` entries in any relevant code docs.25-->2223Checklist:2425- [ ] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.26- [ ] Add or update relevant docs, in the docs folder and in code.27- [ ] Add an entry in `CHANGES.rst` summarizing the change and linking to the issue.28- [ ] Add `.. versionchanged::` entries in any relevant code docs.29- [ ] Run `pre-commit` hooks and fix any issues.30- [ ] Run `pytest` and `tox`, no tests failed.
modified:docs/conf.py+12 added-9 removed
8 unmodified lines
9release, version = get_version("Click")1011# General --------------------------------------------------------------1213master_doc = "index"13default_role = "code"14extensions = [15 "sphinx.ext.autodoc",16 "sphinx.ext.extlinks",17 "sphinx.ext.intersphinx",18 "sphinx_tabs.tabs",19 "sphinxcontrib.log_cabinet",20 "pallets_sphinx_themes",19 "sphinx_issues",20 "sphinx_tabs.tabs",21]22autodoc_member_order = "bysource"23autodoc_typehints = "description"23intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}24issues_github_path = "pallets/click"24autodoc_preserve_defaults = True25extlinks = {26 "issue": ("https://github.com/pallets/flask/issues/%s", "#%s"),27 "pr": ("https://github.com/pallets/flask/pull/%s", "#%s"),28}29intersphinx_mapping = {30 "python": ("https://docs.python.org/3/", None),31}3233# HTML -----------------------------------------------------------------3435html_theme = "click"
16 unmodified lines
52html_favicon = "_static/click-icon.png"53html_logo = "_static/click-logo-sidebar.png"54html_title = f"Click Documentation ({version})"55html_show_sourcelink = False4950# LaTeX ----------------------------------------------------------------5152latex_documents = [(master_doc, f"Click-{version}.tex", html_title, author, "manual")]
modified:docs/license.rst+2 added-1 removed
1BSD-3-Clause License2====================34.. include:: ../LICENSE.rst4.. literalinclude:: ../LICENSE.txt5 :language: text
modified:requirements/dev.txt+33 added-110 removed
1# SHA1:54b5b77ec8c7a0064ffa93b2fd16cb0130ba177c2#2# This file is autogenerated by pip-compile with Python 3.123# by the following command:3# This file is autogenerated by pip-compile-multi4# To update, run:5#5# pip-compile dev.in6# pip-compile-multi7#7alabaster==0.7.168 # via sphinx9babel==2.14.010 # via sphinx11build==1.1.18-r docs.txt9-r tests.txt10-r typing.txt11build==0.10.012 # via pip-tools13cachetools==5.3.313cachetools==5.3.114 # via tox15certifi==2024.2.216 # via requests17cfgv==3.4.015cfgv==3.3.116 # via pre-commit19chardet==5.2.017chardet==5.1.018 # via tox21charset-normalizer==3.3.222 # via requests23click==8.1.724 # via pip-tools19click==8.1.320 # via21 # pip-compile-multi22 # pip-tools23colorama==0.4.624 # via tox27distlib==0.3.825distlib==0.3.626 # via virtualenv29docutils==0.20.127filelock==3.12.228 # via31 # sphinx32 # sphinx-tabs33filelock==3.13.134 # via29 # tox30 # virtualenv37identify==2.5.3531identify==2.5.2432 # via pre-commit39idna==3.640 # via requests41imagesize==1.4.142 # via sphinx43iniconfig==2.0.044 # via pytest45jinja2==3.1.346 # via sphinx47markupsafe==2.1.548 # via jinja249mypy==1.9.050 # via -r typing.in51mypy-extensions==1.0.052 # via mypy53nodeenv==1.8.033pip-compile-multi==2.6.334 # via -r requirements/dev.in35pip-tools==6.13.036 # via pip-compile-multi37platformdirs==3.8.038 # via55 # pre-commit56 # pyright57packaging==24.058 # via59 # build60 # pallets-sphinx-themes61 # pyproject-api62 # pytest63 # sphinx39 # tox65pallets-sphinx-themes==2.1.166 # via -r docs.in67pip-tools==7.4.168 # via -r dev.in69platformdirs==4.2.070 # via71 # tox40 # virtualenv73pluggy==1.4.074 # via75 # pytest76 # tox77pre-commit==3.6.278 # via -r dev.in79pygments==2.17.280 # via81 # sphinx82 # sphinx-tabs83pyproject-api==1.6.141pre-commit==3.3.342 # via -r requirements/dev.in43pyproject-api==1.5.244 # via tox45pyproject-hooks==1.0.086 # via87 # build88 # pip-tools89pyright==1.1.35590 # via -r typing.in91pytest==8.1.192 # via -r tests.in46 # via build47pyyaml==6.0.148 # via pre-commit95requests==2.31.096 # via sphinx97snowballstemmer==2.2.098 # via sphinx99sphinx==7.2.649toposort==1.1050 # via pip-compile-multi51tox==4.6.352 # via -r requirements/dev.in53virtualenv==20.23.154 # via101 # -r docs.in102 # pallets-sphinx-themes103 # sphinx-issues104 # sphinx-tabs105 # sphinxcontrib-log-cabinet106sphinx-issues==4.0.0107 # via -r docs.in108sphinx-tabs==3.4.5109 # via -r docs.in110sphinxcontrib-applehelp==1.0.8111 # via sphinx112sphinxcontrib-devhelp==1.0.6113 # via sphinx114sphinxcontrib-htmlhelp==2.0.5115 # via sphinx116sphinxcontrib-jsmath==1.0.1117 # via sphinx118sphinxcontrib-log-cabinet==1.0.1119 # via -r docs.in120sphinxcontrib-qthelp==1.0.7121 # via sphinx122sphinxcontrib-serializinghtml==1.1.10123 # via sphinx124tox==4.14.2125 # via -r dev.in126typing-extensions==4.10.0127 # via mypy128urllib3==2.2.1129 # via requests130virtualenv==20.25.1131 # via55 # pre-commit56 # tox134wheel==0.43.057wheel==0.40.058 # via pip-tools5960# The following packages are considered to be unsafe in a requirements file:61# pip
1 unmodified line
modified:requirements/docs.txt+27 added-26 removed
1# SHA1:34fd4ca6516e97c7348e6facdd9c4ebb68209d1c2#2# This file is autogenerated by pip-compile with Python 3.123# by the following command:3# This file is autogenerated by pip-compile-multi4# To update, run:5#5# pip-compile docs.in6# pip-compile-multi7#7alabaster==0.7.168alabaster==0.7.139 # via sphinx9babel==2.14.010babel==2.12.111 # via sphinx11certifi==2024.2.212certifi==2023.5.713 # via requests13charset-normalizer==3.3.214charset-normalizer==3.1.015 # via requests15docutils==0.20.116docutils==0.18.117 # via18 # sphinx19 # sphinx-tabs19idna==3.620idna==3.421 # via requests22imagesize==1.4.123 # via sphinx23jinja2==3.1.324jinja2==3.1.225 # via sphinx25markupsafe==2.1.526markupsafe==2.1.327 # via jinja227packaging==24.028packaging==23.129 # via30 # pallets-sphinx-themes31 # sphinx32pallets-sphinx-themes==2.1.132 # via -r docs.in33pygments==2.17.233 # via -r requirements/docs.in34pygments==2.15.135 # via36 # sphinx37 # sphinx-tabs38requests==2.31.039 # via sphinx40snowballstemmer==2.2.041 # via sphinx41sphinx==7.2.642sphinx==7.0.143 # via43 # -r docs.in44 # -r requirements/docs.in45 # pallets-sphinx-themes46 # sphinx-issues47 # sphinx-tabs48 # sphinxcontrib-log-cabinet48sphinx-issues==4.0.049 # via -r docs.in49sphinx-issues==3.0.150 # via -r requirements/docs.in51sphinx-tabs==3.4.551 # via -r docs.in52sphinxcontrib-applehelp==1.0.852 # via -r requirements/docs.in53sphinxcontrib-applehelp==1.0.454 # via sphinx54sphinxcontrib-devhelp==1.0.655sphinxcontrib-devhelp==1.0.256 # via sphinx56sphinxcontrib-htmlhelp==2.0.557sphinxcontrib-htmlhelp==2.0.158 # via sphinx59sphinxcontrib-jsmath==1.0.160 # via sphinx61sphinxcontrib-log-cabinet==1.0.161 # via -r docs.in62sphinxcontrib-qthelp==1.0.762 # via -r requirements/docs.in63sphinxcontrib-qthelp==1.0.364 # via sphinx64sphinxcontrib-serializinghtml==1.1.1065sphinxcontrib-serializinghtml==1.1.566 # via sphinx66urllib3==2.2.167urllib3==2.0.368 # via requests
modified:tests/test_testing.py+1 added-1 removed
319 unmodified lines
320 assert result_mix.output == "stdout\nstderr\n"321 assert result_mix.stdout == "stdout\nstderr\n"322323 with pytest.raises(ValueError):324 assert result_mix.stderr324 assert result_mix.stderr # noqa B018325326 @click.command()327 def cli_empty_stderr():328 click.echo("stdout")
92 unmodified lines
modified:.editorconfig+1 added-1 removed
7 unmodified lines
8end_of_line = lf9charset = utf-810max_line_length = 881112[*.{yml,yaml,json,js,css,html}]12[*.{css,html,js,json,jsx,scss,ts,tsx,yaml,yml}]13indent_size = 2
modified:.gitignore+9 added-10 removed
1/.idea/2/.vscode/1.idea/2.vscode/3.venv*/4venv*/5__pycache__/4/.tox/5/.coverage6/.coverage.*7/htmlcov/8/docs/_build/9/dist/10/venv*/11/.venv*/6dist/7.coverage*8htmlcov/9.tox/10docs/_build/
modified:.pre-commit-config.yaml+2 added-2 removed
1ci:2 autoupdate_schedule: monthly3repos:4 - repo: https://github.com/astral-sh/ruff-pre-commit5 rev: v0.3.45 rev: v0.4.16 hooks:7 - id: ruff8 - id: ruff-format9 - repo: https://github.com/pre-commit/pre-commit-hooks10 rev: v4.5.010 rev: v4.6.011 hooks:12 - id: check-merge-conflict13 - id: debug-statements14 - id: fix-byte-order-marker
2 unmodified lines
modified:.readthedocs.yaml+1 added-1 removed
1version: 22build:3 os: ubuntu-22.044 tools:5 python: "3.12"5 python: '3.12'6python:7 install:8 - requirements: requirements/docs.txt9 - method: pip
4 unmodified lines
deleted:CODE_OF_CONDUCT.md-76 removed
1# Contributor Covenant Code of Conduct23## Our Pledge45In the interest of fostering an open and welcoming environment, we as6contributors and maintainers pledge to making participation in our project and7our community a harassment-free experience for everyone, regardless of age, body8size, disability, ethnicity, sex characteristics, gender identity and expression,9level of experience, education, socio-economic status, nationality, personal10appearance, race, religion, or sexual identity and orientation.1112## Our Standards1314Examples of behavior that contributes to creating a positive environment15include:1617* Using welcoming and inclusive language18* Being respectful of differing viewpoints and experiences19* Gracefully accepting constructive criticism20* Focusing on what is best for the community21* Showing empathy towards other community members2223Examples of unacceptable behavior by participants include:2425* The use of sexualized language or imagery and unwelcome sexual attention or26 advances27* Trolling, insulting/derogatory comments, and personal or political attacks28* Public or private harassment29* Publishing others' private information, such as a physical or electronic30 address, without explicit permission31* Other conduct which could reasonably be considered inappropriate in a32 professional setting3334## Our Responsibilities3536Project maintainers are responsible for clarifying the standards of acceptable37behavior and are expected to take appropriate and fair corrective action in38response to any instances of unacceptable behavior.3940Project maintainers have the right and responsibility to remove, edit, or41reject comments, commits, code, wiki edits, issues, and other contributions42that are not aligned to this Code of Conduct, or to ban temporarily or43permanently any contributor for other behaviors that they deem inappropriate,44threatening, offensive, or harmful.4546## Scope4748This Code of Conduct applies both within project spaces and in public spaces49when an individual is representing the project or its community. Examples of50representing a project or community include using an official project e-mail51address, posting via an official social media account, or acting as an appointed52representative at an online or offline event. Representation of a project may be53further defined and clarified by project maintainers.5455## Enforcement5657Instances of abusive, harassing, or otherwise unacceptable behavior may be58reported by contacting the project team at report@palletsprojects.com. All59complaints will be reviewed and investigated and will result in a response that60is deemed necessary and appropriate to the circumstances. The project team is61obligated to maintain confidentiality with regard to the reporter of an incident.62Further details of specific enforcement policies may be posted separately.6364Project maintainers who do not follow or enforce the Code of Conduct in good65faith may face temporary or permanent repercussions as determined by other66members of the project's leadership.6768## Attribution6970This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,71available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html7273[homepage]: https://www.contributor-covenant.org7475For answers to common questions about this code of conduct, see76https://www.contributor-covenant.org/faq
deleted:LICENSE.rst-28 removed
1Copyright 2014 Pallets23Redistribution and use in source and binary forms, with or without4modification, are permitted provided that the following conditions are5met:671. Redistributions of source code must retain the above copyright8 notice, this list of conditions and the following disclaimer.9102. Redistributions in binary form must reproduce the above copyright11 notice, this list of conditions and the following disclaimer in the12 documentation and/or other materials provided with the distribution.13143. Neither the name of the copyright holder nor the names of its15 contributors may be used to endorse or promote products derived from16 this software without specific prior written permission.1718THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A21PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT22HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,23SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED24TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
added:LICENSE.txt+28 added
1Copyright 2014 Pallets23Redistribution and use in source and binary forms, with or without4modification, are permitted provided that the following conditions are5met:671. Redistributions of source code must retain the above copyright8 notice, this list of conditions and the following disclaimer.9102. Redistributions in binary form must reproduce the above copyright11 notice, this list of conditions and the following disclaimer in the12 documentation and/or other materials provided with the distribution.13143. Neither the name of the copyright holder nor the names of its15 contributors may be used to endorse or promote products derived from16 this software without specific prior written permission.1718THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A21PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT22HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,23SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED24TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
modified:pyproject.toml+13 added-10 removed
1[project]2name = "click"3version = "8.2.0.dev"4description = "Composable command line interface toolkit"5readme = "README.rst"6license = {file = "LICENSE.rst"}5readme = "README.md"6license = {file = "LICENSE.txt"}7maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}]8classifiers = [9 "Development Status :: 5 - Production/Stable",10 "Intended Audience :: Developers",11 "License :: OSI Approved :: BSD License",12 "Operating System :: OS Independent",13 "Programming Language :: Python",14 "Typing :: Typed",15]16requires-python = ">=3.8"17dependencies = [18 "colorama; platform_system == 'Windows'",
2 unmodified lines
21[project.urls]22Donate = "https://palletsprojects.com/donate"23Documentation = "https://click.palletsprojects.com/"24Changes = "https://click.palletsprojects.com/changes/"24"Source Code" = "https://github.com/pallets/click/"25"Issue Tracker" = "https://github.com/pallets/click/issues/"25Source = "https://github.com/pallets/click/"26Chat = "https://discord.gg/pallets"2728[build-system]29requires = ["flit_core<4"]
4 unmodified lines
3435[tool.flit.sdist]36include = [37 "docs/",38 "examples/",38 "requirements/",39 "tests/",40 "CHANGES.rst",41 "tox.ini",
3 unmodified lines
45]4647[tool.pytest.ini_options]48testpaths = ["tests"]50filterwarnings = ["error"]49filterwarnings = [50 "error",51]5253[tool.coverage.run]54branch = true55source = ["click", "tests"]
2 unmodified lines
58source = ["src", "*/site-packages"]5960[tool.mypy]61python_version = "3.8"61files = ["src/click"]62files = ["src/click", "tests/typing"]63show_error_codes = true64pretty = true65strict = true65local_partial_types = true66warn_unreachable = true6667[[tool.mypy.overrides]]68module = [69 "colorama.*",70]71ignore_missing_imports = true7273[tool.pyright]74pythonVersion = "3.8"75include = ["src/click", "tests/typing"]76typeCheckingMode = "basic"7778[tool.ruff]79extend-exclude = ["examples/"]80src = ["src"]81fix = true
5 unmodified lines
87 "B", # flake8-bugbear88 "E", # pycodestyle error89 "F", # pyflakes90 "I", # isort87 "RUF", # ruff-specific rules91 "UP", # pyupgrade92 "W", # pycodestyle warning93]94ignore-init-module-imports = true
4 unmodified lines
added:README.md+52 added
1# $ click_23Click is a Python package for creating beautiful command line interfaces4in a composable way with as little code as necessary. It's the "Command5Line Interface Creation Kit". It's highly configurable but comes with6sensible defaults out of the box.78It aims to make the process of writing command line tools quick and fun9while also preventing any frustration caused by the inability to10implement an intended CLI API.1112Click in three points:1314- Arbitrary nesting of commands15- Automatic help page generation16- Supports lazy loading of subcommands at runtime171819## A Simple Example2021```python22import click2324@click.command()25@click.option("--count", default=1, help="Number of greetings.")26@click.option("--name", prompt="Your name", help="The person to greet.")27def hello(count, name):28 """Simple program that greets NAME for a total of COUNT times."""29 for _ in range(count):30 click.echo(f"Hello, {name}!")3132if __name__ == '__main__':33 hello()34```3536```37$ python hello.py --count=338Your name: Click39Hello, Click!40Hello, Click!41Hello, Click!42```434445## Donate4647The Pallets organization develops and supports Click and other popular48packages. In order to grow the community of contributors and users, and49allow the maintainers to devote more time to the projects, [please50donate today][].5152[please donate today]: https://palletsprojects.com/donate
deleted:README.rst-78 removed
1\$ click\_2==========34Click is a Python package for creating beautiful command line interfaces5in a composable way with as little code as necessary. It's the "Command6Line Interface Creation Kit". It's highly configurable but comes with7sensible defaults out of the box.89It aims to make the process of writing command line tools quick and fun10while also preventing any frustration caused by the inability to11implement an intended CLI API.1213Click in three points:1415- Arbitrary nesting of commands16- Automatic help page generation17- Supports lazy loading of subcommands at runtime181920Installing21----------2223Install and update using `pip`_:2425.. code-block:: text2627 $ pip install -U click2829.. _pip: https://pip.pypa.io/en/stable/getting-started/303132A Simple Example33----------------3435.. code-block:: python3637 import click3839 @click.command()40 @click.option("--count", default=1, help="Number of greetings.")41 @click.option("--name", prompt="Your name", help="The person to greet.")42 def hello(count, name):43 """Simple program that greets NAME for a total of COUNT times."""44 for _ in range(count):45 click.echo(f"Hello, {name}!")4647 if __name__ == '__main__':48 hello()4950.. code-block:: text5152 $ python hello.py --count=353 Your name: Click54 Hello, Click!55 Hello, Click!56 Hello, Click!575859Donate60------6162The Pallets organization develops and supports Click and other popular63packages. In order to grow the community of contributors and users, and64allow the maintainers to devote more time to the projects, `please65donate today`_.6667.. _please donate today: https://palletsprojects.com/donate686970Links71-----7273- Documentation: https://click.palletsprojects.com/74- Changes: https://click.palletsprojects.com/changes/75- PyPI Releases: https://pypi.org/project/click/76- Source Code: https://github.com/pallets/click77- Issue Tracker: https://github.com/pallets/click/issues78- Chat: https://discord.gg/pallets
modified:tox.ini+4 added-2 removed
8 unmodified lines
910[testenv]11package = wheel12wheel_build_env = .pkg13constrain_package_deps = true14use_frozen_constraints = true15deps = -r requirements/tests.txt16commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}1718[testenv:style]
4 unmodified lines
23[testenv:typing]24deps = -r requirements/typing.txt25commands =26 mypy25 pyright --verifytypes click27 pyright tests/typing28 pyright --verifytypes click --ignoreexternal2930[testenv:docs]31deps = -r requirements/docs.txt30commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html32commands = sphinx-build -E -W -b dirhtml docs docs/_build/dirhtml3334[testenv:update-requirements]35deps =36 pip-tools
10 unmodified lines