diff options
author | David Lord <davidism@gmail.com> | 2022-12-29 10:29:13 -0800 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2022-12-29 10:29:13 -0800 |
commit | 5e75fe7f9c1b820d71f482599cd6996523332d06 (patch) | |
tree | c57d983de5ffe16c3850d48c30bd5439862de111 | |
parent | c65c6ad18471448c0fcc59ef53088787288c02cc (diff) | |
parent | 06a2c0f2ec24ef0a3e5ee97ce9ccbcc51ab49d3a (diff) | |
download | click-5e75fe7f9c1b820d71f482599cd6996523332d06.tar.gz |
Merge branch '8.1.x'
-rw-r--r-- | .pre-commit-config.yaml | 10 | ||||
-rw-r--r-- | docs/exceptions.rst | 6 | ||||
-rw-r--r-- | requirements/dev.txt | 50 | ||||
-rw-r--r-- | requirements/docs.txt | 30 | ||||
-rw-r--r-- | requirements/tests.txt | 12 | ||||
-rw-r--r-- | requirements/typing.txt | 4 | ||||
-rw-r--r-- | setup.cfg | 2 | ||||
-rw-r--r-- | src/click/termui.py | 2 | ||||
-rw-r--r-- | src/click/testing.py | 6 | ||||
-rw-r--r-- | src/click/types.py | 2 |
10 files changed, 63 insertions, 61 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 472866d..f8554a4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,29 +3,29 @@ ci: autoupdate_schedule: monthly repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v3.3.1 hooks: - id: pyupgrade args: ["--py37-plus"] - repo: https://github.com/asottile/reorder_python_imports - rev: v3.1.0 + rev: v3.9.0 hooks: - id: reorder-python-imports args: ["--application-directories", "src"] additional_dependencies: ["setuptools>60.9"] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.12.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 6.0.0 hooks: - id: flake8 additional_dependencies: - flake8-bugbear - flake8-implicit-str-concat - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.4.0 hooks: - id: fix-byte-order-marker - id: trailing-whitespace diff --git a/docs/exceptions.rst b/docs/exceptions.rst index 4b022cb..06ede94 100644 --- a/docs/exceptions.rst +++ b/docs/exceptions.rst @@ -13,18 +13,18 @@ Where are Errors Handled? Click's main error handling is happening in :meth:`BaseCommand.main`. In there it handles all subclasses of :exc:`ClickException` as well as the standard :exc:`EOFError` and :exc:`KeyboardInterrupt` exceptions. The -latter are internally translated into a :exc:`Abort`. +latter are internally translated into an :exc:`Abort`. The logic applied is the following: 1. If an :exc:`EOFError` or :exc:`KeyboardInterrupt` happens, reraise it as :exc:`Abort`. -2. If an :exc:`ClickException` is raised, invoke the +2. If a :exc:`ClickException` is raised, invoke the :meth:`ClickException.show` method on it to display it and then exit the program with :attr:`ClickException.exit_code`. 3. If an :exc:`Abort` exception is raised print the string ``Aborted!`` to standard error and exit the program with exit code ``1``. -4. if it goes through well, exit the program with exit code ``0``. +4. If it goes through well, exit the program with exit code ``0``. What if I don't want that? -------------------------- diff --git a/requirements/dev.txt b/requirements/dev.txt index c9bcd60..bde64ee 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -8,51 +8,55 @@ -r docs.txt -r tests.txt -r typing.txt +build==0.9.0 + # via pip-tools +cachetools==5.2.0 + # via tox cfgv==3.3.1 # via pre-commit -click==8.1.2 +chardet==5.1.0 + # via tox +click==8.1.3 # via # pip-compile-multi # pip-tools -distlib==0.3.4 +colorama==0.4.6 + # via tox +distlib==0.3.6 # via virtualenv -filelock==3.6.0 +filelock==3.9.0 # via # tox # virtualenv -identify==2.5.0 +identify==2.5.11 # via pre-commit -nodeenv==1.6.0 +nodeenv==1.7.0 # via pre-commit -pep517==0.12.0 - # via pip-tools -pip-compile-multi==2.4.5 +pep517==0.13.0 + # via build +pip-compile-multi==2.6.1 # via -r requirements/dev.in -pip-tools==6.6.0 +pip-tools==6.12.1 # via pip-compile-multi -platformdirs==2.5.2 - # via virtualenv -pre-commit==2.18.1 - # via -r requirements/dev.in -pyyaml==6.0 - # via pre-commit -six==1.16.0 +platformdirs==2.6.2 # via # tox # virtualenv -toml==0.10.2 - # via - # pre-commit - # tox +pre-commit==2.21.0 + # via -r requirements/dev.in +pyproject-api==1.2.1 + # via tox +pyyaml==6.0 + # via pre-commit toposort==1.7 # via pip-compile-multi -tox==3.25.0 +tox==4.1.0 # via -r requirements/dev.in -virtualenv==20.14.1 +virtualenv==20.17.1 # via # pre-commit # tox -wheel==0.37.1 +wheel==0.38.4 # via pip-tools # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/docs.txt b/requirements/docs.txt index 2c10a6c..b517889 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -7,43 +7,41 @@ # alabaster==0.7.12 # via sphinx -babel==2.10.1 +babel==2.11.0 # via sphinx -certifi==2021.10.8 +certifi==2022.12.7 # via requests -charset-normalizer==2.0.12 +charset-normalizer==2.1.1 # via requests -docutils==0.17.1 +docutils==0.18.1 # via # sphinx # sphinx-tabs -idna==3.3 +idna==3.4 # via requests -imagesize==1.3.0 +imagesize==1.4.1 # via sphinx jinja2==3.1.2 # via sphinx markupsafe==2.1.1 # via jinja2 -packaging==21.3 +packaging==22.0 # via # pallets-sphinx-themes # sphinx -pallets-sphinx-themes==2.0.2 +pallets-sphinx-themes==2.0.3 # via -r requirements/docs.in -pygments==2.12.0 +pygments==2.13.0 # via # sphinx # sphinx-tabs -pyparsing==3.0.8 - # via packaging -pytz==2022.1 +pytz==2022.7 # via babel -requests==2.27.1 +requests==2.28.1 # via sphinx snowballstemmer==2.2.0 # via sphinx -sphinx==4.5.0 +sphinx==6.0.0 # via # -r requirements/docs.in # pallets-sphinx-themes @@ -52,7 +50,7 @@ sphinx==4.5.0 # sphinxcontrib-log-cabinet sphinx-issues==3.0.1 # via -r requirements/docs.in -sphinx-tabs==3.3.1 +sphinx-tabs==3.4.1 # via -r requirements/docs.in sphinxcontrib-applehelp==1.0.2 # via sphinx @@ -68,5 +66,5 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -urllib3==1.26.9 +urllib3==1.26.13 # via requests diff --git a/requirements/tests.txt b/requirements/tests.txt index 4cd3fe9..fa8c24a 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -5,19 +5,17 @@ # # pip-compile-multi # -attrs==21.4.0 +attrs==22.2.0 + # via pytest +exceptiongroup==1.1.0 # via pytest iniconfig==1.1.1 # via pytest -packaging==21.3 +packaging==22.0 # via pytest pluggy==1.0.0 # via pytest -py==1.11.0 - # via pytest -pyparsing==3.0.8 - # via packaging -pytest==7.1.2 +pytest==7.2.0 # via -r requirements/tests.in tomli==2.0.1 # via pytest diff --git a/requirements/typing.txt b/requirements/typing.txt index 2d97fef..a70f3f5 100644 --- a/requirements/typing.txt +++ b/requirements/typing.txt @@ -5,11 +5,11 @@ # # pip-compile-multi # -mypy==0.950 +mypy==0.991 # via -r requirements/typing.in mypy-extensions==0.4.3 # via mypy tomli==2.0.1 # via mypy -typing-extensions==4.2.0 +typing-extensions==4.4.0 # via mypy @@ -69,6 +69,8 @@ ignore = E722 # bin op line break, invalid W503 + # zip with strict=, requires python >= 3.10 + B905 # up to 88 allowed by bugbear B950 max-line-length = 80 per-file-ignores = diff --git a/src/click/termui.py b/src/click/termui.py index bfb2f5a..f3ad4ca 100644 --- a/src/click/termui.py +++ b/src/click/termui.py @@ -73,7 +73,7 @@ def _build_prompt( def _format_default(default: t.Any) -> t.Any: if isinstance(default, (io.IOBase, LazyFile)) and hasattr(default, "name"): - return default.name # type: ignore + return default.name return default diff --git a/src/click/testing.py b/src/click/testing.py index e395c2e..244d326 100644 --- a/src/click/testing.py +++ b/src/click/testing.py @@ -95,7 +95,7 @@ def make_input_stream( elif isinstance(input, str): input = input.encode(charset) - return io.BytesIO(t.cast(bytes, input)) + return io.BytesIO(input) class Result: @@ -464,11 +464,11 @@ class CliRunner: Added the ``temp_dir`` parameter. """ cwd = os.getcwd() - dt = tempfile.mkdtemp(dir=temp_dir) # type: ignore[type-var] + dt = tempfile.mkdtemp(dir=temp_dir) os.chdir(dt) try: - yield t.cast(str, dt) + yield dt finally: os.chdir(cwd) diff --git a/src/click/types.py b/src/click/types.py index b45ee53..d948c70 100644 --- a/src/click/types.py +++ b/src/click/types.py @@ -777,7 +777,7 @@ class Path(ParamType): Added the ``executable`` parameter. .. versionchanged:: 8.0 - Allow passing ``type=pathlib.Path``. + Allow passing ``path_type=pathlib.Path``. .. versionchanged:: 6.0 Added the ``allow_dash`` parameter. |