argcomplete 3.2.2__tar.gz → 3.3.0__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 (62) hide show
  1. {argcomplete-3.2.2 → argcomplete-3.3.0}/Changes.rst +15 -0
  2. {argcomplete-3.2.2/argcomplete.egg-info → argcomplete-3.3.0}/PKG-INFO +1 -1
  3. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/_check_console_script.py +1 -0
  4. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/_check_module.py +1 -0
  5. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/finders.py +14 -5
  6. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/packages/_argparse.py +4 -1
  7. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/shell_integration.py +10 -2
  8. {argcomplete-3.2.2 → argcomplete-3.3.0/argcomplete.egg-info}/PKG-INFO +1 -1
  9. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete.egg-info/SOURCES.txt +8 -1
  10. {argcomplete-3.2.2 → argcomplete-3.3.0}/pyproject.toml +3 -0
  11. argcomplete-3.3.0/test/test_package/test_module.py +6 -0
  12. argcomplete-3.3.0/test/test_package/test_package/__init__.py +16 -0
  13. argcomplete-3.3.0/test/test_package/test_package.egg-info/PKG-INFO +3 -0
  14. argcomplete-3.3.0/test/test_package/test_package.egg-info/SOURCES.txt +8 -0
  15. argcomplete-3.3.0/test/test_package/test_package.egg-info/dependency_links.txt +1 -0
  16. argcomplete-3.3.0/test/test_package/test_package.egg-info/entry_points.txt +3 -0
  17. argcomplete-3.3.0/test/test_package/test_package.egg-info/top_level.txt +2 -0
  18. {argcomplete-3.2.2 → argcomplete-3.3.0}/.github/FUNDING.yml +0 -0
  19. {argcomplete-3.2.2 → argcomplete-3.3.0}/.github/workflows/ci.yml +0 -0
  20. {argcomplete-3.2.2 → argcomplete-3.3.0}/.gitignore +0 -0
  21. {argcomplete-3.2.2 → argcomplete-3.3.0}/Authors.rst +0 -0
  22. {argcomplete-3.2.2 → argcomplete-3.3.0}/LICENSE.rst +0 -0
  23. {argcomplete-3.2.2 → argcomplete-3.3.0}/MANIFEST.in +0 -0
  24. {argcomplete-3.2.2 → argcomplete-3.3.0}/Makefile +0 -0
  25. {argcomplete-3.2.2 → argcomplete-3.3.0}/NOTICE +0 -0
  26. {argcomplete-3.2.2 → argcomplete-3.3.0}/README.rst +0 -0
  27. {argcomplete-3.2.2 → argcomplete-3.3.0}/SECURITY.md +0 -0
  28. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/__init__.py +0 -0
  29. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/bash_completion.d/_python-argcomplete +0 -0
  30. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/completers.py +0 -0
  31. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/exceptions.py +0 -0
  32. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/io.py +0 -0
  33. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/lexers.py +0 -0
  34. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/packages/__init__.py +0 -0
  35. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/packages/_shlex.py +0 -0
  36. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete/py.typed +0 -0
  37. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete.egg-info/dependency_links.txt +0 -0
  38. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete.egg-info/not-zip-safe +0 -0
  39. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete.egg-info/requires.txt +0 -0
  40. {argcomplete-3.2.2 → argcomplete-3.3.0}/argcomplete.egg-info/top_level.txt +0 -0
  41. {argcomplete-3.2.2 → argcomplete-3.3.0}/common.mk +0 -0
  42. {argcomplete-3.2.2 → argcomplete-3.3.0}/contrib/README.rst +0 -0
  43. {argcomplete-3.2.2 → argcomplete-3.3.0}/docs/changelog.rst +0 -0
  44. {argcomplete-3.2.2 → argcomplete-3.3.0}/docs/conf.py +0 -0
  45. {argcomplete-3.2.2 → argcomplete-3.3.0}/docs/examples/describe_github_user.py +0 -0
  46. {argcomplete-3.2.2 → argcomplete-3.3.0}/docs/fish_help_string.png +0 -0
  47. {argcomplete-3.2.2 → argcomplete-3.3.0}/docs/index.rst +0 -0
  48. {argcomplete-3.2.2 → argcomplete-3.3.0}/docs/toc.html +0 -0
  49. {argcomplete-3.2.2 → argcomplete-3.3.0}/scripts/activate-global-python-argcomplete +0 -0
  50. {argcomplete-3.2.2 → argcomplete-3.3.0}/scripts/python-argcomplete-check-easy-install-script +0 -0
  51. {argcomplete-3.2.2 → argcomplete-3.3.0}/scripts/register-python-argcomplete +0 -0
  52. {argcomplete-3.2.2 → argcomplete-3.3.0}/setup.cfg +0 -0
  53. {argcomplete-3.2.2 → argcomplete-3.3.0}/setup.py +0 -0
  54. {argcomplete-3.2.2 → argcomplete-3.3.0}/test/__init__.py +0 -0
  55. {argcomplete-3.2.2 → argcomplete-3.3.0}/test/inputrc +0 -0
  56. {argcomplete-3.2.2 → argcomplete-3.3.0}/test/prog +0 -0
  57. {argcomplete-3.2.2 → argcomplete-3.3.0}/test/test.py +0 -0
  58. {argcomplete-3.2.2 → argcomplete-3.3.0}/test/test_contrib_shells.py +0 -0
  59. {argcomplete-3.2.2 → argcomplete-3.3.0}/test/test_package/__init__.py +0 -0
  60. {argcomplete-3.2.2/test/test_package → argcomplete-3.3.0/test/test_package/build/lib}/test_module.py +0 -0
  61. {argcomplete-3.2.2/test/test_package → argcomplete-3.3.0/test/test_package/build/lib}/test_package/__init__.py +0 -0
  62. {argcomplete-3.2.2 → argcomplete-3.3.0}/test/test_package/setup.py +0 -0
