Skip to content
Myr

Merge branch '8.0.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 051d57c, ee5fdbf · Browse files · 10 files+43 added−24 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+43 added−24 removed

  • tests:+13 added−0 removed
  • other:+30 added−24 removed

10 files+43 added−24 removed

modified:requirements/dev.txt+10 added-12 removed
4 unmodified lines
5# pip-compile requirements/dev.in6#7alabaster==0.7.128 # via sphinx9attrs==21.2.09attrs==21.4.010 # via pytest11babel==2.9.112 # via sphinx13backports.entry-points-selectable==1.1.114 # via virtualenv13certifi==2021.10.814 # via requests15cfgv==3.3.116 # via pre-commit19charset-normalizer==2.0.917charset-normalizer==2.0.1018 # via requests19click==8.0.320 # via pip-tools21distlib==0.3.4
5 unmodified lines
27filelock==3.4.228 # via29 # tox30 # virtualenv33identify==2.4.031identify==2.4.332 # via pre-commit33idna==3.334 # via requests35imagesize==1.3.0
3 unmodified lines
39jinja2==3.0.340 # via sphinx41markupsafe==2.0.142 # via jinja245mypy==0.93043mypy==0.93144 # via -r requirements/typing.in45mypy-extensions==0.4.346 # via mypy47nodeenv==1.6.0
21 unmodified lines
69py==1.11.070 # via71 # pytest72 # tox75pygments==2.10.073pygments==2.11.274 # via75 # sphinx76 # sphinx-tabs77pyparsing==3.0.6
3 unmodified lines
81pytz==2021.382 # via babel83pyyaml==6.084 # via pre-commit87requests==2.26.085requests==2.27.186 # via sphinx87six==1.16.088 # via89 # tox
6 unmodified lines
96 # pallets-sphinx-themes97 # sphinx-issues98 # sphinx-tabs99 # sphinxcontrib-log-cabinet102sphinx-issues==1.2.0100sphinx-issues==3.0.1101 # via -r requirements/docs.in102sphinx-tabs==3.2.0103 # via -r requirements/docs.in104sphinxcontrib-applehelp==1.0.2
18 unmodified lines
123tomli==2.0.0124 # via125 # mypy126 # pep517129tox==3.24.4127tox==3.24.5128 # via -r requirements/dev.in129typing-extensions==4.0.1130 # via mypy133urllib3==1.26.7131urllib3==1.26.8132 # via requests135virtualenv==20.10.0133virtualenv==20.13.0134 # via135 # pre-commit136 # tox137wheel==0.37.1
5 unmodified lines
modified:requirements/docs.txt+5 added-5 removed
8 unmodified lines
9babel==2.9.110 # via sphinx11certifi==2021.10.812 # via requests13charset-normalizer==2.0.913charset-normalizer==2.0.1014 # via requests15docutils==0.1616 # via17 # sphinx
11 unmodified lines
29 # pallets-sphinx-themes30 # sphinx31pallets-sphinx-themes==2.0.232 # via -r requirements/docs.in33pygments==2.10.033pygments==2.11.234 # via35 # sphinx36 # sphinx-tabs37pyparsing==3.0.638 # via packaging39pytz==2021.340 # via babel41requests==2.26.041requests==2.27.142 # via sphinx43snowballstemmer==2.2.044 # via sphinx45sphinx==4.3.2
2 unmodified lines
48 # pallets-sphinx-themes49 # sphinx-issues50 # sphinx-tabs51 # sphinxcontrib-log-cabinet52sphinx-issues==1.2.052sphinx-issues==3.0.153 # via -r requirements/docs.in54sphinx-tabs==3.2.055 # via -r requirements/docs.in56sphinxcontrib-applehelp==1.0.2
9 unmodified lines
66sphinxcontrib-qthelp==1.0.367 # via sphinx68sphinxcontrib-serializinghtml==1.1.569 # via sphinx70urllib3==1.26.770urllib3==1.26.871 # via requests7273# The following packages are considered to be unsafe in a requirements file:74# setuptools
modified:requirements/tests.txt+1 added-1 removed
2 unmodified lines
3# To update, run:4#5# pip-compile requirements/tests.in6#7attrs==21.2.07attrs==21.4.08 # via pytest9iniconfig==1.1.110 # via pytest11packaging==21.3
11 unmodified lines
modified:requirements/typing.txt+1 added-1 removed
2 unmodified lines
3# To update, run:4#5# pip-compile requirements/typing.in6#7mypy==0.9307mypy==0.9318 # via -r requirements/typing.in9mypy-extensions==0.4.310 # via mypy11tomli==2.0.0
3 unmodified lines
modified:src/click/core.py+2 added-1 removed
1import enum2import errno3import inspect4import os5import sys6import typing as t7from collections import abc
2670 unmodified lines
2678 if show_default_is_str:2679 default_string = f"({self.show_default})"2680 elif isinstance(default_value, (list, tuple)):2681 default_string = ", ".join(str(d) for d in default_value)2681 elif callable(default_value):2682 elif inspect.isfunction(default_value):2683 default_string = _("(dynamic)")2684 elif self.is_bool_flag and self.secondary_opts:2685 # For boolean flags that have distinct True/False opts,2686 # use the opt without prefix instead of the value.
228 unmodified lines
modified:src/click/decorators.py+1 added-1 removed
12 unmodified lines
13from .globals import get_current_context14from .utils import echo1516F = t.TypeVar("F", bound=t.Callable[..., t.Any])17FC = t.TypeVar("FC", t.Callable[..., t.Any], Command)17FC = t.TypeVar("FC", bound=t.Union[t.Callable[..., t.Any], Command])181920def pass_context(f: F) -> F:21 """Marks a callback as wanting to receive the current context
415 unmodified lines
modified:src/click/shell_completion.py+2 added-2 removed
100 unmodified lines
101 for completion in $response; do102 IFS=',' read type value <<< "$completion"103104 if [[ $type == 'dir' ]]; then105 COMREPLY=()105 COMPREPLY=()106 compopt -o dirnames107 elif [[ $type == 'file' ]]; then108 COMREPLY=()108 COMPREPLY=()109 compopt -o default110 elif [[ $type == 'plain' ]]; then111 COMPREPLY+=($value)112 fi
469 unmodified lines
modified:tests/test_options.py+13 added
303 unmodified lines
304 assert "lambda" not in result.output305 assert "(current user)" in result.output306307308def test_dynamic_default_help_special_method(runner):309 class Value:310 def __call__(self):311 return 42312313 def __str__(self):314 return "special value"315316 opt = click.Option(["-a"], default=Value(), show_default=True)317 ctx = click.Context(click.Command("cli"))318 assert "special value" in opt.get_help_record(ctx)[1]319320321@pytest.mark.parametrize(322 ("type", "expect"),323 [324 (click.IntRange(1, 32), "1<=x<=32"),
551 unmodified lines
modified:.pre-commit-config.yaml+1 added-1 removed
1ci:2 autoupdate_schedule: monthly3repos:4 - repo: https://github.com/asottile/pyupgrade5 rev: v2.29.15 rev: v2.31.06 hooks:7 - id: pyupgrade8 args: ["--py37-plus"]9 - repo: https://github.com/asottile/reorder_python_imports
21 unmodified lines
modified:CHANGES.rst+7 added
24 unmodified lines
25Unreleased2627- ``open_file`` recognizes ``Path("-")`` as a standard stream, the28 same as the string ``"-"``. :issue:`2106`29- The ``option`` and ``argument`` decorators preserve the type30 annotation of the decorated function. :pr:`2155`31- A callable default value can customize its help text by overriding32 ``__str__`` instead of always showing ``(dynamic)``. :issue:`2099`33- Fix a typo in the Bash completion script that affected file and34 directory completion. If this script was generated by a previous35 version, it should be regenerated. :issue:`2163`363738Version 8.0.339-------------
930 unmodified lines