diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 21d674a1..da0fd131 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -59,7 +59,7 @@ repos: files: "^traitlets" stages: [manual] args: ["--install-types", "--non-interactive"] - additional_dependencies: ["argcomplete>=3.1"] + additional_dependencies: ["argcomplete>=3.7"] - repo: https://github.com/pre-commit/pygrep-hooks rev: "v1.10.0" diff --git a/traitlets/config/argcomplete_config.py b/traitlets/config/argcomplete_config.py index 1a411cec..7444a765 100644 --- a/traitlets/config/argcomplete_config.py +++ b/traitlets/config/argcomplete_config.py @@ -45,7 +45,7 @@ def get_argcomplete_cwords() -> list[str] | None: _cword_suffix, comp_words, _last_wordbreak_pos, - ) = argcomplete.split_line(comp_line, comp_point) # type:ignore[attr-defined,no-untyped-call] + ) = argcomplete.split_line(comp_line, comp_point) # type:ignore[attr-defined] except ModuleNotFoundError: return None @@ -73,7 +73,7 @@ def increment_argcomplete_index() -> None: os.environ["_ARGCOMPLETE"] = str(int(os.environ["_ARGCOMPLETE"]) + 1) except Exception: try: - argcomplete.debug("Unable to increment $_ARGCOMPLETE", os.environ["_ARGCOMPLETE"]) # type:ignore[attr-defined,no-untyped-call] + argcomplete.debug("Unable to increment $_ARGCOMPLETE", os.environ["_ARGCOMPLETE"]) # type:ignore[attr-defined] except (KeyError, ModuleNotFoundError): pass @@ -194,7 +194,7 @@ def _get_completions(self, comp_words: list[str], cword_prefix: str, *args: t.An # Instead, check if comp_words only consists of the script, # if so check if any subcommands start with cword_prefix. if self.subcommands and len(comp_words) == 1: - argcomplete.debug("Adding subcommands for", cword_prefix) # type:ignore[attr-defined,no-untyped-call] + argcomplete.debug("Adding subcommands for", cword_prefix) # type:ignore[attr-defined] completions.extend(subc for subc in self.subcommands if subc.startswith(cword_prefix)) return completions diff --git a/traitlets/config/loader.py b/traitlets/config/loader.py index 876f1186..379cd479 100644 --- a/traitlets/config/loader.py +++ b/traitlets/config/loader.py @@ -1133,7 +1133,7 @@ def _argcomplete(self, classes: list[t.Any], subcommands: SubcommandsDict | None from . import argcomplete_config - finder = argcomplete_config.ExtendedCompletionFinder() # type:ignore[no-untyped-call] + finder = argcomplete_config.ExtendedCompletionFinder() finder.config_classes = classes finder.subcommands = list(subcommands or []) # for ease of testing, pass through self._argcomplete_kwargs if set