Skip to content

If argcomplete is available, use it for CLI completions - #8008

Merged
bwoodsend merged 3 commits into
pyinstaller:developfrom
singingwolfboy:argcomplete
Oct 16, 2023
Merged

bwoodsend merged 3 commits into
pyinstaller:developfrom
singingwolfboy:argcomplete

Conversation

@singingwolfboy

Copy link
Copy Markdown
Contributor

argcomplete adds tab completion for Python CLIs build with the argparse module. This pull request sets up the PyInstaller CLIs to use argcomplete if it's installed, but if it's not installed, users can still use the PyInstaller CLIs without tab completion. In addition, this PR adds an "extra" requirement named "completion", so if users run pip install pyinstaller[completion], then Pip will install PyInstaller and argcomplete.

I've also added a new CI runner to run the tests with this extra installed, just to verify that the code still behaves as expected -- but since this is such a small change, I didn't think it was worth doubling the number of runners (one with argcomplete and one without, for every combination of python-version and os), so this CI runner only runs on Ubuntu with the latest version of Python.

@bwoodsend

Copy link
Copy Markdown
Member

I remember last time I tried to integrate argcomplete, it was unusably slow it because PyInstaller's horrendous startup time was added to every time your hit tab. That convinced me that shtab would be a much better candidate (#7500) but trying it out again now, the delay is alright (possibly due to our no longer having to load pkg_resources on startup), and argcomplete does seem easier to use (both our code and user side setup).

Comment thread .github/workflows/ci.yml Outdated
@bwoodsend
bwoodsend merged commit 46eb239 into pyinstaller:develop Oct 16, 2023
@bwoodsend

Copy link
Copy Markdown
Member

Thanks @singingwolfboy!

@bwoodsend bwoodsend mentioned this pull request Oct 16, 2023
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants