argcomplete 3.6.0__tar.gz → 3.6.2__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.0 → argcomplete-3.6.2}/Changes.rst +18 -0
  2. {argcomplete-3.6.0 → argcomplete-3.6.2}/PKG-INFO +1 -1
  3. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/bash_completion.d/_python-argcomplete +0 -6
  4. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/finders.py +1 -1
  5. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/packages/_shlex.py +3 -0
  6. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/scripts/activate_global_python_argcomplete.py +26 -3
  7. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/shell_integration.py +2 -7
  8. {argcomplete-3.6.0 → argcomplete-3.6.2}/docs/conf.py +1 -1
  9. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/test.py +2 -0
  10. {argcomplete-3.6.0 → argcomplete-3.6.2}/.github/FUNDING.yml +0 -0
  11. {argcomplete-3.6.0 → argcomplete-3.6.2}/.github/workflows/ci.yml +0 -0
  12. {argcomplete-3.6.0 → argcomplete-3.6.2}/.github/workflows/release.yml +0 -0
  13. {argcomplete-3.6.0 → argcomplete-3.6.2}/.gitignore +0 -0
  14. {argcomplete-3.6.0 → argcomplete-3.6.2}/Authors.rst +0 -0
  15. {argcomplete-3.6.0 → argcomplete-3.6.2}/LICENSE.rst +0 -0
  16. {argcomplete-3.6.0 → argcomplete-3.6.2}/MANIFEST.in +0 -0
  17. {argcomplete-3.6.0 → argcomplete-3.6.2}/Makefile +0 -0
  18. {argcomplete-3.6.0 → argcomplete-3.6.2}/NOTICE +0 -0
  19. {argcomplete-3.6.0 → argcomplete-3.6.2}/README.rst +0 -0
  20. {argcomplete-3.6.0 → argcomplete-3.6.2}/SECURITY.md +0 -0
  21. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/__init__.py +0 -0
  22. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/_check_console_script.py +0 -0
  23. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/_check_module.py +0 -0
  24. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/completers.py +0 -0
  25. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/exceptions.py +0 -0
  26. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/io.py +0 -0
  27. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/lexers.py +0 -0
  28. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/packages/__init__.py +0 -0
  29. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/packages/_argparse.py +0 -0
  30. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/py.typed +0 -0
  31. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/scripts/__init__.py +0 -0
  32. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/scripts/python_argcomplete_check_easy_install_script.py +0 -0
  33. {argcomplete-3.6.0 → argcomplete-3.6.2}/argcomplete/scripts/register_python_argcomplete.py +0 -0
  34. {argcomplete-3.6.0 → argcomplete-3.6.2}/common.mk +0 -0
  35. {argcomplete-3.6.0 → argcomplete-3.6.2}/contrib/README.rst +0 -0
  36. {argcomplete-3.6.0 → argcomplete-3.6.2}/docs/changelog.rst +0 -0
  37. {argcomplete-3.6.0 → argcomplete-3.6.2}/docs/examples/describe_github_user.py +0 -0
  38. {argcomplete-3.6.0 → argcomplete-3.6.2}/docs/fish_help_string.png +0 -0
  39. {argcomplete-3.6.0 → argcomplete-3.6.2}/docs/index.rst +0 -0
  40. {argcomplete-3.6.0 → argcomplete-3.6.2}/docs/toc.html +0 -0
  41. {argcomplete-3.6.0 → argcomplete-3.6.2}/pyproject.toml +0 -0
  42. {argcomplete-3.6.0 → argcomplete-3.6.2}/setup.cfg +0 -0
  43. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/__init__.py +0 -0
  44. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/inputrc +0 -0
  45. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/prog +0 -0
  46. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/stuck +0 -0
  47. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/test_contrib_shells.py +0 -0
  48. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/test_package/__init__.py +0 -0
  49. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/test_package/setup.py +0 -0
  50. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/test_package/test_module.py +0 -0
  51. {argcomplete-3.6.0 → argcomplete-3.6.2}/test/test_package/test_package/__init__.py +0 -0
