Fix shell auto-completion#2091
Conversation
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
f97e708 to
f8b858d
Compare
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2091 +/- ##
==========================================
+ Coverage 59.91% 60.68% +0.76%
==========================================
Files 164 164
Lines 20557 20561 +4
Branches 3571 3570 -1
==========================================
+ Hits 12317 12477 +160
+ Misses 7370 7215 -155
+ Partials 870 869 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
0d66d72 to
83077cb
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates Rez’s vendored argcomplete and related shell integration to restore working shell auto-completion (including Python 3.12), and adds regression tests to prevent future breakage.
Changes:
- Bump vendored
argcompleteto 3.6.3 and update multiple integration points (shell code generation, finders/lexing, argparse introspection, global completion loader). - Add vendored
argcompletehelper scripts for registration and global activation. - Add CLI completion regression tests covering both
argcomplete.autocomplete()and Rez’s_rez-completeentry point.
Reviewed changes
Copilot reviewed 2 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/rez/vendor/README.md | Updates vendored argcomplete version metadata/date. |
| src/rez/vendor/argcomplete/shell_integration.py | Updates generated bash/zsh/fish completion shellcode and script handling. |
| src/rez/vendor/argcomplete/scripts/register_python_argcomplete.py | Adds vendored register-python-argcomplete helper script. |
| src/rez/vendor/argcomplete/scripts/python_argcomplete_check_easy_install_script.py | Adds vendored easy_install wrapper check script. |
| src/rez/vendor/argcomplete/scripts/activate_global_python_argcomplete.py | Adds vendored global activation helper. |
| src/rez/vendor/argcomplete/packages/_shlex.py | Tracks last wordbreak position for quoting/ltrim logic. |
| src/rez/vendor/argcomplete/packages/_argparse.py | Updates argparse introspection for newer Python tuple shapes/signatures. |
| src/rez/vendor/argcomplete/finders.py | Refactors debug stream init, help expansion, quoting/escaping behavior. |
| src/rez/vendor/argcomplete/completers.py | Adjusts completer base typing and bash compgen workaround. |
| src/rez/vendor/argcomplete/bash_completion.d/_python-argcomplete | Updates global completion loader logic for zsh/bashed usage. |
| src/rez/vendor/argcomplete/_check_module.py | Updates module resolution logic for python -m ... marker checks. |
| src/rez/vendor/argcomplete/_check_console_script.py | Updates console_script entry point lookup for Python 3.12+. |
| src/rez/tests/test_cli.py | Adds regression tests for subcommand/option completion behavior. |
| src/rez/cli/_complete_util.py | Updates RezCompletionFinder COMP_POINT encoding translation and initialization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
maxnbk
left a comment
There was a problem hiding this comment.
I only glanced over the code, but a local test of gitbash sourcing the completion .sh allowed me to autocomplete to a package name I have available, which explodes in a stacktrace on main, so I'll mark approved.
d415b96
into
AcademySoftwareFoundation:main
Auto completion in shells was broken by the last update of argcomplete we did in 2025. This PR fixes that and also adds a test to make sure we don't regress on this anymore in the future.
Autocomplete was also broken on Python 3.12, which requires a newer argcomplete version. So I also updated argcomplete.
Note that the tests have been AI generated. You can see my LLM session at https://ampcode.com/threads/T-019debb1-9b44-75c1-b786-0ff399afec9e. I also create a follow-up session to get even more coverage: https://ampcode.com/threads/T-019debfb-1e29-772e-8d45-6f613e7a25aa. Total cost is $15 US.