click
click copied to clipboard
Add typing to pass pyright
Fix the overwhelming majority of issues identified by pyright. The only remaining issues are of the form:
click.types.File.envvar_list_splitter
/click/src/click/types.py:658:5 - error: Ambiguous base class override
Type declared in base class is "str | None"
Type inferred in child class is "str"
Inferred child class type is missing type annotation and could be inferred differently by type checkers
Trying to correct this issue by adding an annotation conflicts with mypy, since mypy will then raise an error:
src/click/types.py:658: error: Cannot override class variable (previously declared on base class "ParamType") with instance variable [misc]
I've left it so mypy remains passing.
- fixes #2268
Checklist:
- [ ] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
- [ ] Add or update relevant docs, in the docs folder and in code.
- [x] Add an entry in
CHANGES.rstsummarizing the change and linking to the issue. - [ ] Add
.. versionchanged::entries in any relevant code docs. - [x] Run
pre-commithooks and fix any issues. - [x] Run
pytestandtox, no tests failed.