argcomplete 3.6.2__tar.gz → 3.6.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {argcomplete-3.6.2 → argcomplete-3.6.3}/Changes.rst +12 -0
  2. {argcomplete-3.6.2 → argcomplete-3.6.3}/PKG-INFO +2 -2
  3. {argcomplete-3.6.2 → argcomplete-3.6.3}/README.rst +1 -1
  4. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/bash_completion.d/_python-argcomplete +3 -2
  5. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/finders.py +13 -3
  6. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/scripts/activate_global_python_argcomplete.py +3 -1
  7. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/shell_integration.py +9 -9
  8. {argcomplete-3.6.2 → argcomplete-3.6.3}/contrib/README.rst +8 -0
  9. {argcomplete-3.6.2 → argcomplete-3.6.3}/.github/FUNDING.yml +0 -0
  10. {argcomplete-3.6.2 → argcomplete-3.6.3}/.github/workflows/ci.yml +0 -0
  11. {argcomplete-3.6.2 → argcomplete-3.6.3}/.github/workflows/release.yml +0 -0
  12. {argcomplete-3.6.2 → argcomplete-3.6.3}/.gitignore +0 -0
  13. {argcomplete-3.6.2 → argcomplete-3.6.3}/Authors.rst +0 -0
  14. {argcomplete-3.6.2 → argcomplete-3.6.3}/LICENSE.rst +0 -0
  15. {argcomplete-3.6.2 → argcomplete-3.6.3}/MANIFEST.in +0 -0
  16. {argcomplete-3.6.2 → argcomplete-3.6.3}/Makefile +0 -0
  17. {argcomplete-3.6.2 → argcomplete-3.6.3}/NOTICE +0 -0
  18. {argcomplete-3.6.2 → argcomplete-3.6.3}/SECURITY.md +0 -0
  19. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/__init__.py +0 -0
  20. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/_check_console_script.py +0 -0
  21. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/_check_module.py +0 -0
  22. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/completers.py +0 -0
  23. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/exceptions.py +0 -0
  24. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/io.py +0 -0
  25. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/lexers.py +0 -0
  26. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/packages/__init__.py +0 -0
  27. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/packages/_argparse.py +0 -0
  28. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/packages/_shlex.py +0 -0
  29. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/py.typed +0 -0
  30. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/scripts/__init__.py +0 -0
  31. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/scripts/python_argcomplete_check_easy_install_script.py +0 -0
  32. {argcomplete-3.6.2 → argcomplete-3.6.3}/argcomplete/scripts/register_python_argcomplete.py +0 -0
  33. {argcomplete-3.6.2 → argcomplete-3.6.3}/common.mk +0 -0
  34. {argcomplete-3.6.2 → argcomplete-3.6.3}/docs/changelog.rst +0 -0
  35. {argcomplete-3.6.2 → argcomplete-3.6.3}/docs/conf.py +0 -0
  36. {argcomplete-3.6.2 → argcomplete-3.6.3}/docs/examples/describe_github_user.py +0 -0
  37. {argcomplete-3.6.2 → argcomplete-3.6.3}/docs/fish_help_string.png +0 -0
  38. {argcomplete-3.6.2 → argcomplete-3.6.3}/docs/index.rst +0 -0
  39. {argcomplete-3.6.2 → argcomplete-3.6.3}/docs/toc.html +0 -0
  40. {argcomplete-3.6.2 → argcomplete-3.6.3}/pyproject.toml +0 -0
  41. {argcomplete-3.6.2 → argcomplete-3.6.3}/setup.cfg +0 -0
  42. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/__init__.py +0 -0
  43. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/inputrc +0 -0
  44. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/prog +0 -0
  45. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/stuck +0 -0
  46. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/test.py +0 -0
  47. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/test_contrib_shells.py +0 -0
  48. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/test_package/__init__.py +0 -0
  49. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/test_package/setup.py +0 -0
  50. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/test_package/test_module.py +0 -0
  51. {argcomplete-3.6.2 → argcomplete-3.6.3}/test/test_package/test_package/__init__.py +0 -0
