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
Provenance
- Commit
73cfe12- Tree
9327d8b- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
f8857cb- Parent 2
525c5f1
25 files changed+276 added−424 removed
added:.devcontainer/devcontainer.json+17 added
1234567891011121314151617{ "name": "pallets/click", "image": "mcr.microsoft.com/devcontainers/python:3", "customizations": { "vscode": { "settings": { "python.defaultInterpreterPath": "${workspaceFolder}/.venv", "python.terminal.activateEnvInCurrentTerminal": true, "python.terminal.launchArgs": [ "-X", "dev" ] } } }, "onCreateCommand": ".devcontainer/on-create-command.sh"}added:.devcontainer/on-create-command.sh+7 added
1234567#!/bin/bashset -epython3 -m venv --upgrade-deps .venv. .venv/bin/activatepip install -r requirements/dev.txtpip install -e .pre-commit install --install-hooksmodified:.github/ISSUE_TEMPLATE/bug-report.md+1 added-1 removed
3 unmodified lines456788910111215 unmodified lines3 unmodified lines---
<!--This issue tracker is a tool to address bugs in Click itself. Please usePallets Discord or Stack Overflow for questions about your own code.GitHub Discussions or the Pallets Discord for questions about your own code.
Replace this comment with a clear outline of what the bug is.-->
15 unmodified linesmodified:.github/ISSUE_TEMPLATE/config.yml+5 added-8 removed
12345678934567118blank_issues_enabled: falsecontact_links: - name: Security issue url: security@palletsprojects.com about: Do not report security issues publicly. Email our security contact. - name: Questions url: https://stackoverflow.com/questions/tagged/python-click?tab=Frequent about: Search for and ask questions about your code on Stack Overflow. - name: Questions and discussions - name: Questions on Discussions url: https://github.com/pallets/click/discussions/ about: Ask questions about your own code on the Discussions tab. - name: Questions on Chat url: https://discord.gg/pallets about: Discuss questions about your code on our Discord chat. about: Ask questions about your own code on our Discord chat.modified:.github/ISSUE_TEMPLATE/feature-request.md+3 added-3 removed
3 unmodified lines456788910111213141314153 unmodified lines---
<!--Replace this comment with a description of what the feature should do.Include details such as links relevant specs or previous discussions.Include details such as links to relevant specs or previous discussions.-->
<!--Replace this comment with an example of the problem which this featurewould resolve. Is this problem solvable without changes to Click,such as by subclassing or using an extension?would resolve. Is this problem solvable without changes to Click, suchas by subclassing or using an extension?-->modified:.github/workflows/lock.yaml+6 added-5 removed
1123453456789104 unmodified lines15161718181920212223name: 'Lock inactive closed issues'name: Lock inactive closed issues# Lock closed issues that have not received any further activity for two weeks.# This does not close open issues, only humans may do that. We find that it is# easier to respond to new issues with fresh examples rather than continuing# discussions on old issues.# This does not close open issues, only humans may do that. It is easier to# respond to new issues with fresh examples rather than continuing discussions# on old issues.
on: schedule: - cron: '0 0 * * *'permissions:4 unmodified linesjobs: lock: runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@7de207be1d3ce97a9abe6ff1306222982d1ca9f9 # v5.0.1 - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1 with: issue-inactive-days: 14 pr-inactive-days: 14 discussion-inactive-days: 14modified:.github/workflows/publish.yaml+12 added-15 removed
7 unmodified lines891011121312131415161717181920212223242526262728293031323334353636373839402 unmodified lines4344454647484950474849505110 unmodified lines6263646569666768717273746970767172737 unmodified lines runs-on: ubuntu-latest outputs: hash: ${{ steps.hash.outputs.hash }} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: python-version: '3.x' cache: pip cache-dependency-path: requirements/*.txt cache-dependency-path: requirements*/*.txt - run: pip install -r requirements/build.txt # Use the commit date instead of the current date during the build. - 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 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@1fee7c6fdaf1b8532bd4cad778556e42ac27affa # main with new upload/download uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0 with: base64-subjects: ${{ needs.build.outputs.hash }} create-release: # Upload the sdist, wheels, and provenance to a GitHub release. They remain2 unmodified lines runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: pattern: '*' merge-multiple: true - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - name: create release run: > gh release create --draft --repo ${{ github.repository }} ${{ github.ref_name }}10 unmodified lines runs-on: ubuntu-latest permissions: id-token: write steps: - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14 with: pattern: '*' merge-multiple: true - uses: pypa/gh-action-pypi-publish@68e62d4871ad9d14a9d55f114e6ac71f0b408ec0 # v1.8.14 with: repository-url: https://test.pypi.org/legacy/ packages-dir: artifact/ - uses: pypa/gh-action-pypi-publish@68e62d4871ad9d14a9d55f114e6ac71f0b408ec0 # v1.8.14 - uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14 with: packages-dir: artifact/modified:.github/workflows/tests.yaml+30 added-22 removed
13 unmodified lines14 - '*.md'15 - '*.rst'16 jobs: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 typingmodified:.github/pull_request_template.md+10 added-15 removed
1 <!--2 Before opening a PR, open a ticket describing the issue or feature the3-PR will address. Follow the steps in CONTRIBUTING.rst.3+PR will address. An issue is not required for fixing typos in4+documentation, or other simple non-code changes.5 6 Replace this comment with a description of the change. Describe how it7 addresses the linked ticket.8 -->9 10 <!--11 Link to relevant issues or previous PRs, one per line. Use "fixes" to12 automatically close an issue.13+14+fixes #<issue number>15 -->16 14-- fixes #<issue number>15-17 <!--17-Ensure each step in CONTRIBUTING.rst is complete by adding an "x" to18-each box below.18+Ensure each step in CONTRIBUTING.rst is complete, especially the following:19 20-If 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 -->22-23-Checklist:24-25-- [ ] 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 lines9 release, version = get_version("Click")10 11 # General --------------------------------------------------------------12 13-master_doc = "index"13+default_role = "code"14 extensions = [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 ]22+autodoc_member_order = "bysource"23 autodoc_typehints = "description"23-intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}24-issues_github_path = "pallets/click"24+autodoc_preserve_defaults = True25+extlinks = {26+ "issue": ("https://github.com/pallets/flask/issues/%s", "#%s"),27+ "pr": ("https://github.com/pallets/flask/pull/%s", "#%s"),28+}29+intersphinx_mapping = {30+ "python": ("https://docs.python.org/3/", None),31+}32 33 # HTML -----------------------------------------------------------------34 35 html_theme = "click"16 unmodified lines52 html_favicon = "_static/click-icon.png"53 html_logo = "_static/click-logo-sidebar.png"54 html_title = f"Click Documentation ({version})"55 html_show_sourcelink = False49-50-# LaTeX ----------------------------------------------------------------51-52-latex_documents = [(master_doc, f"Click-{version}.tex", html_title, author, "manual")]modified:docs/license.rst+2 added-1 removed
1 BSD-3-Clause License2 ====================3 4-.. include:: ../LICENSE.rst4+.. literalinclude:: ../LICENSE.txt5+ :language: textmodified: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 #7-alabaster==0.7.168- # via sphinx9-babel==2.14.010- # via sphinx11-build==1.1.18+-r docs.txt9+-r tests.txt10+-r typing.txt11+build==0.10.012 # via pip-tools13-cachetools==5.3.313+cachetools==5.3.114 # via tox15-certifi==2024.2.216- # via requests17-cfgv==3.4.015+cfgv==3.3.116 # via pre-commit19-chardet==5.2.017+chardet==5.1.018 # via tox21-charset-normalizer==3.3.222- # via requests23-click==8.1.724- # via pip-tools19+click==8.1.320+ # via21+ # pip-compile-multi22+ # pip-tools23 colorama==0.4.624 # via tox27-distlib==0.3.825+distlib==0.3.626 # via virtualenv29-docutils==0.20.127+filelock==3.12.228 # via31- # sphinx32- # sphinx-tabs33-filelock==3.13.134- # via29 # tox30 # virtualenv37-identify==2.5.3531+identify==2.5.2432 # via pre-commit39-idna==3.640- # via requests41-imagesize==1.4.142- # via sphinx43-iniconfig==2.0.044- # via pytest45-jinja2==3.1.346- # via sphinx47-markupsafe==2.1.548- # via jinja249-mypy==1.9.050- # via -r typing.in51-mypy-extensions==1.0.052- # via mypy53-nodeenv==1.8.033+pip-compile-multi==2.6.334+ # via -r requirements/dev.in35+pip-tools==6.13.036+ # via pip-compile-multi37+platformdirs==3.8.038 # via55- # pre-commit56- # pyright57-packaging==24.058- # via59- # build60- # pallets-sphinx-themes61- # pyproject-api62- # pytest63- # sphinx39 # tox65-pallets-sphinx-themes==2.1.166- # via -r docs.in67-pip-tools==7.4.168- # via -r dev.in69-platformdirs==4.2.070- # via71- # tox40 # virtualenv73-pluggy==1.4.074- # via75- # pytest76- # tox77-pre-commit==3.6.278- # via -r dev.in79-pygments==2.17.280- # via81- # sphinx82- # sphinx-tabs83-pyproject-api==1.6.141+pre-commit==3.3.342+ # via -r requirements/dev.in43+pyproject-api==1.5.244 # via tox45 pyproject-hooks==1.0.086- # via87- # build88- # pip-tools89-pyright==1.1.35590- # via -r typing.in91-pytest==8.1.192- # via -r tests.in46+ # via build47 pyyaml==6.0.148 # via pre-commit95-requests==2.31.096- # via sphinx97-snowballstemmer==2.2.098- # via sphinx99-sphinx==7.2.649+toposort==1.1050+ # via pip-compile-multi51+tox==4.6.352+ # via -r requirements/dev.in53+virtualenv==20.23.154 # via101- # -r docs.in102- # pallets-sphinx-themes103- # sphinx-issues104- # sphinx-tabs105- # sphinxcontrib-log-cabinet106-sphinx-issues==4.0.0107- # via -r docs.in108-sphinx-tabs==3.4.5109- # via -r docs.in110-sphinxcontrib-applehelp==1.0.8111- # via sphinx112-sphinxcontrib-devhelp==1.0.6113- # via sphinx114-sphinxcontrib-htmlhelp==2.0.5115- # via sphinx116-sphinxcontrib-jsmath==1.0.1117- # via sphinx118-sphinxcontrib-log-cabinet==1.0.1119- # via -r docs.in120-sphinxcontrib-qthelp==1.0.7121- # via sphinx122-sphinxcontrib-serializinghtml==1.1.10123- # via sphinx124-tox==4.14.2125- # via -r dev.in126-typing-extensions==4.10.0127- # via mypy128-urllib3==2.2.1129- # via requests130-virtualenv==20.25.1131- # via55 # pre-commit56 # tox134-wheel==0.43.057+wheel==0.40.058 # via pip-tools59 60 # The following packages are considered to be unsafe in a requirements file:61 # pip1 unmodified linemodified: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 #7-alabaster==0.7.168+alabaster==0.7.139 # via sphinx9-babel==2.14.010+babel==2.12.111 # via sphinx11-certifi==2024.2.212+certifi==2023.5.713 # via requests13-charset-normalizer==3.3.214+charset-normalizer==3.1.015 # via requests15-docutils==0.20.116+docutils==0.18.117 # via18 # sphinx19 # sphinx-tabs19-idna==3.620+idna==3.421 # via requests22 imagesize==1.4.123 # via sphinx23-jinja2==3.1.324+jinja2==3.1.225 # via sphinx25-markupsafe==2.1.526+markupsafe==2.1.327 # via jinja227-packaging==24.028+packaging==23.129 # via30 # pallets-sphinx-themes31 # sphinx32 pallets-sphinx-themes==2.1.132- # via -r docs.in33-pygments==2.17.233+ # via -r requirements/docs.in34+pygments==2.15.135 # via36 # sphinx37 # sphinx-tabs38 requests==2.31.039 # via sphinx40 snowballstemmer==2.2.041 # via sphinx41-sphinx==7.2.642+sphinx==7.0.143 # via43- # -r docs.in44+ # -r requirements/docs.in45 # pallets-sphinx-themes46 # sphinx-issues47 # sphinx-tabs48 # sphinxcontrib-log-cabinet48-sphinx-issues==4.0.049- # via -r docs.in49+sphinx-issues==3.0.150+ # via -r requirements/docs.in51 sphinx-tabs==3.4.551- # via -r docs.in52-sphinxcontrib-applehelp==1.0.852+ # via -r requirements/docs.in53+sphinxcontrib-applehelp==1.0.454 # via sphinx54-sphinxcontrib-devhelp==1.0.655+sphinxcontrib-devhelp==1.0.256 # via sphinx56-sphinxcontrib-htmlhelp==2.0.557+sphinxcontrib-htmlhelp==2.0.158 # via sphinx59 sphinxcontrib-jsmath==1.0.160 # via sphinx61 sphinxcontrib-log-cabinet==1.0.161- # via -r docs.in62-sphinxcontrib-qthelp==1.0.762+ # via -r requirements/docs.in63+sphinxcontrib-qthelp==1.0.364 # via sphinx64-sphinxcontrib-serializinghtml==1.1.1065+sphinxcontrib-serializinghtml==1.1.566 # via sphinx66-urllib3==2.2.167+urllib3==2.0.368 # via requestsmodified:tests/test_testing.py+1 added-1 removed
319 unmodified lines320 assert result_mix.output == "stdout\nstderr\n"321 assert result_mix.stdout == "stdout\nstderr\n"322 323 with pytest.raises(ValueError):324- assert result_mix.stderr324+ assert result_mix.stderr # noqa B018325 326 @click.command()327 def cli_empty_stderr():328 click.echo("stdout")92 unmodified linesmodified:.editorconfig+1 added-1 removed
7 unmodified lines8 end_of_line = lf9 charset = utf-810 max_line_length = 8811 12-[*.{yml,yaml,json,js,css,html}]12+[*.{css,html,js,json,jsx,scss,ts,tsx,yaml,yml}]13 indent_size = 2modified:.gitignore+9 added-10 removed
1-/.idea/2-/.vscode/1+.idea/2+.vscode/3+.venv*/4+venv*/5 __pycache__/4-/.tox/5-/.coverage6-/.coverage.*7-/htmlcov/8-/docs/_build/9-/dist/10-/venv*/11-/.venv*/6+dist/7+.coverage*8+htmlcov/9+.tox/10+docs/_build/modified:.pre-commit-config.yaml+2 added-2 removed
1 ci:2 autoupdate_schedule: monthly3 repos: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-marker2 unmodified linesmodified:.readthedocs.yaml+1 added-1 removed
1 version: 22 build:3 os: ubuntu-22.044 tools:5- python: "3.12"5+ python: '3.12'6 python:7 install:8 - requirements: requirements/docs.txt9 - method: pip4 unmodified linesdeleted:CODE_OF_CONDUCT.md-76 removed
1-# Contributor Covenant Code of Conduct2-3-## Our Pledge4-5-In the interest of fostering an open and welcoming environment, we as6-contributors and maintainers pledge to making participation in our project and7-our community a harassment-free experience for everyone, regardless of age, body8-size, disability, ethnicity, sex characteristics, gender identity and expression,9-level of experience, education, socio-economic status, nationality, personal10-appearance, race, religion, or sexual identity and orientation.11-12-## Our Standards13-14-Examples of behavior that contributes to creating a positive environment15-include:16-17-* 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 members22-23-Examples of unacceptable behavior by participants include:24-25-* 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 setting33-34-## Our Responsibilities35-36-Project maintainers are responsible for clarifying the standards of acceptable37-behavior and are expected to take appropriate and fair corrective action in38-response to any instances of unacceptable behavior.39-40-Project maintainers have the right and responsibility to remove, edit, or41-reject comments, commits, code, wiki edits, issues, and other contributions42-that are not aligned to this Code of Conduct, or to ban temporarily or43-permanently any contributor for other behaviors that they deem inappropriate,44-threatening, offensive, or harmful.45-46-## Scope47-48-This Code of Conduct applies both within project spaces and in public spaces49-when an individual is representing the project or its community. Examples of50-representing a project or community include using an official project e-mail51-address, posting via an official social media account, or acting as an appointed52-representative at an online or offline event. Representation of a project may be53-further defined and clarified by project maintainers.54-55-## Enforcement56-57-Instances of abusive, harassing, or otherwise unacceptable behavior may be58-reported by contacting the project team at report@palletsprojects.com. All59-complaints will be reviewed and investigated and will result in a response that60-is deemed necessary and appropriate to the circumstances. The project team is61-obligated to maintain confidentiality with regard to the reporter of an incident.62-Further details of specific enforcement policies may be posted separately.63-64-Project maintainers who do not follow or enforce the Code of Conduct in good65-faith may face temporary or permanent repercussions as determined by other66-members of the project's leadership.67-68-## Attribution69-70-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,71-available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html72-73-[homepage]: https://www.contributor-covenant.org74-75-For answers to common questions about this code of conduct, see76-https://www.contributor-covenant.org/faqdeleted:LICENSE.rst-28 removed
1-Copyright 2014 Pallets2-3-Redistribution and use in source and binary forms, with or without4-modification, are permitted provided that the following conditions are5-met:6-7-1. Redistributions of source code must retain the above copyright8- notice, this list of conditions and the following disclaimer.9-10-2. 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.13-14-3. 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.17-18-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A21-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT22-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,23-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED24-TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.added:LICENSE.txt+28 added
1+Copyright 2014 Pallets2+3+Redistribution and use in source and binary forms, with or without4+modification, are permitted provided that the following conditions are5+met:6+7+1. Redistributions of source code must retain the above copyright8+ notice, this list of conditions and the following disclaimer.9+10+2. 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.13+14+3. 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.17+18+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A21+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT22+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,23+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED24+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.modified:pyproject.toml+13 added-10 removed
1 [project]2 name = "click"3 version = "8.2.0.dev"4 description = "Composable command line interface toolkit"5-readme = "README.rst"6-license = {file = "LICENSE.rst"}5+readme = "README.md"6+license = {file = "LICENSE.txt"}7 maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}]8 classifiers = [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 ]16 requires-python = ">=3.8"17 dependencies = [18 "colorama; platform_system == 'Windows'",2 unmodified lines21 [project.urls]22 Donate = "https://palletsprojects.com/donate"23 Documentation = "https://click.palletsprojects.com/"24 Changes = "https://click.palletsprojects.com/changes/"24-"Source Code" = "https://github.com/pallets/click/"25-"Issue Tracker" = "https://github.com/pallets/click/issues/"25+Source = "https://github.com/pallets/click/"26 Chat = "https://discord.gg/pallets"27 28 [build-system]29 requires = ["flit_core<4"]4 unmodified lines34 35 [tool.flit.sdist]36 include = [37 "docs/",38- "examples/",38 "requirements/",39 "tests/",40 "CHANGES.rst",41 "tox.ini",3 unmodified lines45 ]46 47 [tool.pytest.ini_options]48 testpaths = ["tests"]50-filterwarnings = ["error"]49+filterwarnings = [50+ "error",51+]52 53 [tool.coverage.run]54 branch = true55 source = ["click", "tests"]2 unmodified lines58 source = ["src", "*/site-packages"]59 60 [tool.mypy]61 python_version = "3.8"61-files = ["src/click"]62+files = ["src/click", "tests/typing"]63 show_error_codes = true64 pretty = true65 strict = true65-local_partial_types = true66-warn_unreachable = true66 67 [[tool.mypy.overrides]]68 module = [69 "colorama.*",70 ]71 ignore_missing_imports = true72 73+[tool.pyright]74+pythonVersion = "3.8"75+include = ["src/click", "tests/typing"]76+typeCheckingMode = "basic"77+78 [tool.ruff]79 extend-exclude = ["examples/"]80 src = ["src"]81 fix = true5 unmodified lines87 "B", # flake8-bugbear88 "E", # pycodestyle error89 "F", # pyflakes90 "I", # isort87- "RUF", # ruff-specific rules91 "UP", # pyupgrade92 "W", # pycodestyle warning93 ]94 ignore-init-module-imports = true4 unmodified linesadded:README.md+52 added
1+# $ click_2+3+Click is a Python package for creating beautiful command line interfaces4+in a composable way with as little code as necessary. It's the "Command5+Line Interface Creation Kit". It's highly configurable but comes with6+sensible defaults out of the box.7+8+It aims to make the process of writing command line tools quick and fun9+while also preventing any frustration caused by the inability to10+implement an intended CLI API.11+12+Click in three points:13+14+- Arbitrary nesting of commands15+- Automatic help page generation16+- Supports lazy loading of subcommands at runtime17+18+19+## A Simple Example20+21+```python22+import click23+24+@click.command()25+@click.option("--count", default=1, help="Number of greetings.")26+@click.option("--name", prompt="Your name", help="The person to greet.")27+def 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}!")31+32+if __name__ == '__main__':33+ hello()34+```35+36+```37+$ python hello.py --count=338+Your name: Click39+Hello, Click!40+Hello, Click!41+Hello, Click!42+```43+44+45+## Donate46+47+The Pallets organization develops and supports Click and other popular48+packages. In order to grow the community of contributors and users, and49+allow the maintainers to devote more time to the projects, [please50+donate today][].51+52+[please donate today]: https://palletsprojects.com/donatedeleted:README.rst-78 removed
1-\$ click\_2-==========3-4-Click is a Python package for creating beautiful command line interfaces5-in a composable way with as little code as necessary. It's the "Command6-Line Interface Creation Kit". It's highly configurable but comes with7-sensible defaults out of the box.8-9-It aims to make the process of writing command line tools quick and fun10-while also preventing any frustration caused by the inability to11-implement an intended CLI API.12-13-Click in three points:14-15-- Arbitrary nesting of commands16-- Automatic help page generation17-- Supports lazy loading of subcommands at runtime18-19-20-Installing21-----------22-23-Install and update using `pip`_:24-25-.. code-block:: text26-27- $ pip install -U click28-29-.. _pip: https://pip.pypa.io/en/stable/getting-started/30-31-32-A Simple Example33-----------------34-35-.. code-block:: python36-37- import click38-39- @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}!")46-47- if __name__ == '__main__':48- hello()49-50-.. code-block:: text51-52- $ python hello.py --count=353- Your name: Click54- Hello, Click!55- Hello, Click!56- Hello, Click!57-58-59-Donate60-------61-62-The Pallets organization develops and supports Click and other popular63-packages. In order to grow the community of contributors and users, and64-allow the maintainers to devote more time to the projects, `please65-donate today`_.66-67-.. _please donate today: https://palletsprojects.com/donate68-69-70-Links71------72-73-- 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/palletsmodified:tox.ini+4 added-2 removed
8 unmodified lines9 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]4 unmodified lines23 [testenv:typing]24 deps = -r requirements/typing.txt25 commands =26 mypy25- pyright --verifytypes click27 pyright tests/typing28+ pyright --verifytypes click --ignoreexternal29 30 [testenv:docs]31 deps = -r requirements/docs.txt30-commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html32+commands = sphinx-build -E -W -b dirhtml docs docs/_build/dirhtml33 34 [testenv:update-requirements]35 deps =36 pip-tools10 unmodified lines