Autocomplete after the eol command - #216
Conversation
for more information, see https://pre-commit.ci
|
Thanks for this!
Is |
|
Hello
Sorry no 😓 , it should be replaced by |
|
Thanks, so does the |
|
@hugovk the use of |
|
The ❯ activate-global-python-argcomplete
Defaulting to system-wide installation.
Installing /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/argcomplete/bash_completion.d/_python-argcomplete to /opt/homebrew/share/zsh/site-functions/_python-argcomplete...
Installed.
Installing /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/argcomplete/bash_completion.d/_python-argcomplete to /opt/homebrew/etc/bash_completion.d/python-argcomplete...
Installed.
Please restart your shell or source the installed file to activate it.And opened a new shell, but it's not completing: ❯ eol neDo you know why? |
|
Works on my side on new shell but only after I added the flag
|
|
Yes: ❯ head --lines 2 src/norwegianblue/cli.py
#!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
❯ pip install -e . --quiet
❯ eol ne<tab>New terminal tab: ❯ eol ne<tab> |
|
Sorry for that. The script
Seems that on your side it's installed at the following locations:
Could you please try to source the one corresponding to your shell to check if it exists and if it solves the problem? source /opt/homebrew/share/zsh/site-functions/_python-argcomplete |
That's right.
Yes, that works. |
|
I don't know why it is not sourced automatically by your shell 🤔? |
|
I've no idea...
❯ locate _python-argcomplete
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/argcomplete/bash_completion.d/_python-argcomplete
/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/argcomplete/bash_completion.d/_python-argcomplete
/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/argcomplete/bash_completion.d/_python-argcomplete
/opt/homebrew/Cellar/pipx/1.6.0/libexec/lib/python3.12/site-packages/argcomplete/bash_completion.d/_python-argcomplete
/opt/homebrew/share/zsh/site-functions/_python-argcomplete
❯ which activate-global-python-argcomplete
/Library/Frameworks/Python.framework/Versions/3.13/bin/activate-global-python-argcompleteBut when I run it, it installs from 3.13 to a Homebrew path: ❯ activate-global-python-argcomplete
Defaulting to system-wide installation.
Installing /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/argcomplete/bash_completion.d/_python-argcomplete to /opt/homebrew/share/zsh/site-functions/_python-argcomplete...
Installed.
Installing /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/argcomplete/bash_completion.d/_python-argcomplete to /opt/homebrew/etc/bash_completion.d/python-argcomplete...
Installed.
Please restart your shell or source the installed file to activate it.I don't use Homebrew Python for anything other than letting Homebrew manage it for its own use, so it feels like a bug that the 3.13 Anyway, it also works if I source that 3.13 one in a new tab. What do you suggest? Should I add manual sourcing of that to my |
|
Yes, it's the first (and second) entry in my |
|
Could we get this merged in? would be super helpful for speeding things up in the CLI. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #216 +/- ##
=======================================
Coverage 98.61% 98.61%
=======================================
Files 7 7
Lines 432 433 +1
=======================================
+ Hits 426 427 +1
Misses 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I've resolved the conflict, and tested again, it now works for me! 🎉 ❯ eval "$(register-python-argcomplete eol)"
❯ eol p<tab>
pci-dss panos pangp
phoenix-framework photon perl
phpmyadmin phpbb php
pixel-watch pigeonhole pixel
plone plesk pnpm
postfix pop-os podman
postmarketos powershell postgresql
prometheus privatebin proftpd
proxmox-ve protractor puppet
python --I'll get this merged and released soon, hopefully this week. Would someone like to suggest some text to stick in the README about this? |
Hello,
This is a draft to resolve #125.
As the project is using argparse, I thought it was a good idea to use argcomplete.
This implementation is very simple but it seems to do the trick.
Cheers 🍰