@@ -1,3 +1,21 @@
1
+ Changes for v3.6.2 (2025-04-02)
2
+ ===============================
3
+
4
+ - Revert “zsh: skip repeat Python runs in the same completion run” This
5
+ reverts a regression introduced in zsh tab completion configurations
6
+ utilizing multiple matchers.
7
+
8
+ Changes for v3.6.1 (2025-03-22)
9
+ ===============================
10
+
11
+ - zsh: add global completion system install dir to user fpath if not
12
+ present
13
+
14
+ - Update shell_integration.py to support spaces in script file path.
15
+ (#525)
16
+
17
+ - Fix completion when wordbreak is first character (#526)
18
+
1
19
  Changes for v3.6.0 (2025-03-05)
2
20
  ===============================
3
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: argcomplete
3
- Version: 3.6.0
3
+ Version: 3.6.2
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
@@ -124,12 +124,6 @@ __python_argcomplete_which() {
124
124
  _python_argcomplete_global() {
125
125
 
126
126
  if [[ -n "${ZSH_VERSION-}" ]]; then
127
- if [[ "${_matcher_num-}" -gt 1 ]]; then
128
- # Return early if the completer is called multiple times in the same completion run.
129
- # Currently the only known occurrence of this is in zsh when a matcher-list zstyle is declared.
130
- # When this happens, _matcher_num is incremented past 1.
131
- return
132
- fi
133
127
  # Store result of a regex match in the
134
128
  # BASH_REMATCH variable rather than MATCH
135
129
  setopt local_options BASH_REMATCH
@@ -515,7 +515,7 @@ class CompletionFinder(object):
515
515
  # Bash mangles completions which contain characters in COMP_WORDBREAKS.
516
516
  # This workaround has the same effect as __ltrim_colon_completions in bash_completion
517
517
  # (extended to characters other than the colon).
518
- if last_wordbreak_pos:
518
+ if last_wordbreak_pos is not None:
519
519
  completions = [c[last_wordbreak_pos + 1 :] for c in completions]
520
520
  special_chars += "();<>|&!`$* \t\n\"'"
521
521
  elif cword_prequote == '"':
@@ -177,6 +177,9 @@ class shlex:
177
177
  elif self.whitespace_split:
178
178
  self.token = nextchar
179
179
  self.state = 'a'
180
+ # Modified by argcomplete: Record last wordbreak position
181
+ if nextchar in self.wordbreaks:
182
+ self.last_wordbreak_pos = len(self.token) - 1
180
183
  else:
181
184
  self.token = nextchar
182
185
  if self.token or (self.posix and quoted):
@@ -122,15 +122,36 @@ def append_to_config_file(path, shellcode):
122
122
  print("Added.", file=sys.stderr)
123
123
 
124
124
 
125
- def link_user_rcfiles():
126
- # TODO: warn if running as superuser
125
+ def link_zsh_user_rcfile(zsh_fpath=None):
127
126
  zsh_rcfile = os.path.join(os.path.expanduser(os.environ.get("ZDOTDIR", "~")), ".zshenv")
128
- append_to_config_file(zsh_rcfile, zsh_shellcode.format(zsh_fpath=get_activator_dir()))
127
+ append_to_config_file(zsh_rcfile, zsh_shellcode.format(zsh_fpath=zsh_fpath or get_activator_dir()))
129
128
 
129
+
130
+ def link_bash_user_rcfile():
130
131
  bash_completion_user_file = os.path.expanduser("~/.bash_completion")
131
132
  append_to_config_file(bash_completion_user_file, bash_shellcode.format(activator=get_activator_path()))
132
133
 
133
134
 
135
+ def link_user_rcfiles():
136
+ # TODO: warn if running as superuser
137
+ link_zsh_user_rcfile()
138
+ link_bash_user_rcfile()
139
+
140
+
141
+ def add_zsh_system_dir_to_fpath_for_user():
142
+ if "zsh" not in os.environ.get("SHELL", ""):
143
+ return
144
+ try:
145
+ zsh_system_dir = get_zsh_system_dir()
146
+ fpath_output = subprocess.check_output([os.environ["SHELL"], "-c", 'printf "%s\n" "${fpath[@]}"'])
147
+ for fpath in fpath_output.decode().splitlines():
148
+ if fpath == zsh_system_dir:
149
+ return
150
+ link_zsh_user_rcfile(zsh_fpath=zsh_system_dir)
151
+ except (FileNotFoundError, subprocess.CalledProcessError):
152
+ pass
153
+
154
+
134
155
  def main():
135
156
  global args
136
157
  args = parser.parse_args()
@@ -160,6 +181,8 @@ def main():
160
181
  for destination in destinations:
161
182
  install_to_destination(destination)
162
183
 
184
+ add_zsh_system_dir_to_fpath_for_user()
185
+
163
186
  if args.dest is None:
164
187
  print("Please restart your shell or source the installed file to activate it.", file=sys.stderr)
165
188
 
@@ -34,12 +34,6 @@ _python_argcomplete%(function_suffix)s() {
34
34
  local IFS=$'\013'
35
35
  local script="%(argcomplete_script)s"
36
36
  if [[ -n "${ZSH_VERSION-}" ]]; then
37
- if [[ "${_matcher_num-}" -gt 1 ]]; then
38
- # Return early if the completer is called multiple times in the same completion run.
39
- # Currently the only known occurrence of this is in zsh when a matcher-list zstyle is declared.
40
- # When this happens, _matcher_num is incremented past 1.
41
- return
42
- fi
43
37
  local completions
44
38
  completions=($(IFS="$IFS" \
45
39
  COMP_LINE="$BUFFER" \
@@ -166,7 +160,8 @@ def shellcode(executables, use_defaults=True, shell="bash", complete_arguments=N
166
160
  executables_list = " ".join(quoted_executables)
167
161
  script = argcomplete_script
168
162
  if script:
169
- function_suffix = "_" + script
163
+ # If the script path contain a space, this would generate an invalid function name.
164
+ function_suffix = "_" + script.replace(" ", "_SPACE_")
170
165
  else:
171
166
  script = ""
172
167
  function_suffix = ""
@@ -21,7 +21,7 @@ autodoc_member_order = "bysource"
21
21
  autodoc_typehints = "description"
22
22
  autodoc_typehints_description_target = "documented_params"
23
23
  intersphinx_mapping = {
24
- "https://docs.python.org/3": None,
24
+ "python": ("https://docs.python.org/3", None),
25
25
  }
26
26
  templates_path = [""]
27
27
  ogp_site_url = "https://kislyuk.github.io/" + project
@@ -1041,10 +1041,12 @@ class TestSplitLine(unittest.TestCase):
1041
1041
 
1042
1042
  def test_last_wordbreak_pos(self):
1043
1043
  self.assertEqual(self.wordbreak("a"), None)
1044
+ self.assertEqual(self.wordbreak("a :b"), 0)
1044
1045
  self.assertEqual(self.wordbreak("a b:c"), 1)
1045
1046
  self.assertEqual(self.wordbreak("a b:c=d"), 3)
1046
1047
  self.assertEqual(self.wordbreak("a b:c=d "), None)
1047
1048
  self.assertEqual(self.wordbreak("a b:c=d e"), None)
1049
+ self.assertEqual(self.wordbreak('":b'), None)
1048
1050
  self.assertEqual(self.wordbreak('"b:c'), None)
1049
1051
  self.assertEqual(self.wordbreak('"b:c=d'), None)
1050
1052
  self.assertEqual(self.wordbreak('"b:c=d"'), None)
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