@@ -1,3 +1,15 @@
1
+ Changes for v3.6.3 (2025-10-19)
2
+ ===============================
3
+
4
+ - Make RE PCRE compatible. Fixes #539
5
+
6
+ - Only execute Python interpreters (#536)
7
+
8
+ - fish: set variable scope to local to avoid clobbering global or
9
+ universal variables (#534)
10
+
11
+ - Documentation and help improvements
12
+
1
13
  Changes for v3.6.2 (2025-04-02)
2
14
  ===============================
3
15
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: argcomplete
3
- Version: 3.6.2
3
+ Version: 3.6.3
4
4
  Summary: Bash tab completion for argparse
5
5
  Project-URL: Homepage, https://github.com/kislyuk/argcomplete
6
6
  Project-URL: Documentation, https://kislyuk.github.io/argcomplete
@@ -51,7 +51,7 @@ Argcomplete provides easy, extensible command line tab completion of arguments f
51
51
 
52
52
  It makes two assumptions:
53
53
 
54
- * You're using bash or zsh as your shell
54
+ * You're using bash or zsh as your shell (limited support exists for other shells - see below)
55
55
  * You're using `argparse <http://docs.python.org/3/library/argparse.html>`_ to manage your command line arguments/options
56
56
 
57
57
  Argcomplete is particularly useful if your program has lots of options or subparsers, and if your program can
@@ -6,7 +6,7 @@ Argcomplete provides easy, extensible command line tab completion of arguments f
6
6
 
7
7
  It makes two assumptions:
8
8
 
9
- * You're using bash or zsh as your shell
9
+ * You're using bash or zsh as your shell (limited support exists for other shells - see below)
10
10
  * You're using `argparse <http://docs.python.org/3/library/argparse.html>`_ to manage your command line arguments/options
11
11
 
12
12
  Argcomplete is particularly useful if your program has lots of options or subparsers, and if your program can
@@ -193,7 +193,8 @@ _python_argcomplete_global() {
193
193
  if (__python_argcomplete_scan_head_noerr "$SCRIPT_NAME" easy_install \
194
194
  && "${interpreter[@]}" "$(__python_argcomplete_which python-argcomplete-check-easy-install-script)" "$SCRIPT_NAME") >/dev/null 2>&1; then
195
195
  ARGCOMPLETE=1
196
- elif __python_argcomplete_run "${interpreter[@]}" -m argcomplete._check_console_script "$SCRIPT_NAME"; then
196
+ elif ([[ "${interpreter[@]}" == *python* ]] || [[ "${interpreter[@]}" == *pypy* ]])\
197
+ && __python_argcomplete_run "${interpreter[@]}" -m argcomplete._check_console_script "$SCRIPT_NAME"; then
197
198
  ARGCOMPLETE=1
198
199
  fi
199
200
  fi
@@ -215,7 +216,7 @@ _python_argcomplete_global() {
215
216
  if is-at-least 5.8; then
216
217
  nosort=(-o nosort)
217
218
  fi
218
- if [[ "${completions-}" =~ ([^\\]): && "${BASH_REMATCH[2]}" =~ [=/:] ]]; then
219
+ if [[ "${completions-}" =~ ([^\\\\]): && "${BASH_REMATCH[2]}" =~ [=/:] ]]; then
219
220
  nospace=(-S '')
220
221
  fi
221
222
  _describe "$executable" completions "${nosort[@]}" "${nospace[@]}"
@@ -48,6 +48,7 @@ class CompletionFinder(object):
48
48
  append_space=None,
49
49
  ):
50
50
  self._parser = argument_parser
51
+ self._formatter = None
51
52
  self.always_complete_options = always_complete_options
52
53
  self.exclude = exclude
53
54
  if validator is None:
@@ -283,6 +284,15 @@ class CompletionFinder(object):
283
284
 
284
285
  return self.active_parsers
285
286
 
287
+ def _get_action_help(self, action):
288
+ if action.help is None:
289
+ return ""
290
+ if "%" not in action.help:
291
+ return action.help
292
+ if self._formatter is None:
293
+ self._formatter = self._parser.formatter_class(prog=self._parser.prog)
294
+ return self._formatter._expand_help(action)
295
+
286
296
  def _get_subparser_completions(self, parser, cword_prefix):
287
297
  aliases_by_parser: Dict[argparse.ArgumentParser, List[str]] = {}
288
298
  for key in parser.choices.keys():
@@ -292,7 +302,7 @@ class CompletionFinder(object):
292
302
  for action in parser._get_subactions():
293
303
  for alias in aliases_by_parser[parser.choices[action.dest]]:
294
304
  if alias.startswith(cword_prefix):
295
- self._display_completions[alias] = action.help or ""
305
+ self._display_completions[alias] = self._get_action_help(action)
296
306
 
297
307
  completions = [subcmd for subcmd in parser.choices.keys() if subcmd.startswith(cword_prefix)]
298
308
  return completions
@@ -313,7 +323,7 @@ class CompletionFinder(object):
313
323
  if action.option_strings:
314
324
  for option_string in action.option_strings:
315
325
  if option_string.startswith(cword_prefix):
316
- self._display_completions[option_string] = action.help or ""
326
+ self._display_completions[option_string] = self._get_action_help(action)
317
327
 
318
328
  option_completions = []
319
329
  for action in parser._actions:
@@ -405,7 +415,7 @@ class CompletionFinder(object):
405
415
  if self.validator(completion, cword_prefix):
406
416
  completions.append(completion)
407
417
  if isinstance(completer, ChoicesCompleter):
408
- self._display_completions[completion] = active_action.help or ""
418
+ self._display_completions[completion] = self._get_action_help(active_action)
409
419
  else:
410
420
  self._display_completions[completion] = ""
411
421
  else:
@@ -79,7 +79,9 @@ def install_to_destination(dest):
79
79
  try:
80
80
  os.makedirs(destdir, exist_ok=True)
81
81
  except Exception as e:
82
- parser.error(f"path {destdir} does not exist and could not be created: {e}")
82
+ parser.error(
83
+ f"path {destdir} does not exist and could not be created: {e}. Please run this command using sudo, or see --help for more options."
84
+ )
83
85
  try:
84
86
  print(f"Installing {activator} to {dest}...", file=sys.stderr)
85
87
  shutil.copy(activator, dest)
@@ -47,7 +47,7 @@ _python_argcomplete%(function_suffix)s() {
47
47
  if is-at-least 5.8; then
48
48
  nosort=(-o nosort)
49
49
  fi
50
- if [[ "${completions-}" =~ ([^\\]): && "${match[1]}" =~ [=/:] ]]; then
50
+ if [[ "${completions-}" =~ ([^\\\\]): && "${match[1]}" =~ [=/:] ]]; then
51
51
  nospace=(-S '')
52
52
  fi
53
53
  _describe "${words[1]}" completions "${nosort[@]}" "${nospace[@]}"
@@ -94,14 +94,14 @@ complete "%(executable)s" 'p@*@`python-argcomplete-tcsh "%(argcomplete_script)s"
94
94
 
95
95
  fishcode = r"""
96
96
  function __fish_%(function_name)s_complete
97
- set -x _ARGCOMPLETE 1
98
- set -x _ARGCOMPLETE_DFS \t
99
- set -x _ARGCOMPLETE_IFS \n
100
- set -x _ARGCOMPLETE_SUPPRESS_SPACE 1
101
- set -x _ARGCOMPLETE_SHELL fish
102
- set -x COMP_LINE (commandline -p)
103
- set -x COMP_POINT (string length (commandline -cp))
104
- set -x COMP_TYPE
97
+ set -lx _ARGCOMPLETE 1
98
+ set -lx _ARGCOMPLETE_DFS \t
99
+ set -lx _ARGCOMPLETE_IFS \n
100
+ set -lx _ARGCOMPLETE_SUPPRESS_SPACE 1
101
+ set -lx _ARGCOMPLETE_SHELL fish
102
+ set -lx COMP_LINE (commandline -p)
103
+ set -lx COMP_POINT (string length (commandline -cp))
104
+ set -lx COMP_TYPE
105
105
  if set -q _ARC_DEBUG
106
106
  %(argcomplete_script)s 8>&1 9>&2 1>&9 2>&1
107
107
  else
@@ -16,6 +16,14 @@ or create new completion file, e.g::
16
16
 
17
17
  register-python-argcomplete --shell fish my-awesome-script > ~/.config/fish/completions/my-awesome-script.fish
18
18
 
19
+ If the script is called using a path, such as ``./my-awesome-script``, it must be registered using the absolute path to the script. ::
20
+
21
+ register-python-argcomplete --shell fish $(realpath ./my-awesome-script) > ~/.config/fish/completions/my-awesome-script.fish
22
+
23
+ The completions using a path will not be automatically loaded since the command name does not match the file name. To load the completions, ``source`` them. ::
24
+
25
+ source ~/.config/fish/completions/my-awesome-script.fish
26
+
19
27
  Completion Description For Fish
20
28
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
29
  By default help string is added as completion description.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes