Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions traitlets/config/argcomplete_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion traitlets/config/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading