🔧 Upgrade mypy and config (#768)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sebastián Ramírez · committed by GitHub · parent 4c051bc · Browse files · 6 files·+28 added−19 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+28 added−19 removed
- other:+28 added−19 removed
Provenance
- Commit
c1dd661- Tree
3f1c57b- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
4c051bc
6 files changed+28 added−19 removed
modified:scripts/lint.sh+2 added-2 removed
2 unmodified lines345678782 unmodified linesset -eset -x
mypy typerruff typer tests docs_src scriptsruff format typer tests --checkruff typer tests docs_srcruff format typer tests docs_src --checkmodified:typer/core.py+7 added-6 removed
75 unmodified lines76 from click.shell_completion import CompletionItem77 78 out = []79 80- for c in autocompletion(ctx, [], incomplete): # type: ignore80+ for c in autocompletion(ctx, [], incomplete):81 if isinstance(c, tuple):82- c = CompletionItem(c[0], help=c[1])83- elif isinstance(c, str):84- c = CompletionItem(c)82+ use_completion = CompletionItem(c[0], help=c[1])83+ else:84+ assert isinstance(c, str)85+ use_completion = CompletionItem(c)86 86- if c.value.startswith(incomplete):87- out.append(c)87+ if use_completion.value.startswith(incomplete):88+ out.append(use_completion)89 90 return out91 92 self._custom_shell_complete = compat_autocompletion648 unmodified linesmodified:typer/main.py+4 added-4 removed
93 unmodified lines94 )95 else:96 stack.append(frame)97 # Type ignore ref: https://github.com/python/typeshed/pull/824498- final_stack_summary = StackSummary.from_list(stack) # type: ignore98+ final_stack_summary = StackSummary.from_list(stack)99 tb_exc.stack = final_stack_summary100 for line in tb_exc.format():101 print(line, file=sys.stderr)102 return581 unmodified lines684 else:685 use_params[k] = v686 if context_param_name:687 use_params[context_param_name] = click.get_current_context()688- return callback(**use_params) # type: ignore688+ return callback(**use_params)689 690 update_wrapper(wrapper, callback)691 return wrapper692 304 unmodified lines997 use_value = convertor(value)998 else:999 use_value = value1000 use_params[value_name] = use_value1001- return callback(**use_params) # type: ignore1001+ return callback(**use_params)1002 1003 update_wrapper(wrapper, callback)1004 return wrapper1005 44 unmodified lines1050 if args_name:1051 use_params[args_name] = args1052 if incomplete_name:1053 use_params[incomplete_name] = incomplete1054- return callback(**use_params) # type: ignore1054+ return callback(**use_params)1055 1056 update_wrapper(wrapper, callback)1057 return wrapper1058 5 unmodified linesdeleted:mypy.ini-6 removed
1-[mypy]2-ignore_missing_imports = True3-4-[mypy-typer.*]5-disallow_untyped_defs = True6-strict = Truemodified:pyproject.toml+14 added
48 unmodified lines49505152535455565717 unmodified lines75767778798081828384858687888990919293949545 unmodified lines48 unmodified lines]
[tool.pdm]version = { source = "file", path = "typer/__init__.py" }distribution = true
[tool.isort]profile = "black"known_third_party = ["typer", "click"]17 unmodified lines # For pytest-xdist 'ignore::DeprecationWarning:xdist',]
[tool.mypy]strict = true
[[tool.mypy.overrides]]module = "docs_src.*"disallow_incomplete_defs = falsedisallow_untyped_defs = falsedisallow_untyped_calls = false
[[tool.mypy.overrides]]module = "shellingham"ignore_missing_imports = true
[tool.ruff.lint]select = [ "E", # pycodestyle errors "W", # pycodestyle warnings45 unmodified linesmodified:requirements-tests.txt+1 added-1 removed
3 unmodified lines4 pytest-cov >=2.10.0,<5.0.05 coverage[toml] >=6.2,<7.06 pytest-xdist >=1.32.0,<4.0.07 pytest-sugar >=0.9.4,<0.10.08-mypy ==0.9718+mypy ==1.4.19 ruff ==0.2.0