argcomplete 3.2.3__tar.gz → 3.4.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 (63) hide show
  1. {argcomplete-3.2.3 → argcomplete-3.4.0}/Changes.rst +26 -0
  2. {argcomplete-3.2.3/argcomplete.egg-info → argcomplete-3.4.0}/PKG-INFO +1 -1
  3. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/bash_completion.d/_python-argcomplete +3 -2
  4. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/packages/_argparse.py +4 -1
  5. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/shell_integration.py +2 -2
  6. {argcomplete-3.2.3 → argcomplete-3.4.0/argcomplete.egg-info}/PKG-INFO +1 -1
  7. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete.egg-info/SOURCES.txt +9 -1
  8. {argcomplete-3.2.3 → argcomplete-3.4.0}/pyproject.toml +3 -0
  9. argcomplete-3.4.0/test/stuck +6 -0
  10. {argcomplete-3.2.3 → argcomplete-3.4.0}/test/test.py +5 -1
  11. argcomplete-3.4.0/test/test_package/test_module.py +6 -0
  12. argcomplete-3.4.0/test/test_package/test_package/__init__.py +16 -0
  13. argcomplete-3.4.0/test/test_package/test_package.egg-info/PKG-INFO +3 -0
  14. argcomplete-3.4.0/test/test_package/test_package.egg-info/SOURCES.txt +8 -0
  15. argcomplete-3.4.0/test/test_package/test_package.egg-info/dependency_links.txt +1 -0
  16. argcomplete-3.4.0/test/test_package/test_package.egg-info/entry_points.txt +3 -0
  17. argcomplete-3.4.0/test/test_package/test_package.egg-info/top_level.txt +2 -0
  18. {argcomplete-3.2.3 → argcomplete-3.4.0}/.github/FUNDING.yml +0 -0
  19. {argcomplete-3.2.3 → argcomplete-3.4.0}/.github/workflows/ci.yml +0 -0
  20. {argcomplete-3.2.3 → argcomplete-3.4.0}/.gitignore +0 -0
  21. {argcomplete-3.2.3 → argcomplete-3.4.0}/Authors.rst +0 -0
  22. {argcomplete-3.2.3 → argcomplete-3.4.0}/LICENSE.rst +0 -0
  23. {argcomplete-3.2.3 → argcomplete-3.4.0}/MANIFEST.in +0 -0
  24. {argcomplete-3.2.3 → argcomplete-3.4.0}/Makefile +0 -0
  25. {argcomplete-3.2.3 → argcomplete-3.4.0}/NOTICE +0 -0
  26. {argcomplete-3.2.3 → argcomplete-3.4.0}/README.rst +0 -0
  27. {argcomplete-3.2.3 → argcomplete-3.4.0}/SECURITY.md +0 -0
  28. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/__init__.py +0 -0
  29. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/_check_console_script.py +0 -0
  30. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/_check_module.py +0 -0
  31. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/completers.py +0 -0
  32. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/exceptions.py +0 -0
  33. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/finders.py +0 -0
  34. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/io.py +0 -0
  35. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/lexers.py +0 -0
  36. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/packages/__init__.py +0 -0
  37. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/packages/_shlex.py +0 -0
  38. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete/py.typed +0 -0
  39. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete.egg-info/dependency_links.txt +0 -0
  40. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete.egg-info/not-zip-safe +0 -0
  41. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete.egg-info/requires.txt +0 -0
  42. {argcomplete-3.2.3 → argcomplete-3.4.0}/argcomplete.egg-info/top_level.txt +0 -0
  43. {argcomplete-3.2.3 → argcomplete-3.4.0}/common.mk +0 -0
  44. {argcomplete-3.2.3 → argcomplete-3.4.0}/contrib/README.rst +0 -0
  45. {argcomplete-3.2.3 → argcomplete-3.4.0}/docs/changelog.rst +0 -0
  46. {argcomplete-3.2.3 → argcomplete-3.4.0}/docs/conf.py +0 -0
  47. {argcomplete-3.2.3 → argcomplete-3.4.0}/docs/examples/describe_github_user.py +0 -0
  48. {argcomplete-3.2.3 → argcomplete-3.4.0}/docs/fish_help_string.png +0 -0
  49. {argcomplete-3.2.3 → argcomplete-3.4.0}/docs/index.rst +0 -0
  50. {argcomplete-3.2.3 → argcomplete-3.4.0}/docs/toc.html +0 -0
  51. {argcomplete-3.2.3 → argcomplete-3.4.0}/scripts/activate-global-python-argcomplete +0 -0
  52. {argcomplete-3.2.3 → argcomplete-3.4.0}/scripts/python-argcomplete-check-easy-install-script +0 -0
  53. {argcomplete-3.2.3 → argcomplete-3.4.0}/scripts/register-python-argcomplete +0 -0
  54. {argcomplete-3.2.3 → argcomplete-3.4.0}/setup.cfg +0 -0
  55. {argcomplete-3.2.3 → argcomplete-3.4.0}/setup.py +0 -0
  56. {argcomplete-3.2.3 → argcomplete-3.4.0}/test/__init__.py +0 -0
  57. {argcomplete-3.2.3 → argcomplete-3.4.0}/test/inputrc +0 -0
  58. {argcomplete-3.2.3 → argcomplete-3.4.0}/test/prog +0 -0
  59. {argcomplete-3.2.3 → argcomplete-3.4.0}/test/test_contrib_shells.py +0 -0
  60. {argcomplete-3.2.3 → argcomplete-3.4.0}/test/test_package/__init__.py +0 -0
  61. {argcomplete-3.2.3/test/test_package → argcomplete-3.4.0/test/test_package/build/lib}/test_module.py +0 -0
  62. {argcomplete-3.2.3/test/test_package → argcomplete-3.4.0/test/test_package/build/lib}/test_package/__init__.py +0 -0
  63. {argcomplete-3.2.3 → argcomplete-3.4.0}/test/test_package/setup.py +0 -0
