update project files
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* update pre-commit hooks * add devcontainer * show url in publish environment * update actions versions * separate typing job * use dependabot grouped updates * use sphinx.ext.extlinks instead of sphinx-issues * update .editorconfig * update .gitignore * update .readthedocs.yaml * license is txt, readme is md * use pyproject.toml and flit_core instead of setuptools add typed classifier add pyright config simplify urls * tox builds docs in place * add tox env to update all dev dependencies * update issue and pr templates * simplify matrix
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
50 files+406 added−518 removed
- tests:+10 added−7 removed
- other:+396 added−511 removed
Provenance
- Commit
525c5f1- Tree
274786f- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
76cb841
50 files changed+406 added−518 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+7 added-9 removed
12345123456789101011121413141715161718221920212223name: 'Lock threads'# 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.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. It is easier to# respond to new issues with fresh examples rather than continuing discussions# on old issues.
on: schedule: - cron: '0 0 * * *'
permissions: issues: write pull-requests: write
concurrency: group: lock
jobs: lock: runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@c1b35aecc5cdb1a34539d14196df55838bb2f836 - 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+16 added-15 removed
7 unmodified lines89101112131213141516171617181920212223242526262728293030313233343536363738394041424243444546474748495051525354555656575859596061626364656465666667686970707172737 unmodified lines runs-on: ubuntu-latest outputs: hash: ${{ steps.hash.outputs.hash }} steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 - 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: 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. - 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@0b7f8abb1508181956e8e162db84b466c27e18ce - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: path: ./dist provenance: needs: ['build'] 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@v1.7.0 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 remain # available as build artifacts for a while as well. needs: ['provenance'] needs: [provenance] runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - name: create release run: > gh release create --draft --repo ${{ github.repository }} ${{ github.ref_name }} *.intoto.jsonl/* artifact/* env: GH_TOKEN: ${{ github.token }} publish-pypi: needs: ['provenance'] needs: [provenance] # Wait for approval before attempting to upload to PyPI. This allows reviewing the # files in the draft release. environment: 'publish' 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@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # Try uploading to Test PyPI first, in case something fails. - uses: pypa/gh-action-pypi-publish@29930c9cf57955dc1b98162d0d8bc3ec80d9e75c - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14 with: repository-url: https://test.pypi.org/legacy/ packages-dir: artifact/ - uses: pypa/gh-action-pypi-publish@29930c9cf57955dc1b98162d0d8bc3ec80d9e75c - uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14 with: packages-dir: artifact/modified:.github/workflows/tests.yaml+32 added-28 removed
7 unmodified lines8 - 'docs/**'9 - '*.md'10 - '*.rst'11 pull_request:12- branches:13- - main14- - '*.x'12 paths-ignore:13 - 'docs/**'14 - '*.md'15 - '*.rst'16 jobs:17 tests:21- name: ${{ matrix.name }}22- 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:27- - {name: Linux, python: '3.11', os: ubuntu-latest, tox: py311}28- - {name: Windows, python: '3.11', os: windows-latest, tox: py311}29- - {name: Mac, python: '3.11', os: macos-latest, tox: py311}30- - {name: '3.12-dev', python: '3.12-dev', os: ubuntu-latest, tox: py312}31- - {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}32- - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}33- - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}34- - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}35- - {name: 'PyPy', python: 'pypy-3.10', os: ubuntu-latest, tox: pypy310}36- - {name: Typing, python: '3.11', 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:38- - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c39- - uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a91236+ - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.237+ - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.038 with:39 python-version: ${{ matrix.python }}42- cache: 'pip'43- cache-dependency-path: 'requirements/*.txt'44- - name: update pip45- run: |46- pip install -U wheel47- pip install -U setuptools48- python -m pip install -U pip40+ allow-prereleases: true41+ cache: 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 mypy50- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a1255+ uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.256 with:57 path: ./.mypy_cache53- key: mypy|${{ matrix.python }}|${{ hashFiles('setup.cfg') }}54- if: matrix.tox == 'typing'58+ key: mypy|${{ hashFiles('pyproject.toml') }}59 - run: pip install tox56- - run: tox run -e ${{ matrix.tox }}60+ - run: tox run -e typingmodified:.github/dependabot.yml+16 added-7 removed
1 version: 22 updates:3-- package-ecosystem: "github-actions"4- directory: "/"5- schedule:6- interval: "monthly"7- day: "monday"8- time: "16:00"9- timezone: "UTC"3+ - package-ecosystem: github-actions4+ directory: /5+ schedule:6+ interval: monthly7+ groups:8+ github-actions:9+ patterns:10+ - '*'11+ - package-ecosystem: pip12+ directory: /requirements/13+ schedule:14+ interval: monthly15+ groups:16+ python-requirements:17+ patterns:18+ - '*'modified:.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+1 added-1 removed
42 unmodified lines43 pyproject-api==1.5.244 # via tox45 pyproject-hooks==1.0.046 # via build47-pyyaml==6.047+pyyaml==6.0.148 # via pre-commit49 toposort==1.1050 # via pip-compile-multi51 tox==4.6.311 unmodified linesmodified:requirements/docs.txt+1 added-1 removed
46 unmodified lines47 # sphinx-tabs48 # sphinxcontrib-log-cabinet49 sphinx-issues==3.0.150 # via -r requirements/docs.in51-sphinx-tabs==3.4.151+sphinx-tabs==3.4.552 # via -r requirements/docs.in53 sphinxcontrib-applehelp==1.0.454 # via sphinx55 sphinxcontrib-devhelp==1.0.213 unmodified linesmodified:src/click/__init__.py+1 added
2 unmodified lines3 writing command line scripts fun. Unlike other modules, it's based4 around a simple API that does not come with too much magic and is5 composable.6 """7+8 from .core import Argument as Argument9 from .core import BaseCommand as BaseCommand10 from .core import Command as Command11 from .core import CommandCollection as CommandCollection63 unmodified linesmodified:src/click/_compat.py+1 added-1 removed
514 unmodified lines515 return locale.getpreferredencoding()516 517 _ansi_stream_wrappers: t.MutableMapping[t.TextIO, t.TextIO] = WeakKeyDictionary()518 519- def auto_wrap_for_ansi( # noqa: F811519+ def auto_wrap_for_ansi(520 stream: t.TextIO, color: t.Optional[bool] = None521 ) -> t.TextIO:522 """Support ANSI color and style codes on Windows by wrapping a523 stream with colorama.100 unmodified linesmodified:src/click/_termui_impl.py+2 added-1 removed
1 unmodified line2 This module contains implementations for the termui module. To keep the3 import time of Click down, some infrequently used functionality is4 placed in this module and only imported as needed.5 """6+7 import contextlib8 import math9 import os10 import sys687 unmodified lines698 _translate_ch_to_exc(rv)699 return rv700 701 else:701- import tty702 import termios703+ import tty704 705 @contextlib.contextmanager706 def raw_terminal() -> t.Iterator[int]:707 f: t.Optional[t.TextIO]33 unmodified linesmodified:src/click/core.py+26 added-38 removed
37 unmodified lines38 from .utils import PacifyFlushWrapper39 40 if t.TYPE_CHECKING:41 import typing_extensions as te42+43 from .shell_completion import CompletionItem44 45 F = t.TypeVar("F", bound=t.Callable[..., t.Any])46 V = t.TypeVar("V")336 unmodified lines383 token_normalize_func = parent.token_normalize_func384 385 #: An optional normalization function for tokens. This is386 #: options, choices, commands etc.386- self.token_normalize_func: t.Optional[387- t.Callable[[str], str]388- ] = token_normalize_func387+ self.token_normalize_func: t.Optional[t.Callable[[str], str]] = (388+ token_normalize_func389+ )390 391 #: Indicates if resilient parsing is enabled. In that case Click392 #: will do its best to not cause any failures and default values393 #: will be ignored. Useful for completion.252 unmodified lines646 647 @t.overload648 def lookup_default(649 self, name: str, call: "te.Literal[True]" = True649- ) -> t.Optional[t.Any]:650- ...650+ ) -> t.Optional[t.Any]: ...651 652 @t.overload653 def lookup_default(654 self, name: str, call: "te.Literal[False]" = ...655- ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:656- ...655+ ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]: ...656 657 def lookup_default(self, name: str, call: bool = True) -> t.Optional[t.Any]:658 """Get the default for a parameter from :attr:`default_map`.659 51 unmodified lines711 return type(self)(command, info_name=command.name, parent=self)712 713 @t.overload714 def invoke(716- __self, # noqa: B902715+ __self,716 __callback: "t.Callable[..., V]",717 *args: t.Any,718 **kwargs: t.Any,720- ) -> V:721- ...719+ ) -> V: ...720 721 @t.overload722 def invoke(725- __self, # noqa: B902723+ __self,724 __callback: "Command",725 *args: t.Any,726 **kwargs: t.Any,729- ) -> t.Any:730- ...727+ ) -> t.Any: ...728 729 def invoke(733- __self, # noqa: B902730+ __self,731 __callback: t.Union["Command", "t.Callable[..., V]"],732 *args: t.Any,733 **kwargs: t.Any,734 ) -> t.Union[t.Any, V]:43 unmodified lines778 with augment_usage_errors(__self):779 with ctx:780 return __callback(*args, **kwargs)781 785- def forward(786- __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any # noqa: B902787- ) -> t.Any:782+ def forward(__self, __cmd: "Command", *args: t.Any, **kwargs: t.Any) -> t.Any:783 """Similar to :meth:`invoke` but fills in default keyword784 arguments from the current context if the other command expects785 it. This cannot invoke callbacks directly, only other commands.786 143 unmodified lines930 if key not in extra:931 extra[key] = value932 933 ctx = self.context_class(939- self, info_name=info_name, parent=parent, **extra # type: ignore934+ self, # type: ignore[arg-type]935+ info_name=info_name,936+ parent=parent,937+ **extra,938 )939 940 with ctx.scope(cleanup=False):941 self.parse_args(ctx, args)48 unmodified lines990 prog_name: t.Optional[str] = None,991 complete_var: t.Optional[str] = None,992 standalone_mode: "te.Literal[True]" = True,993 **extra: t.Any,996- ) -> "te.NoReturn":997- ...994+ ) -> "te.NoReturn": ...995 996 @t.overload997 def main(998 self,1 unmodified line1000 prog_name: t.Optional[str] = None,1001 complete_var: t.Optional[str] = None,1002 standalone_mode: bool = ...,1003 **extra: t.Any,1007- ) -> t.Any:1008- ...1004+ ) -> t.Any: ...1005 1006 def main(1007 self,1008 args: t.Optional[t.Sequence[str]] = None,829 unmodified lines1838 _check_multicommand(self, name, cmd, register=True)1839 self.commands[name] = cmd1840 1841 @t.overload1846- def command(self, __func: t.Callable[..., t.Any]) -> Command:1847- ...1842+ def command(self, __func: t.Callable[..., t.Any]) -> Command: ...1843 1844 @t.overload1845 def command(1846 self, *args: t.Any, **kwargs: t.Any1852- ) -> t.Callable[[t.Callable[..., t.Any]], Command]:1853- ...1847+ ) -> t.Callable[[t.Callable[..., t.Any]], Command]: ...1848 1849 def command(1850 self, *args: t.Any, **kwargs: t.Any1851 ) -> t.Union[t.Callable[[t.Callable[..., t.Any]], Command], Command]:35 unmodified lines1887 1888 return decorator1889 1890 @t.overload1897- def group(self, __func: t.Callable[..., t.Any]) -> "Group":1898- ...1891+ def group(self, __func: t.Callable[..., t.Any]) -> "Group": ...1892 1893 @t.overload1894 def group(1895 self, *args: t.Any, **kwargs: t.Any1903- ) -> t.Callable[[t.Callable[..., t.Any]], "Group"]:1904- ...1896+ ) -> t.Callable[[t.Callable[..., t.Any]], "Group"]: ...1897 1898 def group(1899 self, *args: t.Any, **kwargs: t.Any1900 ) -> t.Union[t.Callable[[t.Callable[..., t.Any]], "Group"], "Group"]:317 unmodified lines2218 2219 @t.overload2220 def get_default(2221 self, ctx: Context, call: "te.Literal[True]" = True2230- ) -> t.Optional[t.Any]:2231- ...2222+ ) -> t.Optional[t.Any]: ...2223 2224 @t.overload2225 def get_default(2226 self, ctx: Context, call: bool = ...2236- ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:2237- ...2227+ ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]: ...2228 2229 def get_default(2230 self, ctx: Context, call: bool = True2231 ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:599 unmodified lines2831 2832 @t.overload2833 def get_default(2834 self, ctx: Context, call: "te.Literal[True]" = True2845- ) -> t.Optional[t.Any]:2846- ...2835+ ) -> t.Optional[t.Any]: ...2836 2837 @t.overload2838 def get_default(2839 self, ctx: Context, call: bool = ...2851- ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:2852- ...2840+ ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]: ...2841 2842 def get_default(2843 self, ctx: Context, call: bool = True2844 ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:186 unmodified linesmodified:src/click/decorators.py+9 added-17 removed
132 unmodified lines133 134 135 # variant: no call, directly as decorator for a function.136 @t.overload137-def command(name: _AnyCallable) -> Command:138- ...137+def command(name: _AnyCallable) -> Command: ...138 139 140 # variant: with positional name and with positional or keyword cls argument:141 # @command(namearg, CommandCls, ...) or @command(namearg, cls=CommandCls, ...)1 unmodified line143 def command(144 name: t.Optional[str],145 cls: t.Type[CmdType],146 **attrs: t.Any,148-) -> t.Callable[[_AnyCallable], CmdType]:149- ...147+) -> t.Callable[[_AnyCallable], CmdType]: ...148 149 150 # variant: name omitted, cls _must_ be a keyword argument, @command(cls=CommandCls, ...)151 @t.overload1 unmodified line153 name: None = None,154 *,155 cls: t.Type[CmdType],156 **attrs: t.Any,159-) -> t.Callable[[_AnyCallable], CmdType]:160- ...157+) -> t.Callable[[_AnyCallable], CmdType]: ...158 159 160 # variant: with optional string name, no cls argument provided.161 @t.overload162 def command(163 name: t.Optional[str] = ..., cls: None = None, **attrs: t.Any167-) -> t.Callable[[_AnyCallable], Command]:168- ...164+) -> t.Callable[[_AnyCallable], Command]: ...165 166 167 def command(168 name: t.Union[t.Optional[str], _AnyCallable] = None,81 unmodified lines250 251 252 # variant: no call, directly as decorator for a function.253 @t.overload258-def group(name: _AnyCallable) -> Group:259- ...254+def group(name: _AnyCallable) -> Group: ...255 256 257 # variant: with positional name and with positional or keyword cls argument:258 # @group(namearg, GroupCls, ...) or @group(namearg, cls=GroupCls, ...)1 unmodified line260 def group(261 name: t.Optional[str],262 cls: t.Type[GrpType],263 **attrs: t.Any,269-) -> t.Callable[[_AnyCallable], GrpType]:270- ...264+) -> t.Callable[[_AnyCallable], GrpType]: ...265 266 267 # variant: name omitted, cls _must_ be a keyword argument, @group(cmd=GroupCls, ...)268 @t.overload1 unmodified line270 name: None = None,271 *,272 cls: t.Type[GrpType],273 **attrs: t.Any,280-) -> t.Callable[[_AnyCallable], GrpType]:281- ...274+) -> t.Callable[[_AnyCallable], GrpType]: ...275 276 277 # variant: with optional string name, no cls argument provided.278 @t.overload279 def group(280 name: t.Optional[str] = ..., cls: None = None, **attrs: t.Any288-) -> t.Callable[[_AnyCallable], Group]:289- ...281+) -> t.Callable[[_AnyCallable], Group]: ...282 283 284 def group(285 name: t.Union[str, _AnyCallable, None] = None,200 unmodified lines486 if version is None and package_name is not None:487 metadata: t.Optional[types.ModuleType]488 489 try:498- from importlib import metadata # type: ignore490+ from importlib import metadata491 except ImportError:492 # Python < 3.8493 import importlib_metadata as metadata # type: ignore494 59 unmodified linesmodified:src/click/exceptions.py+1 added-1 removed
11 unmodified lines12 from .core import Parameter13 14 15 def _join_param_hints(16- param_hint: t.Optional[t.Union[t.Sequence[str], str]]16+ param_hint: t.Optional[t.Union[t.Sequence[str], str]],17 ) -> t.Optional[str]:18 if param_hint is not None and not isinstance(param_hint, str):19 return " / ".join(repr(x) for x in param_hint)20 268 unmodified linesmodified:src/click/globals.py+3 added-4 removed
1 unmodified line2 from threading import local3 4 if t.TYPE_CHECKING:5 import typing_extensions as te6+7 from .core import Context8 9 _local = local()10 11 12 @t.overload12-def get_current_context(silent: "te.Literal[False]" = False) -> "Context":13- ...13+def get_current_context(silent: "te.Literal[False]" = False) -> "Context": ...14 15 16 @t.overload17-def get_current_context(silent: bool = ...) -> t.Optional["Context"]:18- ...17+def get_current_context(silent: bool = ...) -> t.Optional["Context"]: ...18 19 20 def get_current_context(silent: bool = False) -> t.Optional["Context"]:21 """Returns the current click context. This can be used as a way to46 unmodified linesmodified:src/click/parser.py+2 added
15 unmodified lines16 17 Copyright 2001-2006 Gregory P. Ward. All rights reserved.18 Copyright 2002-2006 Python Software Foundation. All rights reserved.19 """20+21 # This code uses parts of optparse written by Gregory P. Ward and22 # maintained by the Python Software Foundation.23 # Copyright 2001-2006 Gregory P. Ward24 # Copyright 2002-2006 Python Software Foundation8 unmodified lines33 from .exceptions import UsageError34 35 if t.TYPE_CHECKING:36 import typing_extensions as te37+38 from .core import Argument as CoreArgument39 from .core import Context40 from .core import Option as CoreOption41 from .core import Parameter as CoreParameter490 unmodified linesmodified:src/click/termui.py+1 added-1 removed
171 unmodified lines172 except UsageError as e:173 if hide_input:174 echo(_("Error: The value you entered was invalid."), err=err)175 else:176- echo(_("Error: {e.message}").format(e=e), err=err) # noqa: B306176+ echo(_("Error: {e.message}").format(e=e), err=err)177 continue178 if not confirmation_prompt:179 return result180 while True:604 unmodified linesmodified:src/click/testing.py+1 added-1 removed
473 unmodified lines474 475 if temp_dir is None:476 try:477 shutil.rmtree(dt)478- except OSError: # noqa: B014478+ except OSError:479 passmodified:src/click/types.py+2 added-1 removed
13 unmodified lines14 from .utils import safecall15 16 if t.TYPE_CHECKING:17 import typing_extensions as te18+19 from .core import Context20 from .core import Parameter21 from .shell_completion import CompletionItem22 714 unmodified lines737 else:738 ctx.call_on_close(safecall(f.flush))739 740 return f740- except OSError as e: # noqa: B014741+ except OSError as e:742 self.fail(f"'{format_filename(value)}': {e.strerror}", param, ctx)743 744 def shell_complete(745 self, ctx: "Context", param: "Parameter", incomplete: str345 unmodified linesmodified:src/click/utils.py+1 added-1 removed
154 unmodified lines155 try:156 rv, self.should_close = open_stream(157 self.name, self.mode, self.encoding, self.errors, atomic=self.atomic158 )159- except OSError as e: # noqa: E402159+ except OSError as e:160 from .exceptions import FileError161 162 raise FileError(self.name, hint=e.strerror) from e163 self._f = rv461 unmodified linesmodified:tests/typing/typing_aliased_group.py+1 added
1 """Example from https://click.palletsprojects.com/en/8.1.x/advanced/#command-aliases"""2+3 from __future__ import annotations4 5 from typing_extensions import assert_type6 40 unmodified linesmodified:tests/typing/typing_confirmation_option.py+1 added
1 """From https://click.palletsprojects.com/en/8.1.x/options/#yes-parameters"""2+3 from typing_extensions import assert_type4 5 import click6 8 unmodified linesmodified:tests/typing/typing_options.py+1 added
1 """From https://click.palletsprojects.com/en/8.1.x/quickstart/#adding-parameters"""2+3 from typing_extensions import assert_type4 5 import click6 10 unmodified linesmodified:tests/typing/typing_simple_example.py+1 added
1 """The simple example from https://github.com/pallets/click#a-simple-example."""2+3 from typing_extensions import assert_type4 5 import click6 11 unmodified linesmodified:tests/typing/typing_version_option.py+1 added
1 """2 From https://click.palletsprojects.com/en/8.1.x/options/#callbacks-and-eager-options.3 """4+5 from typing_extensions import assert_type6 7 import click8 8 unmodified linesmodified:tests/test_defaults.py+2 added-2 removed
3 unmodified lines4 def test_basic_defaults(runner):5 @click.command()6 @click.option("--foo", default=42, type=click.FLOAT)7 def cli(foo):8- assert type(foo) is float8+ assert type(foo) is float # noqa E7219 click.echo(f"FOO:[{foo}]")10 11 result = runner.invoke(cli, [])12 assert not result.exception4 unmodified lines17 @click.command()18 @click.option("--foo", default=[23, 42], type=click.FLOAT, multiple=True)19 def cli(foo):20 for item in foo:21- assert type(item) is float21+ assert type(item) is float # noqa E72122 click.echo(item)23 24 result = runner.invoke(cli, [])25 assert not result.exception36 unmodified linesmodified:tests/test_imports.py-1 removed
2 unmodified lines3 import sys4 5 from click._compat import WIN6 7-7 IMPORT_TEST = b"""\8 import builtins9 10 found_imports = set()57 unmodified linesmodified:tests/test_normalization.py-1 removed
1 import click2 3-3 CONTEXT_SETTINGS = dict(token_normalize_func=lambda x: x.lower())4 5 6 def test_option_normalization(runner):32 unmodified linesmodified: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- result_mix.stderr324+ result_mix.stderr # noqa B018325 326 @click.command()327 def cli_empty_stderr():328 click.echo("stdout")92 unmodified linesmodified:tests/test_utils.py+2 added-2 removed
239 unmodified lines240 def test_prompt_cast_default(capfd, monkeypatch):241 monkeypatch.setattr(sys, "stdin", StringIO("\n"))242 value = click.prompt("value", default="100", type=int)243 capfd.readouterr()244- assert type(value) is int244+ assert type(value) is int # noqa E721245 246 247 @pytest.mark.skipif(WIN, reason="Test too complex to make work windows.")248 def test_echo_writing_to_standard_error(capfd, monkeypatch):214 unmodified lines463 user = os.path.expanduser("~")464 assert user in click.utils._expand_args(["~"])465 monkeypatch.setenv("CLICK_TEST", "hello")466 assert "hello" in click.utils._expand_args(["$CLICK_TEST"])467- assert "setup.cfg" in click.utils._expand_args(["*.cfg"])467+ assert "pyproject.toml" in click.utils._expand_args(["*.toml"])468 assert os.path.join("docs", "conf.py") in click.utils._expand_args(["**/conf.py"])469 assert "*.not-found" in click.utils._expand_args(["*.not-found"])470 # a bad glob pattern, such as a pytest identifier, should return itself471 assert click.utils._expand_args(["test.py::test_bad"])[0] == "test.py::test_bad"36 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-15 removed
1-/.idea/2-/.vscode/3-.DS_Store/4-/env/5-/venv/1+.idea/2+.vscode/3+.venv*/4+venv*/5 __pycache__/7-*.pyc8-*.egg-info/9-/build/10-/dist/11-/.pytest_cache/12-/.tox/13-.coverage14-.coverage.*15-/htmlcov/16-/docs/_build/6+dist/7+.coverage*8+htmlcov/9+.tox/10+docs/_build/modified:.pre-commit-config.yaml+7 added-22 removed
1 ci:2- autoupdate_branch: "8.1.x"2 autoupdate_schedule: monthly3 repos:5- - repo: https://github.com/asottile/pyupgrade6- rev: v3.15.04+ - repo: https://github.com/astral-sh/ruff-pre-commit5+ rev: v0.4.16 hooks:8- - id: pyupgrade9- args: ["--py37-plus"]10- - repo: https://github.com/asottile/reorder-python-imports11- rev: v3.12.012- hooks:13- - id: reorder-python-imports14- args: ["--application-directories", "src"]15- - repo: https://github.com/psf/black16- rev: 23.11.017- hooks:18- - id: black19- - repo: https://github.com/PyCQA/flake820- rev: 6.1.021- hooks:22- - id: flake823- additional_dependencies:24- - flake8-bugbear25- - flake8-implicit-str-concat7+ - id: ruff8+ - id: ruff-format9 - repo: https://github.com/pre-commit/pre-commit-hooks27- rev: v4.5.010+ rev: v4.6.011 hooks:12+ - id: check-merge-conflict13+ - id: debug-statements14 - id: fix-byte-order-marker15 - id: trailing-whitespace16 - id: end-of-file-fixermodified:.readthedocs.yaml+2 added-2 removed
1 version: 22 build:3- os: ubuntu-20.043+ os: ubuntu-22.044 tools:5- python: "3.10"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.deleted:MANIFEST.in-10 removed
1-include CHANGES.rst2-include tox.ini3-include requirements/*.txt4-graft artwork5-graft docs6-prune docs/_build7-graft examples8-graft tests9-include src/click/py.typed10-global-exclude *.pycadded:pyproject.toml+99 added
1+[project]2+name = "click"3+description = "Composable command line interface toolkit"4+readme = "README.md"5+license = {file = "LICENSE.txt"}6+maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}]7+classifiers = [8+ "Development Status :: 5 - Production/Stable",9+ "Intended Audience :: Developers",10+ "License :: OSI Approved :: BSD License",11+ "Operating System :: OS Independent",12+ "Programming Language :: Python",13+ "Typing :: Typed",14+]15+requires-python = ">=3.7"16+dependencies = [17+ "colorama; platform_system == 'Windows'",18+ "importlib-metadata; python_version < '3.8'",19+]20+dynamic = ["version"]21+22+[project.urls]23+Donate = "https://palletsprojects.com/donate"24+Documentation = "https://click.palletsprojects.com/"25+Changes = "https://click.palletsprojects.com/changes/"26+Source = "https://github.com/pallets/click/"27+Chat = "https://discord.gg/pallets"28+29+[build-system]30+requires = ["flit_core<4"]31+build-backend = "flit_core.buildapi"32+33+[tool.flit.module]34+name = "click"35+36+[tool.flit.sdist]37+include = [38+ "docs/",39+ "requirements/",40+ "tests/",41+ "CHANGES.rst",42+ "tox.ini",43+]44+exclude = [45+ "docs/_build/",46+]47+48+[tool.pytest.ini_options]49+testpaths = ["tests"]50+filterwarnings = [51+ "error",52+]53+54+[tool.coverage.run]55+branch = true56+source = ["click", "tests"]57+58+[tool.coverage.paths]59+source = ["src", "*/site-packages"]60+61+[tool.mypy]62+python_version = "3.8"63+files = ["src/click", "tests/typing"]64+show_error_codes = true65+pretty = true66+strict = true67+68+[[tool.mypy.overrides]]69+module = [70+ "colorama.*",71+]72+ignore_missing_imports = true73+74+[tool.pyright]75+pythonVersion = "3.8"76+include = ["src/click", "tests/typing"]77+typeCheckingMode = "basic"78+79+[tool.ruff]80+extend-exclude = ["examples/"]81+src = ["src"]82+fix = true83+show-fixes = true84+output-format = "full"85+86+[tool.ruff.lint]87+select = [88+ "B", # flake8-bugbear89+ "E", # pycodestyle error90+ "F", # pyflakes91+ "I", # isort92+ "UP", # pyupgrade93+ "W", # pycodestyle warning94+]95+ignore-init-module-imports = true96+97+[tool.ruff.lint.isort]98+force-single-line = true99+order-by-type = falseadded: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/palletsdeleted:setup.cfg-104 removed
1-[metadata]2-name = click3-version = attr: click.__version__4-url = https://palletsprojects.com/p/click/5-project_urls =6- Donate = https://palletsprojects.com/donate7- Documentation = https://click.palletsprojects.com/8- Changes = https://click.palletsprojects.com/changes/9- Source Code = https://github.com/pallets/click/10- Issue Tracker = https://github.com/pallets/click/issues/11- Chat = https://discord.gg/pallets12-license = BSD-3-Clause13-license_files = LICENSE.rst14-maintainer = Pallets15-maintainer_email = contact@palletsprojects.com16-description = Composable command line interface toolkit17-long_description = file: README.rst18-long_description_content_type = text/x-rst19-classifiers =20- Development Status :: 5 - Production/Stable21- Intended Audience :: Developers22- License :: OSI Approved :: BSD License23- Operating System :: OS Independent24- Programming Language :: Python25-26-[options]27-packages = find:28-package_dir = = src29-include_package_data = True30-python_requires = >= 3.731-# Dependencies are in setup.py for GitHub's dependency graph.32-33-[options.packages.find]34-where = src35-36-[tool:pytest]37-testpaths = tests38-filterwarnings =39- error40-41-[coverage:run]42-branch = True43-source =44- click45- tests46-47-[coverage:paths]48-source =49- src50- */site-packages51-52-[flake8]53-# B = bugbear54-# E = pycodestyle errors55-# F = flake8 pyflakes56-# W = pycodestyle warnings57-# B9 = bugbear opinions58-# ISC = implicit str concat59-select = B, E, F, W, B9, ISC60-ignore =61- # slice notation whitespace, invalid62- E20363- # line length, handled by bugbear B95064- E50165- # bare except, handled by bugbear B00166- E72267- # bin op line break, invalid68- W50369- # zip with strict=, requires python >= 3.1070- B90571- # string formatting opinion, B028 renamed to B90772- B02873- B90774-# up to 88 allowed by bugbear B95075-max-line-length = 8076-per-file-ignores =77- # __init__ exports names78- src/click/__init__.py: F40179-80-[mypy]81-files = src/click, tests/typing82-python_version = 3.783-show_error_codes = True84-disallow_subclassing_any = True85-disallow_untyped_calls = True86-disallow_untyped_defs = True87-disallow_incomplete_defs = True88-disallow_any_generics = True89-check_untyped_defs = True90-no_implicit_optional = True91-local_partial_types = True92-no_implicit_reexport = True93-strict_equality = True94-warn_redundant_casts = True95-warn_unused_configs = True96-warn_unused_ignores = True97-warn_return_any = True98-warn_unreachable = True99-100-[mypy-colorama.*]101-ignore_missing_imports = True102-103-[mypy-importlib_metadata.*]104-ignore_missing_imports = Truedeleted:setup.py-9 removed
1-from setuptools import setup2-3-setup(4- name="click",5- install_requires=[6- "colorama; platform_system == 'Windows'",7- "importlib-metadata; python_version < '3.8'",8- ],9-)modified:tox.ini+18 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-tools37+ pre-commit38+skip_install = true39+change_dir = requirements40+commands =41+ pre-commit autoupdate -j442+ pip-compile -U build.in43+ pip-compile -U docs.in44+ pip-compile -U tests.in45+ pip-compile -U typing.in46+ pip-compile -U dev.in