@@ -1,3 +1,18 @@
1
+ Changes for v3.3.0 (2024-04-14)
2
+ ===============================
3
+
4
+ - Preserve compatibility with argparse option tuples of length 4. This
5
+ update is required to use argcomplete on Python 3.11.9+ or 3.12.3+.
6
+
7
+ Changes for v3.2.3 (2024-03-07)
8
+ ===============================
9
+
10
+ - Allow register-python-argcomplete output to be used as lazy-loaded
11
+ zsh completion module (#475)
12
+
13
+ - Move debug_stream initialization to helper method to allow fd 9
14
+ behavior to be overridden in subclasses (#471)
15
+
1
16
  Changes for v3.2.2 (2024-01-23)
2
17
  ===============================
3
18
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: argcomplete
3
- Version: 3.2.2
3
+ Version: 3.3.0
4
4
  Summary: Bash tab completion for argparse
5
5
  Home-page: https://github.com/kislyuk/argcomplete
6
6
  Author: Andrey Kislyuk
@@ -11,6 +11,7 @@ https://setuptools.readthedocs.io/en/latest/setuptools.html#automatic-script-cre
11
11
 
12
12
  Intended to be invoked by argcomplete's global completion function.
13
13
  """
14
+
14
15
  import os
15
16
  import sys
16
17
  from importlib.metadata import EntryPoint
@@ -6,6 +6,7 @@ The module name should be specified in a form usable with `python -m`.
6
6
 
7
7
  Intended to be invoked by argcomplete's global completion function.
8
8
  """
9
+
9
10
  import os
10
11
  import sys
11
12
  import tokenize
@@ -117,11 +117,7 @@ class CompletionFinder(object):
117
117
  # not an argument completion invocation
118
118
  return
119
119
 
120
- try:
121
- _io.debug_stream = os.fdopen(9, "w")
122
- except Exception:
123
- _io.debug_stream = sys.stderr
124
- debug()
120
+ self._init_debug_stream()
125
121
 
126
122
  if output_stream is None:
127
123
  filename = os.environ.get("_ARGCOMPLETE_STDOUT_FILENAME")
@@ -190,6 +186,19 @@ class CompletionFinder(object):
190
186
  _io.debug_stream.flush()
191
187
  exit_method(0)
192
188
 
189
+ def _init_debug_stream(self):
190
+ """Initialize debug output stream
191
+
192
+ By default, writes to file descriptor 9, or stderr if that fails.
193
+ This can be overridden by derived classes, for example to avoid
194
+ clashes with file descriptors being used elsewhere (such as in pytest).
195
+ """
196
+ try:
197
+ _io.debug_stream = os.fdopen(9, "w")
198
+ except Exception:
199
+ _io.debug_stream = sys.stderr
200
+ debug()
201
+
193
202
  def _get_completions(self, comp_words, cword_prefix, cword_prequote, last_wordbreak_pos):
194
203
  active_parsers = self._patch_argument_parser()
195
204
 
@@ -162,7 +162,10 @@ class IntrospectiveArgumentParser(ArgumentParser):
162
162
  def consume_optional(start_index):
163
163
  # get the optional identified at this index
164
164
  option_tuple = option_string_indices[start_index]
165
- action, option_string, explicit_arg = option_tuple
165
+ if len(option_tuple) == 3:
166
+ action, option_string, explicit_arg = option_tuple
167
+ else: # Python 3.11.9+, 3.12.3+, 3.13+
168
+ action, option_string, _, explicit_arg = option_tuple
166
169
 
167
170
  # identify additional optionals in the same arg string
168
171
  # (e.g. -xyz is the same as -x -y -z if no args are required)
@@ -5,7 +5,7 @@
5
5
 
6
6
  from shlex import quote
7
7
 
8
- bashcode = r"""
8
+ bashcode = r"""#compdef %(executables)s
9
9
  # Run something, muting output or redirecting it to the debug stream
10
10
  # depending on the value of _ARC_DEBUG.
11
11
  # If ARGCOMPLETE_USE_TEMPFILES is set, use tempfiles for IPC.
@@ -75,8 +75,16 @@ _python_argcomplete%(function_suffix)s() {
75
75
  if [[ -z "${ZSH_VERSION-}" ]]; then
76
76
  complete %(complete_opts)s -F _python_argcomplete%(function_suffix)s %(executables)s
77
77
  else
78
+ # When called by the Zsh completion system, this will end with
79
+ # "loadautofunc" when initially autoloaded and "shfunc" later on, otherwise,
80
+ # the script was "eval"-ed so use "compdef" to register it with the
81
+ # completion system
78
82
  autoload is-at-least
79
- compdef _python_argcomplete%(function_suffix)s %(executables)s
83
+ if [[ $zsh_eval_context == *func ]]; then
84
+ _python_argcomplete%(function_suffix)s "$@"
85
+ else
86
+ compdef _python_argcomplete%(function_suffix)s %(executables)s
87
+ fi
80
88
  fi
81
89
  """
82
90
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: argcomplete
3
- Version: 3.2.2
3
+ Version: 3.3.0
4
4
  Summary: Bash tab completion for argparse
5
5
  Home-page: https://github.com/kislyuk/argcomplete
6
6
  Author: Andrey Kislyuk
@@ -51,4 +51,11 @@ test/test_contrib_shells.py
51
51
  test/test_package/__init__.py
52
52
  test/test_package/setup.py
53
53
  test/test_package/test_module.py
54
- test/test_package/test_package/__init__.py
54
+ test/test_package/build/lib/test_module.py
55
+ test/test_package/build/lib/test_package/__init__.py
56
+ test/test_package/test_package/__init__.py
57
+ test/test_package/test_package.egg-info/PKG-INFO
58
+ test/test_package/test_package.egg-info/SOURCES.txt
59
+ test/test_package/test_package.egg-info/dependency_links.txt
60
+ test/test_package/test_package.egg-info/entry_points.txt
61
+ test/test_package/test_package.egg-info/top_level.txt
@@ -59,6 +59,9 @@ skip = ".*/version.py"
59
59
  line-length = 120
60
60
  per-file-ignores = {"argcomplete/__init__.py" = ["F401"]}
61
61
 
62
+ [tool.ruff.format]
63
+ quote-style = "preserve"
64
+
62
65
  [tool.mypy]
63
66
  files = [
64
67
  "argcomplete"
@@ -0,0 +1,6 @@
1
+ # PYTHON_ARGCOMPLETE_OK
2
+
3
+ from test_package import main
4
+
5
+ if __name__ == "__main__":
6
+ main()
@@ -0,0 +1,16 @@
1
+ # PYTHON_ARGCOMPLETE_OK
2
+ import argparse
3
+
4
+ import argcomplete
5
+
6
+
7
+ def main():
8
+ parser = argparse.ArgumentParser()
9
+ parser.add_argument("arg", choices=["arg"])
10
+ argcomplete.autocomplete(parser)
11
+ args = parser.parse_args()
12
+ print(args.arg)
13
+
14
+
15
+ if __name__ == "__main__":
16
+ main()
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.1
2
+ Name: test-package
3
+ Version: 0
@@ -0,0 +1,8 @@
1
+ setup.py
2
+ test_module.py
3
+ test_package/__init__.py
4
+ test_package.egg-info/PKG-INFO
5
+ test_package.egg-info/SOURCES.txt
6
+ test_package.egg-info/dependency_links.txt
7
+ test_package.egg-info/entry_points.txt
8
+ test_package.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ test-module = test_module:main
3
+ test-package = test_package:main
@@ -0,0 +1,2 @@
1
+ test_module
2
+ test_package
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