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 c65c6ad, 06a2c0f · Browse files · 10 files·+63 added−61 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
10 files+63 added−61 removed
- other:+63 added−61 removed
Provenance
- Commit
5e75fe7- Tree
c57d983- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
c65c6ad- Parent 2
06a2c0f
10 files changed+63 added−61 removed
modified:docs/exceptions.rst+3 added-3 removed
11 unmodified lines12 13 Click's main error handling is happening in :meth:`BaseCommand.main`. In14 there it handles all subclasses of :exc:`ClickException` as well as the15 standard :exc:`EOFError` and :exc:`KeyboardInterrupt` exceptions. The16-latter are internally translated into a :exc:`Abort`.16+latter are internally translated into an :exc:`Abort`.17 18 The logic applied is the following:19 20 1. If an :exc:`EOFError` or :exc:`KeyboardInterrupt` happens, reraise it21 as :exc:`Abort`.22-2. If an :exc:`ClickException` is raised, invoke the22+2. If a :exc:`ClickException` is raised, invoke the23 :meth:`ClickException.show` method on it to display it and then exit24 the program with :attr:`ClickException.exit_code`.25 3. If an :exc:`Abort` exception is raised print the string ``Aborted!``26 to standard error and exit the program with exit code ``1``.27-4. if it goes through well, exit the program with exit code ``0``.27+4. If it goes through well, exit the program with exit code ``0``.28 29 What if I don't want that?30 --------------------------31 42 unmodified linesmodified:requirements/dev.txt+27 added-23 removed
6 unmodified lines7 #8 -r docs.txt9 -r tests.txt10 -r typing.txt11+build==0.9.012+ # via pip-tools13+cachetools==5.2.014+ # via tox15 cfgv==3.3.116 # via pre-commit17+chardet==5.1.018+ # via tox13-click==8.1.219+click==8.1.320 # via21 # pip-compile-multi22 # pip-tools23+colorama==0.4.624+ # via tox17-distlib==0.3.425+distlib==0.3.626 # via virtualenv19-filelock==3.6.027+filelock==3.9.028 # via29 # tox30 # virtualenv23-identify==2.5.031+identify==2.5.1132 # via pre-commit25-nodeenv==1.6.033+nodeenv==1.7.034 # via pre-commit27-pep517==0.12.028- # via pip-tools29-pip-compile-multi==2.4.535+pep517==0.13.036+ # via build37+pip-compile-multi==2.6.138 # via -r requirements/dev.in31-pip-tools==6.6.039+pip-tools==6.12.140 # via pip-compile-multi33-platformdirs==2.5.234- # via virtualenv35-pre-commit==2.18.136- # via -r requirements/dev.in37-pyyaml==6.038- # via pre-commit39-six==1.16.041+platformdirs==2.6.242 # via43 # tox44 # virtualenv43-toml==0.10.244- # via45- # pre-commit46- # tox45+pre-commit==2.21.046+ # via -r requirements/dev.in47+pyproject-api==1.2.148+ # via tox49+pyyaml==6.050+ # via pre-commit51 toposort==1.752 # via pip-compile-multi49-tox==3.25.053+tox==4.1.054 # via -r requirements/dev.in51-virtualenv==20.14.155+virtualenv==20.17.156 # via57 # pre-commit58 # tox55-wheel==0.37.159+wheel==0.38.460 # via pip-tools61 62 # The following packages are considered to be unsafe in a requirements file:63 # pip1 unmodified linemodified:requirements/docs.txt+14 added-16 removed
5 unmodified lines6 # pip-compile-multi7 #8 alabaster==0.7.129 # via sphinx10-babel==2.10.110+babel==2.11.011 # via sphinx12-certifi==2021.10.812+certifi==2022.12.713 # via requests14-charset-normalizer==2.0.1214+charset-normalizer==2.1.115 # via requests16-docutils==0.17.116+docutils==0.18.117 # via18 # sphinx19 # sphinx-tabs20-idna==3.320+idna==3.421 # via requests22-imagesize==1.3.022+imagesize==1.4.123 # via sphinx24 jinja2==3.1.225 # via sphinx26 markupsafe==2.1.127 # via jinja228-packaging==21.328+packaging==22.029 # via30 # pallets-sphinx-themes31 # sphinx32-pallets-sphinx-themes==2.0.232+pallets-sphinx-themes==2.0.333 # via -r requirements/docs.in34-pygments==2.12.034+pygments==2.13.035 # via36 # sphinx37 # sphinx-tabs38-pyparsing==3.0.839- # via packaging40-pytz==2022.138+pytz==2022.739 # via babel42-requests==2.27.140+requests==2.28.141 # via sphinx42 snowballstemmer==2.2.043 # via sphinx46-sphinx==4.5.044+sphinx==6.0.045 # via46 # -r requirements/docs.in47 # pallets-sphinx-themes48 # sphinx-issues49 # sphinx-tabs50 # sphinxcontrib-log-cabinet51 sphinx-issues==3.0.152 # via -r requirements/docs.in55-sphinx-tabs==3.3.153+sphinx-tabs==3.4.154 # via -r requirements/docs.in55 sphinxcontrib-applehelp==1.0.256 # via sphinx57 sphinxcontrib-devhelp==1.0.27 unmodified lines65 sphinxcontrib-qthelp==1.0.366 # via sphinx67 sphinxcontrib-serializinghtml==1.1.568 # via sphinx71-urllib3==1.26.969+urllib3==1.26.1370 # via requestsmodified:requirements/tests.txt+5 added-7 removed
3 unmodified lines4 # To update, run:5 #6 # pip-compile-multi7 #8-attrs==21.4.08+attrs==22.2.09 # via pytest10+exceptiongroup==1.1.011+ # via pytest12 iniconfig==1.1.113 # via pytest12-packaging==21.314+packaging==22.015 # via pytest16 pluggy==1.0.017 # via pytest16-py==1.11.017- # via pytest18-pyparsing==3.0.819- # via packaging20-pytest==7.1.218+pytest==7.2.019 # via -r requirements/tests.in20 tomli==2.0.121 # via pytestmodified:requirements/typing.txt+2 added-2 removed
3 unmodified lines4 # To update, run:5 #6 # pip-compile-multi7 #8-mypy==0.9508+mypy==0.9919 # via -r requirements/typing.in10 mypy-extensions==0.4.311 # via mypy12 tomli==2.0.113 # via mypy14-typing-extensions==4.2.014+typing-extensions==4.4.015 # via mypymodified:src/click/termui.py+1 added-1 removed
71 unmodified lines72 73 74 def _format_default(default: t.Any) -> t.Any:75 if isinstance(default, (io.IOBase, LazyFile)) and hasattr(default, "name"):76- return default.name # type: ignore76+ return default.name77 78 return default79 80 707 unmodified linesmodified:src/click/testing.py+3 added-3 removed
93 unmodified lines94 input = b""95 elif isinstance(input, str):96 input = input.encode(charset)97 98- return io.BytesIO(t.cast(bytes, input))98+ return io.BytesIO(input)99 100 101 class Result:102 """Holds the captured result of an invoked CLI script."""360 unmodified lines463 .. versionchanged:: 8.0464 Added the ``temp_dir`` parameter.465 """466 cwd = os.getcwd()467- dt = tempfile.mkdtemp(dir=temp_dir) # type: ignore[type-var]467+ dt = tempfile.mkdtemp(dir=temp_dir)468 os.chdir(dt)469 470 try:471- yield t.cast(str, dt)471+ yield dt472 finally:473 os.chdir(cwd)474 475 if temp_dir is None:4 unmodified linesmodified:src/click/types.py+1 added-1 removed
775 unmodified lines776 .. versionchanged:: 8.1777 Added the ``executable`` parameter.778 779 .. versionchanged:: 8.0780- Allow passing ``type=pathlib.Path``.780+ Allow passing ``path_type=pathlib.Path``.781 782 .. versionchanged:: 6.0783 Added the ``allow_dash`` parameter.784 """289 unmodified linesmodified:.pre-commit-config.yaml+5 added-5 removed
1 unmodified line2 autoupdate_branch: "8.1.x"3 autoupdate_schedule: monthly4 repos:5 - repo: https://github.com/asottile/pyupgrade6- rev: v2.32.06+ rev: v3.3.17 hooks:8 - id: pyupgrade9 args: ["--py37-plus"]10 - repo: https://github.com/asottile/reorder_python_imports11- rev: v3.1.011+ rev: v3.9.012 hooks:13 - id: reorder-python-imports14 args: ["--application-directories", "src"]15 additional_dependencies: ["setuptools>60.9"]16 - repo: https://github.com/psf/black17- rev: 22.3.017+ rev: 22.12.018 hooks:19 - id: black20 - repo: https://github.com/PyCQA/flake821- rev: 4.0.121+ rev: 6.0.022 hooks:23 - id: flake824 additional_dependencies:25 - flake8-bugbear26 - flake8-implicit-str-concat27 - repo: https://github.com/pre-commit/pre-commit-hooks28- rev: v4.2.028+ rev: v4.4.029 hooks:30 - id: fix-byte-order-marker31 - id: trailing-whitespace32 - id: end-of-file-fixermodified:setup.cfg+2 added
67 unmodified lines68 # bare except, handled by bugbear B00169 E72270 # bin op line break, invalid71 W50372+ # zip with strict=, requires python >= 3.1073+ B90574 # up to 88 allowed by bugbear B95075 max-line-length = 8076 per-file-ignores =77 # __init__ exports names26 unmodified lines