-
Notifications
You must be signed in to change notification settings - Fork 9
[tools/shoestring]: Shortened command and subcommand autocompletion #1439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
[tools/shoestring]: Shortened command and subcommand autocompletion #1439
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1439 +/- ##
==========================================
+ Coverage 98.28% 99.21% +0.93%
==========================================
Files 164 159 -5
Lines 6770 6642 -128
Branches 143 143
==========================================
- Hits 6654 6590 -64
+ Misses 116 52 -64
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
@@ -23,5 +23,9 @@ classifiers = [ | |||
|
|||
include = ['shoestring/lang/*/LC_MESSAGES/messages.mo'] | |||
|
|||
[tool.poetry.scripts] | |||
shoestring = "shoestring.__main__:entry_point" | |||
shoestring-wizard = "shoestring.wizard.__main__:entry_point" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to run tests that go through each entry point, so I’ve added them.
However, these are just tests that pass through the entry points.
Do you think it would be better to include some assertions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Those tests are fine.
Initially, I was thinking of installing a Shoestring(pip install -e .) to verify that the shoestring
command runs.
@@ -1,4 +1,5 @@ | |||
aiohttp~=3.12.6 | |||
argcomplete~=3.6.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to only work with a specific shell? 🤔
You’re using bash or zsh as your shell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
It needs to be executable simply as
shoestring
.
(This has already been addressed viatool.poetry.scripts
.) -
To enable autocompletion, you need to run
eval "$(register-python-argcomplete shoestring)"
(or add it to your.bashrc
to enable it permanently).
Since an extra command is required, it ends up feeling like a hidden feature 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Yes, but I was wondering if
argcomplete
only supports bash or zsh shell -
Yes, will need to update the README on how to enable autocompletion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
It looks like
argcomplete
only supports Bash and Zsh.
Are there any other shells we should consider supporting? For example, PowerShell?
If you have suggestions for other shells worth supporting, let me know — I’ll look into whether we can support them. -
I'll add instructions for enabling autocomplete to the README later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Adding the list of supported shells to the README is sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll add it to the README later.
Enable shell autocompletion using: eval "$(register-python-argcomplete shoestring)"
b0cde07
to
dfe6e29
Compare
Problem
python3 -m
Solution
python3 -m
argcomplete