@@ -1,3 +1,29 @@
1
+ Changes for v3.4.0 (2024-06-16)
2
+ ===============================
3
+
4
+ - No stdin for python calls from bash completion functions (#488)
5
+
6
+ Prevents usage of stdin by (python) executables that are called
7
+ during completion generation. This prevents the completion locking up
8
+ the entire shell when the python script is broken i.e. it enters an
9
+ interactive mode (REPL) instead of generating the completions, as
10
+ expected.
11
+
12
+ - Localize shell variable REPLY to avoid overwriting users’ value
13
+ (#489)
14
+
15
+ The variable REPLY is used by default by the ``read`` shell builtin
16
+ to store the return value, and like all bash/zsh variables, is scoped
17
+ globally. This change allows this variable to be used for other needs
18
+ by appropriately scoping its internal use by an argcomplete utility
19
+ function that uses ``read``.
20
+
21
+ Changes for v3.3.0 (2024-04-14)
22
+ ===============================
23
+
24
+ - Preserve compatibility with argparse option tuples of length 4. This
25
+ update is required to use argcomplete on Python 3.11.9+ or 3.12.3+.
26
+
1
27
  Changes for v3.2.3 (2024-03-07)
2
28
  ===============================
3
29
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: argcomplete
3
- Version: 3.2.3
3
+ Version: 3.4.0
4
4
  Summary: Bash tab completion for argparse
5
5
  Home-page: https://github.com/kislyuk/argcomplete
6
6
  Author: Andrey Kislyuk
@@ -46,9 +46,9 @@ __python_argcomplete_run() {
46
46
 
47
47
  __python_argcomplete_run_inner() {
48
48
  if [[ -z "${_ARC_DEBUG-}" ]]; then
49
- "$@" 8>&1 9>&2 1>/dev/null 2>&1
49
+ "$@" 8>&1 9>&2 1>/dev/null 2>&1 </dev/null
50
50
  else
51
- "$@" 8>&1 9>&2 1>&9 2>&1
51
+ "$@" 8>&1 9>&2 1>&9 2>&1 </dev/null
52
52
  fi
53
53
  }
54
54
 
@@ -76,6 +76,7 @@ __python_argcomplete_scan_head() {
76
76
  local file="$1"
77
77
  local target="$2"
78
78
 
79
+ local REPLY
79
80
  if [[ -n "${ZSH_VERSION-}" ]]; then
80
81
  read -r -k 1024 -u 0 < "$file";
81
82
  else
@@ -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)
@@ -24,9 +24,9 @@ __python_argcomplete_run() {
24
24
 
25
25
  __python_argcomplete_run_inner() {
26
26
  if [[ -z "${_ARC_DEBUG-}" ]]; then
27
- "$@" 8>&1 9>&2 1>/dev/null 2>&1
27
+ "$@" 8>&1 9>&2 1>/dev/null 2>&1 </dev/null
28
28
  else
29
- "$@" 8>&1 9>&2 1>&9 2>&1
29
+ "$@" 8>&1 9>&2 1>&9 2>&1 </dev/null
30
30
  fi
31
31
  }
32
32
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: argcomplete
3
- Version: 3.2.3
3
+ Version: 3.4.0
4
4
  Summary: Bash tab completion for argparse
5
5
  Home-page: https://github.com/kislyuk/argcomplete
6
6
  Author: Andrey Kislyuk
@@ -46,9 +46,17 @@ scripts/register-python-argcomplete
46
46
  test/__init__.py
47
47
  test/inputrc
48
48
  test/prog
49
+ test/stuck
49
50
  test/test.py
50
51
  test/test_contrib_shells.py
51
52
  test/test_package/__init__.py
52
53
  test/test_package/setup.py
53
54
  test/test_package/test_module.py
54
- test/test_package/test_package/__init__.py
55
+ test/test_package/build/lib/test_module.py
56
+ test/test_package/build/lib/test_package/__init__.py
57
+ test/test_package/test_package/__init__.py
58
+ test/test_package/test_package.egg-info/PKG-INFO
59
+ test/test_package/test_package.egg-info/SOURCES.txt
60
+ test/test_package/test_package.egg-info/dependency_links.txt
61
+ test/test_package/test_package.egg-info/entry_points.txt
62
+ 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
+ #!/usr/bin/env python
2
+ # PYTHON_ARGCOMPLETE_OK
3
+ from sys import argv
4
+
5
+ if argv[1:] != ["no-input"]:
6
+ input()
@@ -73,7 +73,7 @@ def _repl_sh(command, args, non_printable_insert):
73
73
 
74
74
 
75
75
  def bash_repl(command="bash"):
76
- bashrc = os.path.join(os.path.dirname(pexpect.__file__), "replwrap", "bashrc.sh")
76
+ bashrc = os.path.join(os.path.dirname(pexpect.__file__), "bashrc.sh")
77
77
  sh = _repl_sh(command, ["--rcfile", bashrc], non_printable_insert="\\[\\]")
78
78
  return sh
79
79
 
@@ -1348,6 +1348,10 @@ class TestBashZshGlobalBase(TestBashZshBase):
1348
1348
  self.sh.run_command("cd " + TEST_DIR)
1349
1349
  self.assertEqual(self.sh.run_command("python3 ./pro\tbasic f\t"), "foo\r\n")
1350
1350
 
1351
+ def test_python_stuck(self):
1352
+ self.sh.run_command("cd " + TEST_DIR)
1353
+ self.sh.run_command("python3 ./stuck no\t-input")
1354
+
1351
1355
  def test_python_not_executable(self):
1352
1356
  """Test completing a script that cannot be run directly."""
1353
1357
  prog = os.path.join(TEST_DIR, "prog")
@@ -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